Created to support the workshop "Acceptance testing in WP – Let’s automate the visual checks and regression testing (EN)"
- Clone this repository to the WordPress plugin folder. Depending on your local environment setup that might vary.
- There is no need to install Composer dependencies as those come pre-installed for you.
- Start by writing, from the plugin root directory,
vendor/bin/codecept init acceptance
.
The plugin includes a docker-compose.yml
file.
The file contains a ready-to-run, container-based, stack you can use to run this project tests in isolation, without having to locally setup a WordPress installation.
It requires a containerization solution like Docker or podman and docker-compose.
To setup tests to run against the stack create a codeception.yml
file in the plugin root directory, with this content:
params:
- '.env.testing.docker'
Start the container stack with docker-compose -d up
, wait for the WordPress website to be available at http://localhost:8081
, and run vendor/bin/codecept run acceptance --debug
to run the acceptance tests.