Updated script resultfile
This commit is contained in:
@@ -2432,14 +2432,14 @@ const myStandardsSearchRelatedStandards = (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'));
|
||||
@@ -2447,7 +2447,7 @@ const myStandardsSearchRelatedStandards = (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 () => {
|
||||
@@ -2585,7 +2585,7 @@ const myStandardsSearchRelatedStandards = (req, res) => {
|
||||
await driver.findElement(By.css('.show > li:nth-child(14) input')).click();
|
||||
await driver.sleep(2000);
|
||||
//Select "California Mathematics 1997" from dropdown
|
||||
await driver.findElement(By.css('.show > li:nth-child(32) input')).click();
|
||||
await driver.findElement(By.css('.show > li:nth-child(34) input')).click();
|
||||
await driver.sleep(2000);
|
||||
console.log('----->| NEXT ACTION: Selected Include Related Standards: Washington, Common Core State Standards, California Mathematics 1997');
|
||||
//Click away to close dropdown using executeScript to bypass interception
|
||||
@@ -2651,6 +2651,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'myStandardsSearchRelatedStandards.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'myStandardsSearchRelatedStandardsResults');
|
||||
@@ -2660,9 +2662,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('myStandardsSearchRelatedStandardsResults.xlsx')) {
|
||||
fs.unlinkSync('myStandardsSearchRelatedStandardsResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -2739,7 +2742,7 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'myStandardsSearchRelatedStandardsResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user