This is the documentation for version 4 of the project, the current version. Documentation for the previous version of the project, version 3, can be found here.
The wp-browser library provides a set of Codeception modules and middleware to enable the testing of WordPress sites, plugins and themes.
Add wp-browser to your project as a development dependency using Composer
Initialize wp-browser to quickly configured to suite your project and setup:
The command will set up your project to run integration and end-to-end tests using:
- SQLite as the database engine, leveraging the SQLite Database Integration plugin
- PHP built-in web server to serve the WordPress site on localhost (e.g.
- Chromedriver to drive the local version of Chrome installed on your machine
If you're working on a plugin or theme project, the default configuration will add some extra steps:
- install the latest version of WordPress in the
- create a
tests/_pluginsdirectory: any file or directory in this directory will be symlinked into the WordPress installation in
- create a
tests/_themesdirectory: any file or directory in this directory will be symlinked into the WordPress installation in
For most projects this configuration will be enough to get started with testing.
You can run your tests immediately using the
vendor/bin/codecept run command.
Using a custom configuration
If you decide to skip the default configuration, you will be able to set up
wp-browser to suit your needs and local
setup by editing the
The inline documentation in the file will guide you through the configuration process.
Getting support for wp-browser configuration and usage
If you can't find the answer to your question here you can ask on the "Issues" section of the wp-browser repository taking care to provide as much information as possible.
Finally, you can contact me directly to set up a call to discuss your project needs and how wp-browser can help you.