Skip to content

Add Playwright E2E tests#121

Open
BrianHenryIE wants to merge 1 commit intomonero-integrations:masterfrom
BrianHenryIE:playwright-tests
Open

Add Playwright E2E tests#121
BrianHenryIE wants to merge 1 commit intomonero-integrations:masterfrom
BrianHenryIE:playwright-tests

Conversation

@BrianHenryIE
Copy link

@BrianHenryIE BrianHenryIE commented Sep 19, 2023

This PR makes no changes to the plugin itself.

It adds the wp-env Docker environment which provides two sites, at http://localhost:8888 is a development site, configured so changes made to the plugin are immediately reflected, and at http://localhost:8889 a test site, which when the environment is started, a zip of the plugin is built and installed.

There are two very simple tests included. The .env.secret.dist file needs to be copied to .env.secret and a valid wallet address and viewkey configured.

npx wp-env start
npx playwright test

More commands are documented in the tests/e2e-pw/README.md file.

Playwright (developed by Microsoft) is the end-to-end test framework chosen by WordPress and WooCommerce.

Playwright and wp-env are installed via NPM

npm install

Additionally, the WooCommerce plugin is installed twice, and two copies of WordPress are installed, via Composer

composer install

One copy of WooCommerce is used during the tests, i.e. the distribution build of WooCommerce, and the full woocommerce/woocommerce GitHub repo is installed for access to documentation and code samples. One copy of WordPress is installed for use with Xdebug and the second install is the full WordPress/wordpress-develop repository.

wp-cli/dist-archive-command is installed via Composer to build the plugin zip file. It uses the .distignore file to control what is included in the archive.

The intention is to add more test to truly verify end to end operation of the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant