记者 - 播放权 - 报告 - 服务器
上传结果到 Playwright 报告服务器的 Playwright 记者 - https://github.com/Cyborg Tests/playwright-reports-server 页面存档备份,存于互联网档案馆
安装
npm i -D @cyborgtests/reporter-playwright-reports-server
然后,在剧作家。 配置文件 :
reporter: [
// blob reporter is required, produced zip would be uploaded
['blob', { outputFile: 'test-results/blob.zip' }],
[
'@cyborgtests/reporter-playwright-reports-server',
{
// 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
},
],
],
那就做你的测试 如果你看到 [ReporterPlaywrightReportsServer] 🎭 HTML Report is available at: ... - 您的blob结果已成功发送到服务器!
硬块
在所有硬盘完成后自动生成报告得到支持。 但你必须说明 testRun 财务报告和审定财务报表 triggerReportGeneration: true数字 :
- 在记者配置通过中
resultDetails: {
...
// testRun required, it should be same for all shards!
testRun: 'my-awesome-test-run-12'
...
},
triggerReportGeneration: true
记者将当前硬度数和总硬度数传递给服务器, 在上传了所有硬度后 - 报告会由服务器生成, 用于此中的所有 blobs testRun