Skip to content

Commit

Permalink
Merge pull request avocado-framework#5797 from wsakernel/color_html
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja authored Nov 14, 2023
2 parents df8befb + a63423b commit 7ccc9e8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
17 changes: 14 additions & 3 deletions optional_plugins/html/avocado_result_html/templates/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ <h4 class="panel-title">Summary</h4>
<tr>
<td>Stats</td>
<td>From {{ data.result.tests_total }} tests executed,
{{ data.result.passed }} passed and
{{ data.result.warned }} warned - success rate of
<span class="pass">{{ data.result.passed }} passed</span>,
<span class="fail">{{ data.result.failed + data.result.errors + data.result.interrupted }} did not pass</span>, and
<span class="warn">{{ data.result.warned }} warned</span> - success rate of
{{ '%.2f'|format(data.result.rate) }}% (excluding SKIP and CANCEL)</td>
</tr>
</table>
Expand Down Expand Up @@ -106,7 +107,17 @@ <h4 class="panel-title">Summary</h4>
</div>
</td>
<td><div>{{ test.variant }}</div></td>
<td><div>{{ test.status }}</div></td>
<td>
{% if test.status == 'PASS' %}
<div class="pass">
{% elif test.status == 'WARN' or test.status == 'SKIP' or test.status == 'CANCEL' %}
<div class="warn">
{% else %}
<div class="fail">
{% endif %}
{{ test.status }}
</div>
</td>
<td><div>{{ test.time }}</div></td>
<td data-toggle="popover"
data-container="body"
Expand Down
12 changes: 12 additions & 0 deletions optional_plugins/html/avocado_result_html/templates/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@
width: 8px;
}

.pass {
color: green;
}

.fail {
color: red;
}

.warn {
color: darkorange;
}

/* Basic metadata for svg */
.icon {
width: 22px;
Expand Down

0 comments on commit 7ccc9e8

Please sign in to comment.