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

@@ -2508,6 +2508,48 @@ const steps = [
},
*/
//FOOTER
//EdGate Copyright Logo
{
description: 'EdGate Copyright Logo',
action: async () => {
const multipleChecks = 'EdGate Copyright Logo';
const element = await driver.findElement(By.css('footer .pull-right > a'));
const elementLogo = await element.findElement(By.css('img'));
const expectedHref = 'https://www.edgate.com/';
//Track all errors
const errors = [];
//icon present
if (await elementLogo.isDisplayed()) {
console.log('Passed: EdGate Copyright Logo was displayed as expected');
} else {
errors.push('Expected: EdGate Copyright Logo was not displayed');
}
//href - browser resolves the link with a trailing slash, so remove it before comparing
const actualHref = await element.getAttribute('href');
if (actualHref && actualHref === expectedHref) {
console.log('Passed: EdGate Copyright Logo href matched as expected');
} else {
errors.push(`Expected: EdGate Copyright Logo href to be: "https://www.edgate.com/"; actual: "${actualHref}"`);
}
//Throw summary if any validation failed
if (errors.length > 0) {
//Add summary line only when multiple checks failed
if (errors.length > 1) {
errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`);
}
//Throw collected messages — catch() will prefix with "FAILED:"
throw new Error(errors.join('\n'));
}
}
},
//NEXT ACTION
{
description: 'Log Out',
@@ -2572,6 +2614,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath;
};
const resultsFile = path.join('results', 'frameworkManagementPageResults.xlsx');
const clearOldResults = () => {
//Remove old screenshots
const screenshotDir = path.join('screenshots', 'frameworkManagementPage');
@@ -2581,9 +2625,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file
if (fs.existsSync('frameworkManagementPageResults.xlsx')) {
fs.unlinkSync('frameworkManagementPageResults.xlsx');
if (fs.existsSync(resultsFile)) {
fs.unlinkSync(resultsFile);
}
fs.mkdirSync('results', { recursive: true });
};
try {
@@ -2666,7 +2711,7 @@ try {
//Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'frameworkManagementPageResults.xlsx');
XLSX.writeFile(workbook, resultsFile);
} finally {
await driver.quit();
}