@luhanxin/reporter
v3.0.0
Published
JSON, HTML and PDF reporters for automation runs
Downloads
455
Maintainers
Readme
@luhanxin/reporter
生成 JSON、HTML 和 PDF 自动化测试报告。
安装
pnpm add @luhanxin/reporter使用
import {writeHtmlReport, writeJsonReport} from '@luhanxin/reporter';
await writeJsonReport(summary, 'test-results/results.json');
await writeHtmlReport(summary, 'test-results/report.html');PDF 报告需要一个 Puppeteer Page:
import {writePdfReport} from '@luhanxin/reporter';
await writePdfReport(page, summary, 'test-results/report.pdf');API
renderJsonReport(summary)renderHtmlReport(summary, title?)writeJsonReport(summary, path)writeHtmlReport(summary, path, title?)writePdfReport(page, summary, path, title?)
构建
pnpm build
pnpm typecheck