From 35ea509e4f13d14e41ef599174eefc6de021b58a Mon Sep 17 00:00:00 2001 From: Ryan Hoover Date: Thu, 1 Nov 2018 15:24:54 -0500 Subject: [PATCH] Clean up & add readme --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++- config/project.conf | 10 -------- 2 files changed, 55 insertions(+), 11 deletions(-) delete mode 100644 config/project.conf diff --git a/README.md b/README.md index fdaa58a..3ce2b98 100644 --- a/README.md +++ b/README.md @@ -1 +1,55 @@ -# docker-wp-browser \ No newline at end of file +# Docker Image for WP Browser Codeception Testing + +This is a standalone docker container for running Codeception tests on a WordPress site. + +Note that this is designed to run in the WordPress root folder, not inside a plugin or theme folder. This is best used for running tests on a custom site. + +## Usage + +Configure [WP Browser](https://github.com/lucatume/wp-browser/) to run tests on your site. + +Create a docker-compose.yml in your project root based on the one below. + +Run the default command on the wpbrowser container + +```shell +docker-compose --file docker-compose.yml run --rm wpbrowser +``` + +## Sample docker-compose + +```yaml +version: '3.7' + +services: + + db: + image: mysql:5.7 + restart: always + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: wordpress + + wpbrowser: + image: ryanshoover/wp-browser:latest + links: + - db:mysql + volumes: + - wp-content:/var/www/html/wp-content + - tests:/var/www/html/tests + - codeception.yml:/var/www/html/codeception.yml + command: codecept run + environment: + DB_NAME: wordpress + DB_HOST: 'db:3306' + DB_USER: wordpress + DB_PASSWORD: wordpress +``` + +## Opinionated Configuration + +This repo has an opinion on how Codeception should be set up. Specifically, it includes a `codeception.dist.yml` file that is based on WP Browser defaults. You can override these settings by placing a `codeception.yml` file in your project root folder. + +The container that is created will have a working instance of WordPress inside it. The instance has a URL of `http://localhost` and expects a database prefix of `wp_`. diff --git a/config/project.conf b/config/project.conf deleted file mode 100644 index 129861d..0000000 --- a/config/project.conf +++ /dev/null @@ -1,10 +0,0 @@ - - Options Indexes FollowSymLinks - AllowOverride None - Require all granted - - - - ServerName wordpress.local - DocumentRoot /root/project -