-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,971 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,83 @@ | ||
# playwright-bdd-example | ||
|
||
Example project that uses [playwright-bdd](https://github.com/vitalets/playwright-bdd) to run BDD tests. | ||
|
||
## How to run it locally | ||
|
||
1. Clone repo | ||
``` | ||
git clone https://github.com/vitalets/playwright-bdd-example.git | ||
``` | ||
|
||
2. CD into directory | ||
``` | ||
cd playwright-bdd-example | ||
``` | ||
|
||
2. Install dependencies | ||
``` | ||
npm install | ||
``` | ||
|
||
3. Install browsers | ||
``` | ||
npx playwright install | ||
``` | ||
|
||
4. Run tests | ||
``` | ||
npm test | ||
``` | ||
Output: | ||
``` | ||
Running 2 tests using 1 worker | ||
2 passed (2.3s) | ||
``` | ||
|
||
5. Check out the report | ||
``` | ||
npm run report | ||
``` | ||
<details> | ||
<summary>Report</summary> | ||
<img src="https://github.com/vitalets/playwright-bdd/assets/1473072/4e2e4803-118a-40bd-a583-7dbe93b9ffd2"/> | ||
</details> | ||
# Playwright + Currents + playwright-bdd (Cucumber) | ||
|
||
This repository showcases running[Playwright](https://playwright.dev) + [Currents](https://currents.dev) + [playwright-bdd](https://github.com/vitalets/playwright-bdd) to run BDD tests, while using [Currents](https://currents.dev) as the reporting dashboard. | ||
|
||
<p align="center"> | ||
<img width="830" src="https://static.currents.dev/currents-playwright-banner-gh.png" /> | ||
</p> | ||
|
||
## Why? | ||
|
||
`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](https://github.com/vitalets/playwright-bdd). | ||
|
||
Read more at: https://www.cy2pw.com/cucumber. | ||
|
||
## Documentation | ||
|
||
The repo contains a few BDD tests with one test that always fails (intentionally): | ||
|
||
- [features/homepage.feature](features/homepage.feature) - has intentionally failing test | ||
- [features/todopage.feature](features/todopage.feature) | ||
|
||
To reproduce the setup: | ||
|
||
- Create an organization, get your **Record Key** and **Project Id** at https://app.currents.dev | ||
|
||
- Clone repo | ||
|
||
```sh | ||
git clone https://github.com/vitalets/playwright-bdd-example.git | ||
``` | ||
|
||
- CD into directory | ||
|
||
```sh | ||
cd playwright-bdd-example | ||
``` | ||
|
||
- Install dependencies | ||
|
||
```sh | ||
npm install | ||
``` | ||
|
||
- Install browsers | ||
|
||
```sh | ||
npx playwright install | ||
``` | ||
|
||
- Run tests | ||
|
||
```sh | ||
npm test | ||
``` | ||
|
||
Output: | ||
|
||
```sh | ||
Running 2 tests using 1 worker | ||
2 passed (2.3s) | ||
``` | ||
|
||
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 | ||
|
||
## Results | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.