Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

playwright-html-data-reporter



Playwright reporter that makes the data used for it's html-reporter accessible




license


npm version

## 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)

---

Buy Me A Coffee