Tweak report

This commit is contained in:
Patrik Husfloen 2023-06-08 15:33:04 +02:00
parent 670a1b828d
commit b5fdf002c6
2 changed files with 13 additions and 11 deletions

View file

@ -141,15 +141,16 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s
const name = tr.path
const addr = options.baseUrl + makeRunSlug(runIndex).link
const nameLink = link(name, addr)
const passed = tr.passed > 0 ? `${tr.passed}${Icon.success}` : ''
const failed = tr.failed > 0 ? `${tr.failed}${Icon.fail}` : ''
const skipped = tr.skipped > 0 ? `${tr.skipped}${Icon.skip}` : ''
return [nameLink, passed, failed, skipped, time]
const statusIcon = tr.failed > 0 ? Icon.fail : tr.passed > 0 ? Icon.success : Icon.skip
const passed = tr.passed
const failed = tr.failed
const skipped = tr.skipped
return [statusIcon, nameLink, passed, failed, skipped, time]
})
const resultsTable = table(
['Report', 'Passed', 'Failed', 'Skipped', 'Time'],
[Align.Left, Align.Right, Align.Right, Align.Right, Align.Right],
['', 'Report', 'Passed', 'Failed', 'Skipped', 'Time'],
[Align.Center, Align.Left, Align.Right, Align.Right, Align.Right, Align.Right],
...tableData
)
sections.push(resultsTable)