/playwright-merge-html-reports

Merge multiple playwright HTML Reports into a single one

Primary LanguageHTMLApache License 2.0Apache-2.0

Merge Playwright HTML reports

  • Merge Playwright HTML reports to a single HTML report

  • The index.html file is generated and other artifacts (screenshot, trace file etc) are copied from the source folders to the merged Report folder

  • Built on node 14.18.1.

  • Note: @playwright/test is a peer dependency, not a dev dependency.

  • Inspiration microsoft/playwright#10437

⚠️ Tested on some use cases: Use at your own risk. Still at early stages of development

Usage

npm install playwright-merge-html-reports --dev
  • You will need to install @playwright/test package first (if not already done).
  • In your Node.js script
const { mergeHTMLReports } = require("playwright-merge-html-reports");

Arguments

  1. inputReportPaths - Array of path to html report folders
mergeHTMLReports([
  process.cwd() + "/html_report-1",
  process.cwd() + "/html_report-2"
])
  1. config - Optional
const inputReportPaths = [
  process.cwd() + "/html_report-1",
  process.cwd() + "/html_report-2"
];

const config = {
  outputFolderName: "merged-html-report", // default value
  outputBasePath: process.cwd() // default value
}

mergeHTMLReports(inputReportPaths, config)

Spec

  • TS support
  • Uses jszip and yazl for encoding and decoding zipped content from the index.html file.

Upcoming features

  • Usage directly on Command line