Updated overall test case result
This commit is contained in:
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_landingPage = (req, res) => {
|
const ExACT_landingPage = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Landing Page: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - ExACT Landing Page: Initiated</h2>');
|
||||||
(async function example() {
|
(async function example() {
|
||||||
let driver = await new Builder().forBrowser('chrome').build();
|
let driver = await new Builder().forBrowser('chrome').build();
|
||||||
let testStatus = 'Failed';
|
let testStatus = 'Failed';
|
||||||
@@ -517,6 +517,8 @@ try {
|
|||||||
// Log test start time
|
// Log test start time
|
||||||
worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, '');
|
worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, '');
|
||||||
|
|
||||||
|
let allStepsPassed = true;
|
||||||
|
|
||||||
for (const step of steps) {
|
for (const step of steps) {
|
||||||
const stepIndex = steps.indexOf(step) + 1;
|
const stepIndex = steps.indexOf(step) + 1;
|
||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
@@ -530,17 +532,18 @@ try {
|
|||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
||||||
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
|
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
|
allStepsPassed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Script completed
|
//Script completed
|
||||||
const expectedEdGateCopyright = await driver.wait(until.elementLocated(By.css('.logincopyright > img')), 5000).catch(() => false);
|
const expectedEdGateCopyright = await driver.wait(until.elementLocated(By.css('.logincopyright > img')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (expectedEdGateCopyright) {
|
if (expectedEdGateCopyright && allStepsPassed) {
|
||||||
console.log('PASSED: Script completed');
|
console.log('PASSED: ExACT Landing Page - All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Script completed');
|
console.log('FAILED: ExACT Landing Page - One or more test steps did not pass');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user