0.0.3 • Published 1 year ago

playwright-html-data-reporter v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Overview

This package provides a Playwright Reporter that makes the data that their HTML Reporter produces and uses easily accessible.

Usage

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 or a completely different component.

This comes off of the declination of a request 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