feat: init files
This commit is contained in:
29
inject-css.js
Normal file
29
inject-css.js
Normal file
@ -0,0 +1,29 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const reportPath = path.join(__dirname, "reports", "cucumber-html-report.html");
|
||||
|
||||
const cssToInject = `
|
||||
<style>
|
||||
.feature-passed > .col-lg-6 {
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
flex: 0 0 100% !important;
|
||||
}
|
||||
|
||||
.feature-passed > .col-lg-6 > .panel {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
`;
|
||||
|
||||
fs.readFile(reportPath, "utf8", (err, data) => {
|
||||
if (err) throw err;
|
||||
|
||||
const modified = data.replace("</head>", `${cssToInject}</head>`);
|
||||
|
||||
fs.writeFile(reportPath, modified, "utf8", (err) => {
|
||||
if (err) throw err;
|
||||
console.log("Custom CSS injected successfully!");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user