Playwright - GitHub Actions
Running Playwright tests in Parallel in GitHub Actions using Matrix Workflow
Last updated
Running Playwright tests in Parallel in GitHub Actions using Matrix Workflow
Last updated
Currents collects Playwright test results from GitHub Action CI Runners, together with the generated artifacts (trace files, screenshots, videos) for more efficient troubleshooting and providing insights into the test suite performance:
console output
screenshots
videos
traces
Read our Playwright Parallelization guide to discover more about parallelizing your Playwright test in GitHub Actions.
When a workflow fails in GitHub Actions you have the option to re-run the failed jobs. However, an additional setup is required for properly configure Playwright for rerunning only the failed tests.
See Re-run Only Failed Tests guide for details.
Step-by-step guide:
Full examples:
If you're using Currents Orchestration for running your Playwright tests you can also fetch the results of from API.
Step-by-step guide:
Example workflow:
The last-failed-action gets the previous run information using the default CI build ID pattern:
${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}
If you are using a different CI Build ID, specify the previous-ci-build-id
configuration property.
For example:
and speed up you CI pipeline by running tests in parallel - playwright support splitting the tests between multiple CI machines using --shard
CLI flag. Playwright Orchestration improves the parallel execution even more by optimally balancing your tests across the available CI machines.
The showcases running Playwright tests in GitHub Actions. We've included several config files to exemplify the workflows:
- run Playwright tests in parallel using 3 shards of GitHub Actions Matrix and pwc
command.
- run Playwright tests in parallel run using 3 shards of GitHub Actions Matrix and configuring Currents Reporter in playwright.config.ts
.
- run Playwright tests in parallel Playwright using Playwright Orchestration and GitHub Actions Matrix. Currents Orchestration speeds up CI runs by up to 40% (compared to native sharding) by optimally balancing tests between the available machines.
- run Playwright tests in parallel using Currents Orchestration, use Argos CI for visual testing.
If you're using Playwright Sharding for running your tests in parallel, add to simplify the re-runs.
See the .
- rerun only the tests that failed in the previous run, using pwc
helper command that is included in @currents/playwright
package.
- rerun only the tests that failed in the previous run, using reporter explicitly configured in playwright.config.ts
Obtain an API key (see API Keys) from Currents Dashboard (in addition to Record Key) and set
See the on the inputs.
- rerun only the tests that failed in the previous orchestrated run.