https://github.com/nkyazhin/jest-puppeteer-allure
This package allows you to generate an allure report.
https://github.com/nkyazhin/jest-puppeteer-allure
allure allure-report jest jest-playwright jest-puppeteer-allure jest-reporter playwright puppeteer puppeteer-screenshot
Last synced: about 7 hours ago
JSON representation
This package allows you to generate an allure report.
- Host: GitHub
- URL: https://github.com/nkyazhin/jest-puppeteer-allure
- Owner: nkyazhin
- License: mit
- Created: 2019-05-17T11:42:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-02T14:07:57.000Z (almost 5 years ago)
- Last Synced: 2025-07-31T06:44:12.223Z (2 months ago)
- Topics: allure, allure-report, jest, jest-playwright, jest-puppeteer-allure, jest-reporter, playwright, puppeteer, puppeteer-screenshot
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 0
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
jest-puppeteer-allure
=========
[](https://www.npmjs.com/package/jest-puppeteer-allure)
[](https://www.npmjs.org/package/jest-puppeteer-allure)This package allows you to generate an allure report. The allure report contains screenshots and errors from the browser console if the test fails.
## Getting Started
### Prerequisites
The following packages must be installed in your project: `jest` and `puppeteer` (`playwright`).
And `page` variable should be global variable.
### Installing
```
npm install --save-dev jest-puppeteer-allure
```### Usage
Add to jest config:
```
reporters: ["default", "jest-puppeteer-allure"]
```
or
```
setupFilesAfterEnv: ['jest-puppeteer-allure/src/registerAllureReporter']
```
**If you have your own setupTestFrameworkScriptFile file**, you need to manually register reporter, for it you need add import:
```js
import registerAllureReporter from 'jest-puppeteer-allure/src/registerAllureReporter';
```#### Advanced features
You can add description, screenshots, steps, severity and lots of other
fancy stuff to your reports.Global variable `reporter` available in your tests with such methods:
```
description(description: string): this;
severity(severity: Severity): this;
epic(epic: string): this;
feature(feature: string): this;
story(story: string): this;
startStep(name: string): this;
endStep(status?: Status): this;
addArgument(name: string): this;
addEnvironment(name: string, value: string): this;
addAttachment(name: string, buffer: any, type: string): this;
addLabel(name: string, value: string): this;
addParameter(paramName: string, name: string, value: string): this;
```
Example:
```js
it('Test', async () => {
reporter
.feature('Feature')
.story('Story');
await page.goto('http://example.com');
const screenshot = await page.screenshot();
reporter.addAttachment('Screenshot', screenshot, 'image/jpg');
})
```
If you use [jest-image-snapshot](https://github.com/americanexpress/jest-image-snapshot) then diff image attach to test report.
If you use WebStorm install [Toolbox](https://www.jetbrains.com/toolbox-app/) and open tests from report.