This repo showcases Playwright integration with Currents. The example is based on https://github.com/MarcusFelling/demo.playwright, the basic test scenarios.
See the .gitlab-ci.yml file - it created a GitLab CI pipeline with 3 workers using 3 Playwright Shards.
Example command:
npx pwc --key $CURRENTS_RECORD_KEY --project-id bnsqNa --shard=$CI_NODE_INDEX/$CI_NODE_TOTAL- Create an account at https://app.currents.dev and grab the Project ID and Record Key.
- Add
CURRENTS_RECORD_KEYas GitLab CI/CD Secrets (make sure it's not protected) - [Optional] Add
CURRENTS_API_KEYas GitLab CI/CD Secrets (only used in the examples withnpx currents apicommands)
Additional resources:
- Playwright Features on Currents: https://currents.dev/playwright
- Integration Documentation: https://currents.dev/readme/integration-with-playwright/currents-playwright
- CI Build ID Guide: https://currents.dev/readme/guides/cypress-ci-build-id
.gitlab-ci.yml- The basic 3 parrallel job sharded pipeline- Examples of running only the failed tests when retrying a CI pipeline/job
- For
playwright test(with currents reporter) :./gitlab/ci/with-reruns-reporter.yml - For
pwc:./gitlab/ci/with-reruns-pwc.yml - For
pwc-p(orchestration) :./gitlab/ci/with-reruns-pwcp.yml
- For
The results are being reported to Currents for more efficient troubleshooting, and monitoring test suite flakiness and performance.
Currents will collect the following information:
- console output
- screenshots
- videos
- trace files
- timing
- outcomes
- flaky tests
- error details
- tags for more convenient management of the tests
Take a look at the example merge request: https://gitlab.com/currents.dev/gitlab-playwright-currents/-/merge_requests/3
When GitLab integration is enabled, Currents will post a Merge Commit note with run results:
In addition, Currents will post an External Status check for every Playwright project configured. For example:
Video

