Reports and running tests in CI

Knowledge Videos

Short animated explainers, organised by subject.

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