- NodeJS - https://nodejs.org/en/
- npm - https://www.npmjs.com/get-npm
- Local by Flywheel - https://localwp.com/
- git version control - https://git-scm.com/downloads
- Create a Local by Flywheel test site on http://e2etest.local/ this should only be used for testing. Username and password for this test site should be set as "admin".
- Go to your test site's plugins folder. Type
cd /path/to/test/site/.../app/public/wp-content/plugins
- Clone the repository to the plugins folder by typing
git clone https://github.com/gambitph/Stackable-e2e-tests.git
- Type
cd /path/to/Stackable-e2e-tests
- Install node package dependencies by typing
npm install
- Open your browser and go to http://e2etest.local/wp-admin/plugins.php. Activate the plugin.
- Install and activate the plugin you want to test.
- Open plugin.php located at the root folder of the repository. Change the default slug in line 19 and 40 as follows:
$PLUGIN = 'your-plugin-slug-here/plugin.php';
$plugins_activated[] = get_plugin_slug( 'your-plugin-slug-here' );
- Start writing your tests.
- Make sure this plugin is activated in your test site.
- Run
npm run test
- In the window that opens, pick a test to run or click run all tests.