This repository showcases running Playwright + Currents + playwright-bdd to run BDD tests, while using Currents as the reporting dashboard.
cucumber-js
is a mature and popular test runner, however, it is different from the native Playwright test runner - those are not compatible. To utilize the native Playwright test runner with BDD it is suggested to use playwright-bdd.
Read more at: https://www.cy2pw.com/cucumber.
The repo contains a few BDD tests with one test that always fails (intentionally):
- features/homepage.feature - has intentionally failing test
- features/todopage.feature
To reproduce the setup:
-
Create an organization, get your Record Key and Project Id at https://app.currents.dev
-
Clone repo
-
Install dependencies
npm install
-
Install browsers
npx playwright install
-
Set Record Key and Project Id in
playwright.config.ts
-
Run tests
npm test
Output:
=============================================== Uploading results to Currents.dev... Cloud Run Finished: https://app.currents.dev/run/1f2e431c6d46675e ================================================
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/ci-build-id
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: