-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add info about pw and allure reporters
- Loading branch information
Showing
8 changed files
with
73 additions
and
25 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Allure reporter | ||
|
||
You can output test results with [allure-playwright](https://www.npmjs.com/package/allure-playwright) reporter (not `allure-cucumberjs`). Follow the instructions from allure website: [install](https://allurereport.org/docs/install/) allure itself, install allure-playwright and enable it in the config: | ||
|
||
```js | ||
import { defineConfig } from '@playwright/test'; | ||
import { defineBddConfig } from 'playwright-bdd'; | ||
|
||
const testDir = defineBddConfig({ /* BDD config */ }); | ||
|
||
export default defineConfig({ | ||
testDir, | ||
reporter: 'allure-playwright', // <- enable allure reporter | ||
}); | ||
``` | ||
|
||
Feature file: | ||
```gherkin | ||
Feature: Playwright Home Page | ||
Scenario: Check title | ||
Given I am on Playwright home page | ||
When I click link "Get started" | ||
Then I see in title "Installation" | ||
``` | ||
|
||
Allure report: | ||
![Allure report](./_media/allure-report.png) |
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
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,21 +1,8 @@ | ||
# Reporters | ||
|
||
All [Playwright reporters](https://playwright.dev/docs/test-reporters) are supported out-of-box. Define `reporter` option in `playwright.config.ts` as usual: | ||
Playwright-bdd provides many reporting options: | ||
- native [Playwright reporters](reporters/playwright.md) | ||
- [Cucumber reporters](reporters/cucumber.md) | ||
- third-party reporters like [Allure](reporters/allure.md) | ||
|
||
```js | ||
import { defineConfig } from '@playwright/test'; | ||
import { defineBddConfig } from 'playwright-bdd'; | ||
|
||
const testDir = defineBddConfig({ | ||
features: 'sample.feature', | ||
steps: 'steps.js', | ||
}); | ||
|
||
export default defineConfig({ | ||
testDir, | ||
reporter: 'html', // <- define reporter as usual | ||
}); | ||
``` | ||
|
||
If you need more BDD-adopted reports, have a look on [Cucumber reporters](reporters/cucumber.md). | ||
|
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Playwright reporters | ||
|
||
All [Playwright reporters](https://playwright.dev/docs/test-reporters) are supported out-of-box. They are less BDD-adopted, but contain all the latest features of Playwright reporting. | ||
|
||
Example of enabling Playwright HTML reporter: | ||
```js | ||
import { defineConfig } from '@playwright/test'; | ||
import { defineBddConfig } from 'playwright-bdd'; | ||
|
||
const testDir = defineBddConfig({ /* BDD config */ }); | ||
|
||
export default defineConfig({ | ||
testDir, | ||
reporter: 'html', // <- define reporter as usual | ||
}); | ||
``` | ||
|
||
Feature file: | ||
```gherkin | ||
Feature: Playwright Home Page | ||
Scenario: Check title | ||
Given I am on Playwright home page | ||
When I click link "Get started" | ||
Then I see in title "Installation" | ||
``` | ||
|
||
Report: | ||
![Playwright html report](./_media/pw-html-report.png) | ||
|
||
If you need more BDD-adopted reports, have a look on [Cucumber reporters](reporters/cucumber.md). | ||
|
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