Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samhuk/playwright-html-data-reporter
Playwright reporter that makes the data used for it's html-reporter accessible
https://github.com/samhuk/playwright-html-data-reporter
html html-reporter playwright reporter
Last synced: about 2 months ago
JSON representation
Playwright reporter that makes the data used for it's html-reporter accessible
- Host: GitHub
- URL: https://github.com/samhuk/playwright-html-data-reporter
- Owner: samhuk
- License: mit
- Created: 2023-01-24T11:55:59.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T12:47:57.000Z (about 2 years ago)
- Last Synced: 2024-12-06T08:35:49.016Z (about 2 months ago)
- Topics: html, html-reporter, playwright, reporter
- Language: TypeScript
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: contributing/development.md
- License: LICENSE
Awesome Lists containing this project
README
playwright-html-data-reporter
Playwright reporter that makes the data used for it's html-reporter accessible## Overview
This package provides a [Playwright Reporter](https://playwright.dev/docs/test-reporters#custom-reporters) that makes the data that their [HTML Reporter](https://playwright.dev/docs/test-reporters#html-reporter) produces and uses easily accessible.
## Usage
```typescript
import { PlaywrightTestConfig } from '@playwright/test/types/test'const playwrightConfig: PlaywrightTestConfig = {
...
reporter: [
['html', { open: 'never', outputFolder: './my-playwright-results' }],
['playwright-html-data-reporter', { outputFile: 'data.txt' }],
],
...
}
// Observe file at './my-playwright-results/data.txt' containing the data that the HTML Reporter uses
```## Why
This package makes it easier to display Playwright test results in third-party apps.
Currently, their HTML Reporter does not expose how it produces it's data, nor makes it available via config, nor makes it otherwise easily accessible, instead only embedding it within it's "self-contained report" `index.html` file. This data, which is a zip-compressed, base-64-encoded string, can then be read and fed into front-end components like their [ReportView](https://github.com/microsoft/playwright/blob/main/packages/html-reporter/src/reportView.tsx) or a completely different component.
This comes off of the declination of [a request](https://github.com/microsoft/playwright/issues/20274) to make that data and the React component the HTML Reporter uses to render it accessible. If/when this is accepted in the future, this package can likely be deprecated.
## Development
See [./contributing/development.md](./contributing/development.md)
---