@bdellegrazie/playwright-sonar-reporter

中文文档
0.5.2发布于 2026/07/22Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 6805

generate Sonarqube Generic Text Execution XML report with the playwright test results

原始使用文档
文档目录8 节
  1. Installation
  2. npm
  3. yarn
  4. Usage
  5. TO DOs
  6. Contact
  7. References
  8. LICENSE

Playwright Reporter for Sonarqube

Simplified version of XrayApp's playwright-junit-report to support Sonarqube's Generic Data Test Execution format.

npm version build workflow license Gitter chat npm downloads

Installation

Run the following commands:

npm

npm install @bdellegrazie/playwright-sonar-reporter --save-dev

yarn

yarn add @bdellegrazie/playwright-sonar-reporter --dev

Usage

Most likely you want to write the report to an xml file. When running with --reporter=@bdellegrazie/playwright-sonar-reporter, use PLAYWRIGHT_SONAR_OUTPUT_NAME environment variable:

PLAYWRIGHT_SONAR_OUTPUT_NAME=results.xml npx playwright test --reporter=@bdellegrazie/playwright-sonar-reporter
set PLAYWRIGHT_SONAR_OUTPUT_NAME=results.xml
npx playwright test --reporter=@bdellegrazie/playwright-sonar-reporter
$env:PLAYWRIGHT_SONAR_OUTPUT_NAME="results.xml"
npx playwright test --reporter=@bdellegrazie/playwright-sonar-reporter

If using SonarCloud, either set the sonarcloud option as shown below or set the PLAYWRIGHT_SONAR_SONARCLOUD environment variable to true.

In configuration file, pass options directly:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['@bdellegrazie/playwright-sonar-reporter', { outputFile: 'results.xml', sonarcloud: true }]],
});

TO DOs

  • implement code coverage

Contact

Any questions related with this code, please raise issues in this GitHub project. Feel free to contribute and submit PR's.

References

LICENSE

Based on code from Playwright project and Xray-App's playwright-junit-report

Apache License v2.0

版本与发布记录

@bdellegrazie/playwright-sonar-reporter 共发布 8 个版本,首次发布于 2024/01/29;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.2latest2026/07/223 个月前
0.5.12026/05/265 个月前
0.5.02026/05/135 个月前
0.4.02025/04/221.5 年前
0.3.02025/03/301.6 年前
0.2.12024/04/272 年前

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

@bdellegrazie/playwright-sonar-reporter 是什么?

generate Sonarqube Generic Text Execution XML report with the playwright test results

如何安装 @bdellegrazie/playwright-sonar-reporter?

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

@bdellegrazie/playwright-sonar-reporter 支持 TypeScript 吗?

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

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

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bdellegrazie/playwright-sonar-reporter 需要什么版本的 Node.js?

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

@bdellegrazie/playwright-sonar-reporter 可以商用吗?

@bdellegrazie/playwright-sonar-reporter 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@bdellegrazie/playwright-sonar-reporter 还在维护吗?

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