Cleaned up results file structure

This commit is contained in:
jhuerta
2026-10-27 14:36:03 -07:00
parent 2e3a67438e
commit a27fd65cce
6 changed files with 239 additions and 190 deletions

View File

@@ -1389,6 +1389,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath;
};
const resultsFile = path.join('results', 'alignContentPageResults.xlsx');
const clearOldResults = () => {
//Remove old screenshots
const screenshotDir = path.join('screenshots', 'alignContentPage');
@@ -1398,9 +1400,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file
if (fs.existsSync('alignContentPageResults.xlsx')) {
fs.unlinkSync('alignContentPageResults.xlsx');
if (fs.existsSync(resultsFile)) {
fs.unlinkSync(resultsFile);
}
fs.mkdirSync('results', { recursive: true });
};
try {
@@ -1481,7 +1484,7 @@ try {
//Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'alignContentPageResults.xlsx');
XLSX.writeFile(workbook, resultsFile);
} finally {
await driver.quit();
}