-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional results and multiple tables #72
Comments
It's best to use the custom report - for example - npx github-actions-ctrf custom ctrf-reports/ctrf-report.json templates/custom-report.hbs The custom | **Build {{getCtrfEmoji "build"}}** | **Result {{getCtrfEmoji "result"}}** | **Tests {{getCtrfEmoji "tests"}}** | **Passed {{getCtrfEmoji "passed"}}** | **Failed {{getCtrfEmoji "failed"}}** | **Skipped {{getCtrfEmoji "skipped"}}** | **Pending {{getCtrfEmoji "pending"}}** | **Other {{getCtrfEmoji "other"}}** | **Flaky {{getCtrfEmoji "flaky"}}** | **Duration {{getCtrfEmoji "duration"}}** |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| [#{{ctrf.environment.extra.runNumber}}]({{ctrf.environment.extra.buildUrl}}) | {{getCtrfEmoji ctrf.summary.extra.result}} | {{ctrf.summary.tests}} | {{ctrf.summary.passed}} | {{ctrf.summary.failed}} | {{ctrf.summary.skipped}} | {{ctrf.summary.pending}} | {{ctrf.summary.other}} | {{countFlaky ctrf.tests}} | {{formatDuration ctrf.summary.start ctrf.summary.stop}} |
{{#each ctrf.extra.previousReports}}
| [#{{this.results.environment.extra.runNumber}}]({{this.results.environment.extra.buildUrl}}) | {{getCtrfEmoji this.results.summary.extra.result}} | {{this.results.summary.tests}} | {{this.results.summary.passed}} | {{this.results.summary.failed}} | {{this.results.summary.skipped}} | {{this.results.summary.pending}} | {{this.results.summary.other}} | {{this.results.summary.extra.flaky}} | {{formatDuration this.results.summary.start this.results.summary.stop}} |
{{/each}}
{{#if (anyFailedTests ctrf.tests)}}
<table>
<thead>
<tr>
<th>Failed Tests {{getCtrfEmoji "failed"}}</th>
<th>Fail Message</th>
</tr>
</thead>
<tbody>
{{#each ctrf.tests}}
{{#if (eq status "failed")}}
<tr>
<td>{{getCtrfEmoji "failed"}} {{name}}</td>
<td>{{#if message}}{{~{formatMessage message}}}{{else}}No failure message{{/if}}</td>
</tr>
{{/if}}
{{/each}}
</tbody>
</table>
{{/if}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got this hooked up in my github actions and works well with the default "all" tables. Thanks for doing this!
Two questions:
(1) Rather than
all
I would like more terse output, really justsummary
andfailed
. Is it possible to specify more than one table? All of your examples use a single table.(2) Even more terse 😁 : only show those selected tables if there are failures; is this possible?
The text was updated successfully, but these errors were encountered: