WordPress Plugin Acceptance Test with Codeception on VVV – Typist Tech


Ever anxious about pushing new release of WordPress plugin causing the white screen of death on your clients’ sites? You should write some acceptance tests! I will demonstrate how to leverage Varying Vagrant Vagrants, Codeception and wp-browser to write acceptance tests for WordPress plugins. Codeception is a PHP testing framework built on PHPUnit that automates acceptance testing. It does functional and unit tests also.
wp-browser is a WordPress specific set of extensions for Codeception written by theAverageDev.
The package includes a class extending Codeception PhpBrowser module that adds WordPress related assertions for cest and cept tests, an extension of Codeception own Db module meant to allow for more comfortable WordPress specific database handling and testing and a class taking care of installing and loading a WordPress installation relying on WordPress automated testing suite.
We’ll run our tests from within VVV because WP CLI, Node, and Composer are already installed for us there.
Before we actually writing the tests, we need a WordPress installation and a plugin to test. I use my plugin Remove Medium Cross Links as an example. All it does is remove the medium
Source: https://managewp.org/articles/14191/wordpress-plugin-acceptance-test-with-codeception-on-vvv-typist-tech




source https://williechiu40.wordpress.com/2017/01/12/wordpress-plugin-acceptance-test-with-codeception-on-vvv-typist-tech/