mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-24 19:42:07 +03:00
Add meta utf-8 charset to HTML report
This commit is contained in:
parent
2a628524ca
commit
90631dc0b1
@ -50,21 +50,6 @@ pub fn write_report(dir_path: &Path, testcases: &[Testcase]) -> Result<(), Error
|
||||
message: format!("Issue writing to {}: {:?}", file_path.display(), why),
|
||||
});
|
||||
}
|
||||
|
||||
let file_path = dir_path.join("report.css");
|
||||
let mut file = match std::fs::File::create(&file_path) {
|
||||
Err(why) => {
|
||||
return Err(Error {
|
||||
message: format!("Issue writing to {}: {:?}", file_path.display(), why),
|
||||
});
|
||||
}
|
||||
Ok(file) => file,
|
||||
};
|
||||
if let Err(why) = file.write_all(include_bytes!("resources/report.css")) {
|
||||
return Err(Error {
|
||||
message: format!("Issue writing to {}: {:?}", file_path.display(), why),
|
||||
});
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -75,16 +60,16 @@ fn create_html_index(now: &str, hurl_results: &[HTMLResult]) -> String {
|
||||
let count_success = hurl_results.iter().filter(|result| result.success).count();
|
||||
let percentage_success = percentage(count_success, count_total);
|
||||
let percentage_failure = percentage(count_failure, count_total);
|
||||
|
||||
let css = include_str!("resources/report.css");
|
||||
let rows = hurl_results
|
||||
.iter()
|
||||
.map(create_html_table_row)
|
||||
.collect::<Vec<String>>()
|
||||
.join("");
|
||||
|
||||
format!(
|
||||
include_str!("resources/report.html"),
|
||||
now = now,
|
||||
css = css,
|
||||
count_total = count_total,
|
||||
count_success = count_success,
|
||||
count_failure = count_failure,
|
||||
|
@ -1,8 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Report</title>
|
||||
<link rel="stylesheet" type="text/css" href="report.css">
|
||||
<style>
|
||||
{css}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
Loading…
Reference in New Issue
Block a user