Stars: 560
Forks: 83
Pull Requests: 296
Issues: 336
Watchers: 17
Last Updated: 2023-09-15 21:35:04
The easy and reliable way to test WordPress with Codeception. 10 years of proven success.
License: MIT License
Languages: PHP, Python, CSS, HTML, Dockerfile, Hack, Makefile, Shell, Handlebars, TLA, XSLT
You can use wp-browser to test WordPress sites, plugins and themes.
Add wp-browser to your project as a development dependency using Composer
cd my-wordrpess-project
composer require --dev lucatume/wp-browser
Initialize wp-browser to quickly configured to suite your project and setup:
vendor/bin/codecept init wpbrowser
The command will set up your project to run integration and end-to-end tests using:
http://localhost:8080
)If you're working on a plugin or theme project, the default configuration will add some extra steps:
tests/_wordpress
directorytests/_plugins
directory: any file or directory in this directory will be symlinked into the WordPress
installation in tests/_wordpress/wp-content/plugins
tests/_themes
directory: any file or directory in this directory will be symlinked into the WordPress
installation in tests/_wordpress/wp-content/themes
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.
Read more about the commands provided by the library here.
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 tests/.env
file.
The inline documentation in the file will guide you through the configuration process.
Read more about using a custom configuration here.
The best place to get support for wp-browser is the project documentation.
Since this project builds on top of PHPUnit and Codeception, you can also refer to their documentation.
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.
A thanks to my sponsors: you make maintaining this project easier.