30 lines
669 B
JavaScript
30 lines
669 B
JavaScript
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!");
|
|
});
|
|
});
|