Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

playwright-merge-summary-json-reports

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-merge-summary-json-reports

A package that will make it easy to merge summary.json files output from playwright customer reporter playwright-json-summary-reporter.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.7K
decreased by-16.97%
Maintainers
1
Weekly downloads
 
Created
Source

playwright-merge-summary-json-reports

npm (scoped)

This package works in tandem with:

  • https://www.npmjs.com/package/playwright-merge-html-reports
  • https://www.npmjs.com/package/@butchmayhew/playwright-json-summary-reporter

The walk through found on https://playwrightsolutions.com.

The above package will generate a summary.json report after the Playwright run, while this package will combine multiple summary.json files into 1 file after a run with the --shard=x/x command.

Install

npm install playwright-merge-summary-json-reports --save-dev

Usage

Create a new file file in the appropriate directory

// lib/metrics/mergeReports.ts

import fs from "fs";
import path from "path";
import { mergeHTMLReports } from "playwright-merge-html-reports";
import { mergeSummary } from "playwright-merge-summary-json-reports";

const reportPathsToMerge = fs
  .readdirSync(process.cwd() + "/playwright-report", { withFileTypes: true })
  .filter((item) => item.isDirectory())
  .map(({ name }) => path.resolve(process.cwd() + "/playwright-report", name));

async function runReport(paths: string[]) {
  // merges the summary.json in each report-x folder and saves a summary.json to root directory
  await mergeSummary(paths);

  // merges html reports and saves to /html-report
  await mergeHTMLReports(paths, {
    outputFolderName: "html-report",
  });
}

runReport(reportPathsToMerge);

After a test run, where there is a folder /playwright-report with multiple sub-folders /report-1, /report-2/, etc. Running the command npx ts-node lib/metrics/mergeReports.ts will search through the folders for both html and json reports and combine them, and output the html report to html-report and the combined summary.json to the main directory.

If you found this helpful feel free to check out https://playwrightsolutions.com!

Keywords

FAQs

Package last updated on 14 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc