跳到正文
Skillpedia
测试29k · #9480

report

它能做什么

这项技能让智能体运行或读取你的浏览器测试,并写出通过、失败和不稳定测试的摘要。适合希望获得简单测试状态更新的开发者和团队负责人。

适用场景

  • ✓当有人问今天的测试情况如何的时候。
  • ✓当你需要向团队提供失败和不稳定测试摘要时。
  • ✓当你的 CI 流水线完成、并希望把结果集中在一处的时候。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/report/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/report/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我们的测试情况如何?请给我一份简短的失败项摘要。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会读取最新的测试结果;如果没有结果,就先运行测试。然后统计通过、失败、跳过和不稳定的测试数量,写出 Markdown 摘要,并发送到你设置的位置。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Smart Test Reporting

Generate test reports that plug into the user's existing workflow. Zero new tools.

Steps

1. Run Tests (If Not Already Run)

Check if recent test results exist:

ls -la test-results/ playwright-report/ 2>/dev/null

If no recent results, run tests:

npx playwright test --reporter=json,html,list 2>&1 | tee test-output.log

2. Parse Results

Read the JSON report:

npx playwright test --reporter=json 2> /dev/null

Extract:

  • Total tests, passed, failed, skipped, flaky
  • Duration per test and total
  • Failed test names with error messages
  • Flaky tests (passed on retry)

3. Detect Report Destination

Check what's configured and route automatically:

Check If found Action
TESTRAIL_URL env var TestRail configured Push results via /pw:testrail push
SLACK_WEBHOOK_URL env var Slack configured Post summary to Slack
.github/workflows/ GitHub Actions Results go to PR comment via artifacts
playwright-report/ HTML reporter Open or serve the report
None of the above Default Generate markdown report

4. Generate Report

Markdown Report (Always Generated)

# Test Results — {{date}}

## Summary
- ✅ Passed: {{passed}}
- ❌ Failed: {{failed}}
- ⏭️ Skipped: {{skipped}}
- 🔄 Flaky: {{flaky}}
- ⏱️ Duration: {{duration}}

## Failed Tests
| Test | Error | File |
|---|---|---|
| {{name}} | {{error}} | {{file}}:{{line}} |

## Flaky Tests
| Test | Retries | File |
|---|---|---|
| {{name}} | {{retries}} | {{file}} |

## By Project
| Browser | Passed | Failed | Duration |
|---|---|---|---|
| Chromium | X | Y | Zs |
| Firefox | X | Y | Zs |
| WebKit | X | Y | Zs |

Save to test-reports/{{date}}-report.md.

Slack Summary (If Webhook Configured)

curl -X POST "$SLACK_WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "🧪 Test Results: ✅ {{passed}} | ❌ {{failed}} | ⏱️ {{duration}}\n{{failed_details}}"
  }'

TestRail Push (If Configured)

Invoke /pw:testrail push with the JSON results.

HTML Report

npx playwright show-report

Or if in CI:

echo "HTML report available at: playwright-report/index.html"

5. Trend Analysis (If Historical Data Exists)

If previous reports exist in test-reports/:

  • Compare pass rate over time
  • Identify tests that became flaky recently
  • Highlight new failures vs. recurring failures

Output

  • Summary with pass/fail/skip/flaky counts
  • Failed test details with error messages
  • Report destination confirmation
  • Trend comparison (if historical data available)
  • Next action recommendation (fix failures or celebrate green)
常见问题

生成报告需要专门的工具吗?

不需要。它使用 Playwright 的测试结果和标准的 Markdown 摘要。

如果还没有测试结果怎么办?

该技能会先运行测试来生成结果。

报告发送到哪里?

Markdown 报告总会生成。如果已配置,它还可以发送到 TestRail、Slack 或 GitHub Actions。

详情

作者的原始描述

Use when asked for a test report or results summary ('test report', 'test status', 'how did tests go').

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9480
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能