Add tiny css improvments to html export.

This commit is contained in:
jcamiel 2021-12-17 15:36:51 +01:00 committed by Fabrice Reix
parent 82894a8a1a
commit 07f3fd432c
2 changed files with 32 additions and 24 deletions

View File

@ -113,7 +113,7 @@ fn percentage(count: usize, total: usize) -> String {
fn create_html_index(now: String, hurl_results: Vec<HurlResult>) -> html::Html {
let head = html::Head {
title: "Hurl Report".to_string(),
title: "Test Report".to_string(),
stylesheet: Some("report.css".to_string()),
};
@ -126,7 +126,7 @@ fn create_html_index(now: String, hurl_results: Vec<HurlResult>) -> html::Html {
html::Element::NodeElement {
name: "h2".to_string(),
attributes: vec![],
children: vec![html::Element::TextElement("Hurl Report".to_string())],
children: vec![html::Element::TextElement("Test Report".to_string())],
},
html::Element::NodeElement {
name: "div".to_string(),
@ -141,7 +141,7 @@ fn create_html_index(now: String, hurl_results: Vec<HurlResult>) -> html::Html {
name: "div".to_string(),
attributes: vec![html::Attribute::Class("count".to_string())],
children: vec![html::Element::TextElement(format!(
"total: {} (100%)",
"Executed: {} (100%)",
count_total
))],
},
@ -149,18 +149,18 @@ fn create_html_index(now: String, hurl_results: Vec<HurlResult>) -> html::Html {
name: "div".to_string(),
attributes: vec![html::Attribute::Class("count".to_string())],
children: vec![html::Element::TextElement(format!(
"failure: {} ({})",
count_failure,
percentage(count_failure, count_total)
"Succeeded: {} ({})",
count_success,
percentage(count_success, count_total)
))],
},
html::Element::NodeElement {
name: "div".to_string(),
attributes: vec![html::Attribute::Class("count".to_string())],
children: vec![html::Element::TextElement(format!(
"success: {} ({})",
count_success,
percentage(count_success, count_total)
"Failed: {} ({})",
count_failure,
percentage(count_failure, count_total)
))],
},
],

View File

@ -1,27 +1,35 @@
.date {
margin-bottom: 10px;
body {
font-family: "Helvetica Neue", Arial, sans-serif;
font-size: 1.125rem;
line-height: 1.4;
}
thead {
font-weight: bolder;
}
td {
padding: 3px 5px;
h2 {
color: #ff0288;
font-size: 2.5rem;
}
.summary {
padding: 10px;
margin: 32px 0 32px 0;
font-size: 1.25rem;
}
.date {
margin-bottom: 20px;
}
td {
padding: 4px 8px 4px 0;
}
thead {
font-weight: bold;
}
.success, .success a {
color: green;
}
.failure, .failure a {
color: red;
}
}