README update

This commit is contained in:
Jon Lane 2022-10-24 15:51:13 -07:00
parent 7daf26ce39
commit e916ac3fca
1 changed files with 54 additions and 59 deletions

View File

@ -34,19 +34,21 @@ End-to-end tests are powered by Playwright. The test site is spinned up using `w
- `nvm use` - `nvm use`
- `pnpm install` - `pnpm install`
- `pnpm run build --filter=woocommerce` - `pnpm run build --filter=woocommerce`
- `pnpm env:test --filter=woocommerce` - `cd plugins/woocommerce`
- `pnpm env:test`
- `pnpm test:e2e-pw`
To run the test again, re-create the environment to start with a fresh state: To run the test again, re-create the environment to start with a fresh state:
- `pnpm env:destroy --filter=woocommerce` - `pnpm env:destroy`
- `pnpm env:test --filter=woocommerce` - `pnpm env:test`
Other ways of running tests: Other ways of running tests:
- `pnpm env:test --filter=woocommerce` (headless) - `pnpm test:e2e-pw` (usual, headless run)
- `cd plugin/woocommerce && USE_WP_ENV=1 pnpm playwright test --config=tests/e2e-pw/playwright.config.js --headed` (headed) - `pnpm test:e2e-pw --headed` (headed -- browser window shown)
- `cd plugins/woocommerce && USE_WP_ENV=1 pnpm playwright test --config=tests/e2e-pw/playwright.config.js --debug` (debug) - `pnpm test:e2e-pw --debug` (runs tests in debug mode)
- `cd plugins/woocommerce && USE_WP_ENV=1 pnpm playwright test --config=tests/e2e-pw/playwright.config.js ./tests/e2e-pw/tests/activate-and-setup/basic-setup.spec.js` (running a single test) - `pnpm test:e2e-pw ./tests/e2e-pw/tests/activate-and-setup/basic-setup.spec.js` (runs a single test)
To see all options, run `cd plugins/woocommerce && pnpm playwright test --help` To see all options, run `cd plugins/woocommerce && pnpm playwright test --help`
@ -62,7 +64,6 @@ The default values are:
If you want to customize these, check the [Test Variables](#test-variables) section. If you want to customize these, check the [Test Variables](#test-variables) section.
For more information how to configure the test environment for `wp-env`, please checkout the [documentation](https://github.com/WordPress/gutenberg/tree/trunk/packages/env) documentation. For more information how to configure the test environment for `wp-env`, please checkout the [documentation](https://github.com/WordPress/gutenberg/tree/trunk/packages/env) documentation.
### Test Variables ### Test Variables
@ -93,7 +94,7 @@ Edit [.wp-env.json](https://github.com/woocommerce/woocommerce/blob/trunk/plugin
**Modiify port for e2e-environment** **Modiify port for e2e-environment**
Edit [tests/e2e/config/default.json](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/e2e/config/default.json).**** Edit [tests/e2e/config/default.json](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/e2e/config/default.json).\*\*\*\*
### Starting/stopping the environment ### Starting/stopping the environment
@ -126,17 +127,11 @@ Based on our example, the test skeleton would look as follows:
```js ```js
test.describe( 'Merchant can create virtual product', () => { test.describe( 'Merchant can create virtual product', () => {
test( 'merchant can log in', async () => { test( 'merchant can log in', async () => {} );
} ); test( 'merchant can create virtual product', async () => {} );
test( 'merchant can create virtual product', async () => { test( 'merchant can verify that virtual product was created', async () => {} );
} );
test( 'merchant can verify that virtual product was created', async () => {
} );
} ); } );
``` ```