Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.56 KB

E2E.md

File metadata and controls

51 lines (33 loc) · 1.56 KB

E2E Testing using Playwright

How to run the E2E tests

To run the E2E tests you will to install playwright using the following command:

npx playwright install

Note

You also need to use Node.js 18 or later, along with Docker and Docker.

Create the testing instance using the following command:

npm run wp-env start

This will create a WordPress instance. The port is 8889 and the user is admin and the password is password (the same values used by wp-env testing instance).

Note

Read more about wp-env here

For the headless mode, use the following command:

npm run test:e2e:playwright

For debug mode (which will open the browser along with Playwright Editor), use the following command:

npm run test:e2e:playwright:debug

Note

When writing a test, using the debug mode is recommended since it will allow you to see the browser and the test in action.

Learn more about E2E testing

Resources:

To see more examples of E2E tests, check the Gutenberg repository: https://github.com/WordPress/gutenberg/tree/trunk/test/e2e

Note

If you are out of ideas on who to test, check the Gutenberg repository. It has a lot of examples of E2E tests that you can use as a reference.