Reports and running tests in CI
Run Playwright on every pull request with GitHub Actions, run tests in parallel across workers and browsers, and keep the HTML report and traces as artifacts.
Transcript
Tests only help if they run all the time. Run them on every pull request in C I, so a bug is caught before it is merged, not after.
Here is a GitHub Actions workflow. On every push or pull request, it gets the code, installs the packages and the browsers, and runs n p x playwright test.
Playwright runs tests in parallel, on several workers, and across browsers: Chromium, Firefox and WebKit. A suite that takes an hour on one worker can finish in minutes.
When a run fails, upload the H T M L report and the traces as artifacts. Anyone on the team can download them, open the trace, and see exactly what went wrong.
Remember: run on every pull request, run in parallel, and keep the report and the trace when a test fails.
More in this series
1:2711Debugging tools: UI mode, codegen, inspector, trace
Find out why a test fails: UI mode with a timeline of snapshots, codegen to draft locators, the inspector to step through, and the trace viewer for failures in CI.
1:2412Flaky tests: find the cause, fix it
What a flaky test is, the usual causes (fixed sleeps, shared data, fragile locators, timing), how to fix each one, and why retries are a safety net, not a cure.
1:3314Your automation plan
A practical plan for a manual tester becoming automation QA: start with ten smoke tests, build them well, triage failures as product bug, test bug or environment, and grow each sprint.