summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorduerpei <duep.fnst@fujitsu.com>2022-10-22 16:55:45 +0800
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2023-01-20 16:02:58 +0000
commit2f9db91f9e63e7b746770b17c2c9204ff663a7de (patch)
treee59ac3cdf3426472f60932fc0874cc4d6123ac29 /template
parent4c5dbc9e8b311b605e750534b51dbb899fb8ccce (diff)
agl-test-framework: optimize the generated html report
Optimize the generated html report, make its format more beautiful and readable. Bug-AGL: SPEC-4345 Signed-off-by: duerpei <duep.fnst@fujitsu.com> Change-Id: I0b779e0998ded00b348e23f2c1ac5b8acf5b8fd8
Diffstat (limited to 'template')
-rw-r--r--template/all_test_suites_tpl.html111
-rw-r--r--template/summary_result_tpl.html112
2 files changed, 196 insertions, 27 deletions
diff --git a/template/all_test_suites_tpl.html b/template/all_test_suites_tpl.html
index 5b3e0aa..f484385 100644
--- a/template/all_test_suites_tpl.html
+++ b/template/all_test_suites_tpl.html
@@ -1,17 +1,102 @@
<!DOCTYPE html>
<html>
- <head>
- <title> Summary Report </title>
- </head>
- <body>
- <h1> Summary Report </h1>
- <li> Status : {{ data.summary.status }} </li>
- <li> Total : {{ data.summary.summary_total }} Pass : {{ data.summary.summary_passed }} Fail : {{ data.summary.summary_failed }} Skip : {{ data.summary.summary_skipped }} </li>
- <li> Details : </li>
- <table border="1" cellspacing="2">
+ <head>
+ <meta charset="utf-8"/>
+ <title>Summary Report</title>
+ <style>body {
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ min-width: 800px;
+ color: #999;
+}
+
+h1 {
+ font-size: 24px;
+ color: black;
+}
+
+h2 {
+ font-size: 16px;
+ color: black;
+}
+
+p {
+ color: black;
+}
+
+a {
+ color: #999;
+}
+
+table {
+ border-collapse: collapse;
+}
+
+/******************************
+ * TEST RESULT COLORS
+ ******************************/
+span.passed,
+.passed .col-result {
+ color: green;
+}
+
+span.skipped,
+.skipped .col-result {
+ color: orange;
+}
+
+span.failed,
+.failed .col-result {
+ color: red;
+}
+
+/******************************
+ * RESULTS TABLE
+ * Table Layout
+ ******************************/
+#results-table {
+ border: 1px solid #e6e6e6;
+ color: #666;
+ font-size: 12px;
+ width: 50%;
+}
+#results-table th,
+#results-table td {
+ padding: 5px;
+ border: 1px solid #E6E6E6;
+ text-align: left;
+}
+#results-table th {
+ font-weight: bold;
+}
+
+ </style>
+ </head>
+
+ <body>
+ <h1>Summary Report</h1>
+ <p>Report generated on {{ data.date_F }} at {{ data.date_T }} by <a href="https://git.automotivelinux.org/src/agl-test-framework/">agl-test-framework</a> </p>
+ <h2>Summary</h2>
+{{ data.summry_status_html }}
+ <p>{{ data.summary.summary_total }} test suites ran </p>
+ <span class="passed">{{ data.summary.summary_passed }} passed</span>,
+ <span class="skipped">{{ data.summary.summary_skipped }} skipped</span>,
+ <span class="failed">{{ data.summary.summary_failed }} failed</span>,
+ <h2>Details</h2>
+ <table id="results-table">
+ <thead>
+ <tr>
+ <th>Result</th>
+ <th>Test Suite</th>
+ <th>Total</th>
+ <th>Pass</th>
+ <th>Skip</th>
+ <th>Fail</th>
+ <th>Xfail</th>
+ <th>Xpass</th>
+ </tr>
+ </thead>
{{ data.test_suite_table_html }}
- </table>
- <p></p>
- <li>Detail log : {{ data.log_zip_name }}.zip</li>
- </body>
+ </table>
+ </body>
</html>
diff --git a/template/summary_result_tpl.html b/template/summary_result_tpl.html
index 6b173cf..c8f0f99 100644
--- a/template/summary_result_tpl.html
+++ b/template/summary_result_tpl.html
@@ -1,18 +1,102 @@
<!DOCTYPE html>
<html>
- <head>
- <title>{{ data.test_name }} test report</title>
- </head>
- <body>
- <h1> {{ data.test_name }} test report </h1>
- <li> Status : {{ data.test_status }} </li>
- <li> Total : {{ data.collected }} Pass : {{ data.passed }} Xpass : {{ data.xpassed }} Fail : {{ data.failed }} Xfail : {{ data.xfailed }} Skip : {{ data.skipped }} </li>
- <li> Details : </li>
- <table border="1" cellspacing="2">
+ <head>
+ <meta charset="utf-8"/>
+ <title>{{ data.test_name }} test report</title>
+ <style>body {
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ min-width: 800px;
+ color: #999;
+}
+
+h1 {
+ font-size: 24px;
+ color: black;
+}
+
+h2 {
+ font-size: 16px;
+ color: black;
+}
+
+p {
+ color: black;
+}
+
+a {
+ color: #999;
+}
+
+table {
+ border-collapse: collapse;
+}
+
+/******************************
+ * TEST RESULT COLORS
+ ******************************/
+span.passed,
+.passed .col-result {
+ color: green;
+}
+
+span.skipped,
+span.xfailed,
+span.xpassed,
+.skipped .col-result,
+.xfailed .col-result,
+.xpassed .col-result {
+ color: orange;
+}
+
+span.failed,
+.failed .col-result {
+ color: red;
+}
+
+/******************************
+ * RESULTS TABLE
+ * Table Layout
+ ******************************/
+#results-table {
+ border: 1px solid #e6e6e6;
+ color: #666;
+ font-size: 12px;
+ width: 50%;
+}
+#results-table th,
+#results-table td {
+ padding: 5px;
+ border: 1px solid #E6E6E6;
+ text-align: left;
+}
+#results-table th {
+ font-weight: bold;
+}
+
+ </style>
+ </head>
+
+ <body>
+ <h1>{{ data.test_name }} test report</h1>
+ <p>Report generated on {{ data.date_F }} at {{ data.date_T }} by <a href="https://git.automotivelinux.org/src/agl-test-framework/">agl-test-framework</a> </p>
+ <h2>Summary</h2>
+{{ data.test_suite_status_html }}
+ <p>{{ data.collected }} test cases ran </p>
+ <span class="passed">{{ data.passed }} passed</span>,
+ <span class="skipped">{{ data.skipped }} skipped</span>,
+ <span class="failed">{{ data.failed }} failed</span>,
+ <span class="xfailed">{{ data.xfailed }} expected failures</span>,
+ <span class="xpassed">{{ data.xpassed }} unexpected passes</span>
+ <h2>Details</h2>
+ <table id="results-table">
+ <thead>
+ <tr>
+ <th>Result</th>
+ <th>Test Case</th>
+ </tr>
+ </thead>
{{ data.case_status_html }}
- </table>
- <p></p>
- <li>Detail log : {{ data.test_name }}/log.zip</li>
- </body>
+ </table>
+ </body>
</html>
-