Cleaned up results file structure
This commit is contained in:
@@ -2238,6 +2238,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'alignAutoAlignPageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'alignAutoAlignPage');
|
||||
@@ -2247,9 +2249,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('alignAutoAlignPageResults.xlsx')) {
|
||||
fs.unlinkSync('alignAutoAlignPageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -2330,11 +2333,11 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'alignAutoAlignPageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
})();
|
||||
})();
|
||||
}
|
||||
|
||||
export default alignAutoAlignPage;
|
||||
|
||||
Reference in New Issue
Block a user