End-to-end Tests
Testing functionality with End-to-end tests
Last updated
Testing functionality with End-to-end tests
Last updated
For end-to-end testing we use which is the tool that WordPress is soon going to be using for their own tests.
A very simple test might look like this:
For now we can only run these tests on local environments, but we will soon add them to our CI as well.
Assuming your is already up and running, you first need to install test dependencies.
This only needs to happen once:
To run all the tests just run:
If you want to run individual tests it's easiest to go inside the relevant repo folder and pick the test you want to run:
At the end of the tests run a browser will open with the full test results report. Failing tests will have a screenshot on the step that failed.
You can use the --debug
flag in order to debug your test(s), as follows:
If you use VS Code as your editor, there is a that you can use for all things Playwright!