Updated results excel sheet name
This commit is contained in:
@@ -3,8 +3,6 @@ import { Options as ChromeOptions } from 'selenium-webdriver/chrome.js';
|
||||
import fs from 'fs';
|
||||
import XLSX from 'xlsx';
|
||||
import path from 'path';
|
||||
import { brotliCompress } from 'zlib';
|
||||
import e from 'express';
|
||||
|
||||
//Export JUST the steps so other scripts can import them
|
||||
export const myStandardsSearch_AlignedContent = (driver) => [
|
||||
@@ -7752,10 +7750,10 @@ export const myStandardsSearch_AlignedContent = (driver) => [
|
||||
const errors = [];
|
||||
|
||||
//text
|
||||
if (elementText === 'Aligned Content 4') {
|
||||
console.log('Passed: Standard Code 2, Aligned Content 4 button text matched as expected');
|
||||
if (elementText === 'Aligned Content 5') {
|
||||
console.log('Passed: Standard Code 2, Aligned Content 5 button text matched as expected');
|
||||
} else {
|
||||
errors.push(`Expected: "Aligned Content 4"; Actual: "${elementText}"`);
|
||||
errors.push(`Expected: "Aligned Content 5"; Actual: "${elementText}"`);
|
||||
}
|
||||
|
||||
//font
|
||||
@@ -8095,14 +8093,14 @@ const myStandardsSearch = (req, res) => {
|
||||
return readyState === 'complete';
|
||||
}, 30000, 'ExACT Dashboard did not fully load within 30 seconds');
|
||||
|
||||
/*Wait for the dashboard container to exist in DOM
|
||||
//Wait for the dashboard container to exist in DOM
|
||||
await driver.wait(
|
||||
until.elementLocated(By.css('.gap-idle-wrap > img')),
|
||||
30000,
|
||||
'Dashboard image did not appear within 30 seconds'
|
||||
);
|
||||
|
||||
Wait for it to be visible
|
||||
//Wait for it to be visible
|
||||
await driver.wait(async () => {
|
||||
try {
|
||||
const img = await driver.findElement(By.css('.gap-idle-wrap > img'));
|
||||
@@ -8110,7 +8108,7 @@ const myStandardsSearch = (req, res) => {
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}, 30000, 'Dashboard image did not become visible within 30 seconds');*/
|
||||
}, 30000, 'Dashboard image did not become visible within 30 seconds');
|
||||
|
||||
//Wait for any loading spinners to disappear
|
||||
await driver.wait(async () => {
|
||||
@@ -8314,18 +8312,21 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'myStandardsSearchAlignedContentResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'myStandardsSearchAlignedContentResults');
|
||||
const screenshotDir = path.join('screenshots', 'myStandardsSearchAlignedContent');
|
||||
if (fs.existsSync(screenshotDir)) {
|
||||
fs.rmSync(screenshotDir, { recursive: true, force: true });
|
||||
}
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('myStandardsSearchAlignedContentResults.xlsx')) {
|
||||
fs.unlinkSync('myStandardsSearchAlignedContentResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -8352,13 +8353,15 @@ try {
|
||||
|
||||
try {
|
||||
await step.action();
|
||||
|
||||
//Log a successful step with no screenshot
|
||||
worksheet = logStep(
|
||||
worksheet,
|
||||
step.description,
|
||||
'Passed',
|
||||
stepIndex,
|
||||
timestamp,
|
||||
null
|
||||
null //No screenshot for passed steps
|
||||
);
|
||||
|
||||
} catch (error) {
|
||||
@@ -8402,11 +8405,11 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'myStandardsSearchAlignedContentResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
})();
|
||||
};
|
||||
}
|
||||
|
||||
export default myStandardsSearch;
|
||||
|
||||
Reference in New Issue
Block a user