@arghajit/playwright-pulse-report

中文文档
0.3.5发布于 2026/03/22MITTypeScriptESM + CJS近 30 天下载 2224

A Playwright reporter and dashboard for visualizing test results.

原始使用文档
文档目录27 节
  1. Live Demo
  2. Documentation : Pulse Report
  3. Available Scripts
  4. 🛠️ How It Works
  5. 🏁 Quick Start
  6. 1. Installation
  7. 2. Configure Playwright
  8. 3. Generate Reports
  9. 4. Custom Output Directory (Optional)
  10. 📊 Report Options
  11. Option 1: Static HTML Report (Embedded Attachments)
  12. Option 2: HTML Report (Attachment-based)
  13. Option 3: Email Report
  14. 🤖 AI Analysis
  15. 📧 Send Report to Mail
  16. 1. Configure Recipients
  17. 2. Choose Credential Flow
  18. 3. Run the CLI
  19. ⚙️ CI/CD Integration
  20. Basic Workflow
  21. Sharded Workflow
  22. 🧠 Notes
  23. 🚀 Upgrade Now
  24. ⚙️ Advanced Configuration
  25. Handling Sequential Test Runs
  26. 📬 Support
  27. 🙌🏼 Thank you

Playwright Pluse Report

NPM Version License: MIT NPM Downloads

Playwright Pulse Report

The ultimate Playwright reporter — Interactive dashboard with historical trend analytics, CI/CD-ready standalone HTML reports, and sharding support for scalable test execution.

Live Demo

Features

Documentation: Pulse Report

Available Scripts

The project provides these utility commands:

CommandDescription
generate-reportGenerates playwright-pulse-report.html, Loads screenshots and images dynamically from the attachments/ directory, Produces a lighter HTML file with faster initial load, Requires attachments/ directory to be present when viewing the report
generate-pulse-reportGenerates playwright-pulse-static-report.html, Self-contained, no server required, Preserves all dashboard functionality, all the attachments are embedded in the report, no need to have attachments/ directory when viewing the report, with a dark theme and better initial load handling
merge-pulse-reportCombines multiple parallel test json reports, basically used in sharding
generate-trendAnalyzes historical trends in test results
generate-email-reportGenerates email-friendly report versions
send-emailGenerates email-friendly report versions & Distributes report via email

Run with npm run <command>

🛠️ How It Works

  1. Reporter Collection:

    • Custom reporter collects detailed results during test execution
    • Handles sharding by merging .pulse-shard-results-*.json files
  2. JSON Output:

    • Generates comprehensive playwright-pulse-report.json
  3. Visualization Options:

    • Static HTML: Self-contained report file with all data
    • Email: Send formatted reports to stakeholders

🏁 Quick Start

1. Installation

npm install @arghajit/playwright-pulse-report@latest --save-dev

2. Configure Playwright

// playwright.config.ts
import { defineConfig } from "@playwright/test";
import * as path from "path";

const PULSE_REPORT_DIR = path.resolve(__dirname, "pulse-report");

export default defineConfig({
  reporter: [
    ["list"],
    [
      "@arghajit/playwright-pulse-report",
      {
        outputDir: PULSE_REPORT_DIR,
      },
    ],
  ],
  // Other configurations...
});

3. Generate Reports

After running tests:

npx generate-pulse-report  # Generates static HTML
npx send-email            # Sends email report

4. Custom Output Directory (Optional)

All CLI scripts now support custom output directories, giving you full flexibility over where reports are generated:

# Using custom directory
npx generate-pulse-report --outputDir {YOUR_CUSTOM_REPORT_FOLDER}
npx generate-report -o test-results/e2e
npx send-email --outputDir custom-pulse-reports

# Using nested paths
npx generate-pulse-report --outputDir reports/integration
npx merge-pulse-report --outputDir {YOUR_CUSTOM_REPORT_FOLDER}

Important: Make sure your playwright.config.ts custom directory matches the CLI script:

Custom Output Directory

📊 Report Options

Option 1: Static HTML Report (Embedded Attachments)

npm run generate-pulse-report
or,
npx generate-pulse-report
  • Generates playwright-pulse-static-report.html
  • Self-contained, no server required
  • Preserves all dashboard functionality

Option 2: HTML Report (Attachment-based)

npm run generate-report
or,
npx generate-report
  • Generates playwright-pulse-report.html
  • Loads screenshots and images dynamically from the attachments/ directory
  • Produces a lighter HTML file with faster initial load
  • Requires attachments/ directory to be present when viewing the report

Option 3: Email Report

  1. Configure .env:

    [email protected]
    [email protected]
    # ... up to 5 recipients
    
  2. Send report:

    npx send-email
    

NOTE: Email will be sent with a light-weight html file, which can be opened in mail preview application.

🤖 AI Analysis

The dashboard includes AI-powered test analysis that provides:

  • Test flakiness detection
  • Performance bottlenecks
  • Failure pattern recognition
  • Suggested optimizations

📧 Send Report to Mail

The send-email CLI wraps the full email flow:

  • Generates a lightweight HTML summary (pulse-email-summary.html) from the latest playwright-pulse-report.json.
  • Builds a stats table (start time, duration, total, passed, failed, skipped, percentages).
  • Sends an email with that summary as both the body and an HTML attachment.

1. Configure Recipients

Set up to 5 recipients via environment variables:

[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

2. Choose Credential Flow

The script supports two ways to obtain SMTP credentials:

Flow A – Environment-based credentials (recommended)

Provide mail host and credentials via environment variables:

PULSE_MAIL_HOST=gmail        # or: outlook
[email protected]
PULSE_MAIL_PASSWORD=your_app_password
  • PULSE_MAIL_HOST supports gmail or outlook only.
  • For Gmail/Outlook, use an app password or SMTP-enabled credentials.

Flow B – Default Flow (fallback)

If the above variables are not set, the script fallbacks to default the mail host for compatibility.

3. Run the CLI

Use the default output directory:

npx send-email

Or point to a custom report directory (must contain playwright-pulse-report.json):

npx send-email --outputDir <YOUR_CUSTOM_REPORT_FOLDER>

Under the hood, this will:

  • Resolve the report directory (from --outputDir or playwright.config.ts).
  • Run generate-email-report.mjs to create pulse-email-summary.html.
  • Use Nodemailer to send the email via the selected provider (Gmail or Outlook).

⚙️ CI/CD Integration

Basic Workflow

# .github/workflows/playwright.yml
name: Playwright Tests
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: lts/*
    - name: Install dependencies
      run: npm ci
    - name: Install Playwright Browsers
      run: npx playwright install --with-deps
    - name: Run Playwright tests
      run: npm run test
    - name: Generate Pulse Report
      run: npx generate-report
    - uses: actions/upload-artifact@v4
      if: always()
      with:
        name: pulse-report
        path: pulse-report/
        retention-days: 30

For more details, please refer to the Pulse Report Basic CI/CD Integration.

Sharded Workflow

# .github/workflows/playwright.yml
name: Playwright Tests with Pulse Report
on: [push]
jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        shard: [1, 2, 3, 4]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx playwright test --shard=${{ matrix.shard }}/${{ strategy.job-total }}
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: pulse-report-shard-${{ matrix.shard }}
          path: pulse-report/
          retention-days: 1

  merge-report:
    needs: test
    if: always()
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
      - run: npm ci

      # Download all shard artifacts to a single directory
      - uses: actions/download-artifact@v4
        with:
          path: all-reports
          pattern: pulse-report-shard-*

      # Merge all shard reports into a single report
      - run: npx merge-pulse-report -o all-reports

      # Generate the final HTML report
      - run: npx generate-pulse-report -o all-reports

      # Upload the final merged report
      - uses: actions/upload-artifact@v4
        with:
          name: final-playwright-pulse-report
          path: all-reports/
          retention-days: 7

For more details, please refer to the Pulse Report Sharded CI/CD Integration.

🧠 Notes

  • npm run generate-report generates a HTML report ( screenshots/images will be taken in realtime from 'attachments/' directory ).
  • npm run generate-pulse-report generates a fully self-contained static HTML report( All screenshots and images are embedded directly into the HTML using base64 encoding, which simplifies distribution but may result in larger file sizes and longer load times ).
  • Each shard generates its own playwright-pulse-report.json inside pulse-report/.
  • Artifacts are named using the shard type (matrix.config.type).
  • After the test matrix completes, reports are downloaded, renamed, and merged.
  • merge-report is a custom Node.js script that combines all JSON files into one.

Folder-Structure

🚀 Upgrade Now

npm install @arghajit/playwright-pulse-report@latest

⚙️ Advanced Configuration

Handling Sequential Test Runs

By default, the reporter will overwrite the playwright-pulse-report.json file on each new test run. This is usually what we want. However, if we run tests sequentially in the same job, like this:

npx playwright test test1.spec.ts && npx playwright test test2.spec.ts

By default, In this above scenario, the report from test1 will be lost. To solve this, you can use the resetOnEachRun option.

// playwright.config.ts
import { defineConfig } from "@playwright/test";
import * as path from "path";

// Define where the final report JSON and HTML should go
const PULSE_REPORT_DIR = path.resolve(__dirname, "pulse-report"); // Example: a directory in your project root

export default defineConfig({
  reporter: [
    ["list"],
    [
      "@arghajit/playwright-pulse-report",
      {
        outputDir: PULSE_REPORT_DIR,
        // Add this option
        resetOnEachRun: false, // Default is true
      },
    ],
  ],
  // ...
});

How it works when resetOnEachRun: false:

  • On the first run, it saves report-1.json to a pulse-report/pulse-results directory and creates the main playwright-pulse-report.json from it.
  • On the second run, it saves report-2.json to the same directory.
  • It then automatically reads both report-1.json and report-2.json, merges them, and updates the main playwright-pulse-report.json with the combined results.

This ensures your final report is always a complete summary of all sequential test runs.


pulse dashboard

Real-time Playwright Test Monitoring & Analysis

A Next.js component & CLI tool for visualizing Playwright test executions. Provides real-time insights, historical trends, and failure analysis.

Key Features:

  • Interactive test result visualization
  • Historical trend analysis
  • Failure pattern identification

Quick Start:

npx pulse-dashboard
  or,
npm run pulse-dashboard

(Run from project root containing pulse-report/ directory)

NPM Package: pulse-dashboard

Tech Stack: Next.js, TypeScript, Tailwind CSS, Playwright

Part of the Playwright Pulse Report ecosystem


📬 Support

For issues or feature requests, please Contact Me.


🙌🏼 Thank you

Special Thanks to @Suman Vishwakarma, for continuous UAT feedback.


Made by Arghajit Singha | MIT Licensed

版本与发布记录

@arghajit/playwright-pulse-report 共发布 24 个版本,首次发布于 2025/05/07;过去 12 个月发布了 10 个版本。

版本发布日期距今
0.3.5latest2026/03/227 个月前
0.3.42026/02/138 个月前
0.3.32026/01/309 个月前
0.3.22026/01/099 个月前
0.3.12026/01/0710 个月前
0.3.02025/12/2110 个月前

关于 @arghajit/playwright-pulse-report 的常见问题

@arghajit/playwright-pulse-report 是什么?

A Playwright reporter and dashboard for visualizing test results.

如何安装 @arghajit/playwright-pulse-report?

在项目目录运行 npm install @arghajit/playwright-pulse-report,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@playwright/test(>=1.40.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 logo、generate-pulse-report、generate-report、merge-pulse-report、send-email、generate-email-report、generate-trend、pulse-logo,可以用 npx logo 直接运行。

@arghajit/playwright-pulse-report 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@arghajit/playwright-pulse-report 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@arghajit/playwright-pulse-report 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@arghajit/playwright-pulse-report 可以商用吗?

@arghajit/playwright-pulse-report 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@arghajit/playwright-pulse-report 的下载量有多少?

根据 npm 官方下载统计,@arghajit/playwright-pulse-report 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,224 次,日均约 74 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@arghajit/playwright-pulse-report 还在维护吗?

最新版本 0.3.5 发布于 2026/03/22(7 个月前);至今共发布 24 个版本,其中过去 12 个月发布了 10 个;首次发布于 2025/05/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。