@cyborgtests/reporter

中文文档
3.0.0发布于 2026/07/28MITTypeScriptCommonJS近 30 天下载 7.9万

Reporter that uploads your blob reports to playwright reports server

原始使用文档
文档目录10 节
  1. Install
  2. Basic Configuration
  3. Shards
  4. Test Quarantine Feature
  5. How It Works
  6. Enabling Test Quarantine
  7. The checkQuarantine Fixture
  8. Configuration Options
  9. What Happens During Test Execution
  10. Troubleshooting

reporter

Playwright reporter that uploads results to Playwright Reports Server - https://github.com/CyborgTests/playwright-reports-server

Install

npm i -D @cyborgtests/reporter

Basic Configuration

In your playwright.config.ts or playwright.config.js:

  reporter: [
    // blob reporter is required, produced zip would be uploaded
    ['blob', { outputFile: 'test-results/blob.zip' }],
    [
      '@cyborgtests/reporter',
      {
        // true by default. Use this if you need to skip this reporter for some cases (local executions for example)
        enabled: true,
        /**
         * Your server url
         * @see https://github.com/CyborgTests/playwright-reports-server
         */
        url: 'https://your server instance.com',
        // Set token if your server instance has authentication enabled
        token: '1234',
        // Timeout for reporter HTTP requests to finish, default 60000ms, increase if you have slow server and big requests.
        requestTimeout: 60000,
        // Relative path to your blob. Required.
        reportPath: 'test-results/blob.zip',
        // Any custom metadata to attach to this blob (strings)
        resultDetails: {
          branch: process.env.CI_COMMIT_BRANCH,
          foo: 'bar',
          bar: 'baz'
        },
        // Automatically trigger HTML report generation after tests finish. Shards supported. false by default
        triggerReportGeneration: false
      },
    ],
  ],

Then run your tests, if you see [ReporterPlaywrightReportsServer] 🎭 HTML Report is available at: ... - your blob results were successfully sent to server!

Shards

Auto-generation of report after all shards completed is supported. But you must specify testRun and triggerReportGeneration: true:

  • In reporter configuration pass
resultDetails: {
  ...
  // testRun required, it should be same for all shards!
  testRun: 'my-awesome-test-run-12'
  ...
},
triggerReportGeneration: true

Reporter passes current shard number and total shard count to server, and after all shards uploaded - report will be generated by server for all blobs in this testRun

Test Quarantine Feature

The Test Quarantine feature allows you to automatically skip tests that have been marked as unstable or flaky directly from the Playwright Reports Server UI. This helps to prevent unstable tests from blocking your CI/CD pipelines.

How It Works

  1. Tests are marked as quarantined in the Playwright Reports Server manually via web UI (Analytics page) or automatically (if specified on Settings page)
  2. Before test execution, the reporter fetches the list of quarantined tests from the server
  3. The reporter writes this list to a local JSON file
  4. During test execution, each test is checked against the quarantine list
  5. Quarantined tests are automatically skipped with the reason stored in the server

Enabling Test Quarantine

To enable automatic skipping of quarantined tests:

  1. Import the extended test fixture from the reporter package
  2. Enable skipQuarantinedTests in the reporter configuration
  3. Use the extended test fixture in your config
import { defineConfig } from '@playwright/test';
import { test } from '@cyborgtests/reporter';

export default defineConfig({
  reporter: [
    ['blob', { outputFile: 'test-results/blob.zip' }],
    [
      '@cyborgtests/reporter',
      {
        url: 'http://localhost:3000',
        reportPath: 'test-results/blob.zip',
        // Specify the project name to fetch quarantined tests for
        resultDetails: {
          project: 'my-project',
        },
        // Enable test quarantine
        skipQuarantinedTests: true,
        // Optional: Custom path for the quarantine file (default: './quarantine.json')
        quarantineFilePath: './quarantine.json',
      },
    ],
  ],
  // Use the extended test fixture that checks quarantine status
  test: test,
});

The checkQuarantine Fixture

The reporter exports an extended test fixture that includes a checkQuarantine hook which is responsible for checking if a test is quarantined.

Configuration Options

OptionTypeDefaultDescription
skipQuarantinedTestsbooleanfalseEnable automatic skipping of quarantined tests
quarantineFilePathstring'./quarantine.json'Path where the quarantine list will be stored

What Happens During Test Execution

When skipQuarantinedTests is enabled:

  1. Before tests run (onBegin):

    • The reporter fetches quarantined tests from /api/tests?status=quarantined&project=<your_project>
    • Results are written to quarantineFilePath
  2. During each test (checkQuarantine fixture):

    • The fixture reads the quarantine file
    • Checks if testId matches any quarantined test ID
    • If matched skips the test
  3. After tests complete (onEnd):

    • Results are uploaded to the server
    • Report is generated if triggerReportGeneration is true

Troubleshooting

Quarantine file not found warning:

[checkQuarantinedTests] Quarantine file not found at ./quarantine.json, proceeding without skipping tests.

Ensure the reporter can fetch quarantined tests from the server (check network and authentication).

Tests not being skipped:

  • Verify skipQuarantinedTests: true is set
  • Verify you're using the extended test fixture: import { test } from '@cyborgtests/reporter'
  • Check the project in resultDetails matches the project name in the server, if you do not have the project - it can be skipped
  • Ensure the quarantine file is being generated correctly

All tests being skipped:

  • Check that the server's test management thresholds are configured appropriately
  • Verify tests are correctly marked as quarantined in the server UI (Analytics page)

版本与发布记录

@cyborgtests/reporter 共发布 1 个版本,首次发布于 2026/07/28;过去 12 个月发布了 1 个版本。

版本发布日期距今
3.0.0latest2026/07/283 个月前

关于 @cyborgtests/reporter 的常见问题

@cyborgtests/reporter 是什么?

Reporter that uploads your blob reports to playwright reports server

如何安装 @cyborgtests/reporter?

在项目目录运行 npm install @cyborgtests/reporter,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@playwright/test(^1.59.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 playwright-reporter-cli,可以用 npx playwright-reporter-cli 直接运行。

@cyborgtests/reporter 支持 TypeScript 吗?

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

@cyborgtests/reporter 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cyborgtests/reporter 可以商用吗?

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

@cyborgtests/reporter 的下载量有多少?

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

@cyborgtests/reporter 还在维护吗?

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