@artilleryio/playwright-reporter

中文文档
1.1.3发布于 2025/02/26SEE LICENSE IN LICENSE.txtTypeScriptESM + CJS近 30 天下载 2.4万

Playwright reporter for Artillery Cloud

原始使用文档
文档目录12 节
  1. Learn more
  2. Usage
  3. Install the reporter
  4. Enable the reporter
  5. Set your Artillery Cloud API key
  6. Run your Playwright tests
  7. GitHub Actions
  8. Performance tracking with Web Vitals (experimental)
  9. Screenshots
  10. Current limitations
  11. Roadmap
  12. License

Level up your Playwright E2E tests

Artillery Cloud Playwright Reporter

Add @artilleryio/playwright-reporter to your Playwright project to get:

  • Cloud dashboard for Playwright test reports
  • Real-time reporting with screenshots, traces, and attachments
  • Automatic tracking of Web Vitals performance metrics
  • Debug CI failures with traces
  • GitHub Actions integration with PR comments

Get started with a free Artillery Cloud account at https://app.artillery.io

Learn more

Usage

Install the reporter

Add @artilleryio/playwright-reporter to your project as a dev dependency:

npm install -D @artilleryio/playwright-reporter

Enable the reporter

Enable the reporter in your Playwright config (playwright.config.ts):

const config: PlaywrightTestConfig = {
  reporter: [
    ['@artilleryio/playwright-reporter', { name: 'My Test Suite' }],
  ],
  // ... rest of your config
};

[!NOTE] Upgrading from an earlier version of the reporter? The blob reporter is no longer required to use @artilleryio/playwright-reporter. You can remove it from the list of reporters in your config.

Set your Artillery Cloud API key

Sign up for Artillery Cloud (it's free) and create an API key: https://app.artillery.io/settings/api-keys.

Then export your ARTILLERY_CLOUD_API_KEY:

export ARTILLERY_CLOUD_API_KEY=a9_your_api_key

Run your Playwright tests

npx playwright test

When the test starts the reporter will print the URL of the test run to the console. The URL will look like this:

https://app.artillery.io/b9j745e5cx4yrxcrb4qwpfty7p8r3/playwright/pwzxhq_abcdefabcdefghi_7atf

You can track the progress of the test run in real time in Artillery Cloud, with screenshots and traces for each test.

GitHub Actions

When the reporter is used in a GitHub Actions workflow, it can post comments to the PR with the test results. To enable PR comments, set GITHUB_TOKEN environment variable in your GitHub Actions job that runs Playwright tests:

jobs:
  test:
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: 'npm'

      - name: Run Playwright tests
        env:
          ARTILLERY_CLOUD_API_KEY: "${{ secrets.ARTILLERY_CLOUD_API_KEY }}" # API key to send results to Artillery Cloud
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Enable PR comments
        run: npx playwright test

Performance tracking with Web Vitals (experimental)

You can configure your tests to track Web Vitals automatically for every page in your tests (LCP, CLS, FCP, TTFB, and INP).

To enable performance tracking, use the withPerformanceTracking() method to extend Playwright's built-in test function:

// Rename the "test" import from @playwright/test to "base":
import { test as base } from '@playwright/test';
// Import the withPerformanceTracking function:
import { withPerformanceTracking } from '@artilleryio/playwright-reporter';

// Extend the base test function with performance tracking. This needs to be at the top before using test()
const test = withPerformanceTracking(base);

// The rest of your tests remain the same, e.g.:

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

Screenshots

Report overviewDebug errors
OverviewDebug

Current limitations

  • Tests running in sharded mode are not fully supported yet. Each run will produce multiple partial reports in Artillery Cloud, one per shard. We'll be releasing full support for sharded runs soon.

Roadmap

These are some of the things we're actively working on. If you have feature requests or ideas, let us know on [email protected].

  • Full support for sharded test runs
  • Better GitHub Actions integration

License

Artillery Cloud Playwright reporter is licensed under the FSL-1.1-ALv2 Fair Source License. See the LICENSE.txt file for details.

版本与发布记录

@artilleryio/playwright-reporter 共发布 15 个版本,首次发布于 2024/11/19;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.3latest2025/02/261.7 年前
1.1.22025/02/151.7 年前
1.1.12025/02/151.7 年前
1.1.02025/02/151.7 年前
1.0.02024/12/031.9 年前
0.0.102024/12/031.9 年前

关于 @artilleryio/playwright-reporter 的常见问题

@artilleryio/playwright-reporter 是什么?

Playwright reporter for Artillery Cloud

如何安装 @artilleryio/playwright-reporter?

在项目目录运行 npm install @artilleryio/playwright-reporter,或使用 pnpm add / yarn add / bun add。

@artilleryio/playwright-reporter 支持 TypeScript 吗?

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

@artilleryio/playwright-reporter 支持 ESM 还是 CommonJS?

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

@artilleryio/playwright-reporter 可以商用吗?

@artilleryio/playwright-reporter 使用 SEE LICENSE IN LICENSE.txt 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@artilleryio/playwright-reporter 的下载量有多少?

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

@artilleryio/playwright-reporter 还在维护吗?

最新版本 1.1.3 发布于 2025/02/26(1.7 年前);至今共发布 15 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/11/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。