https://github.com/rippling/playwright-merge-html-reports
  
  
    Merge multiple playwright HTML Reports into a single one 
    https://github.com/rippling/playwright-merge-html-reports
  
playwright
        Last synced: 7 months ago 
        JSON representation
    
Merge multiple playwright HTML Reports into a single one
- Host: GitHub
- URL: https://github.com/rippling/playwright-merge-html-reports
- Owner: Rippling
- License: apache-2.0
- Created: 2022-09-20T10:01:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T21:58:05.000Z (about 2 years ago)
- Last Synced: 2025-03-18T06:54:09.462Z (8 months ago)
- Topics: playwright
- Language: HTML
- Homepage: https://www.npmjs.com/package/playwright-merge-html-reports
- Size: 8.95 MB
- Stars: 18
- Watchers: 12
- Forks: 5
- Open Issues: 4
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          # 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 https://github.com/microsoft/playwright/issues/10437
## Usage
```bash
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 
```js 
const { mergeHTMLReports } = require("playwright-merge-html-reports");
```
### Arguments
1. `inputReportPaths` - Array of path to html report folders
```js
mergeHTMLReports([
  process.cwd() + "/html_report-1",
  process.cwd() + "/html_report-2"
])
```
2. `config` - Optional
```js
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