Updated script to only take screenshots on failed steps
This commit is contained in:
@@ -3453,12 +3453,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -2329,12 +2329,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -5474,12 +5474,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -2668,12 +2668,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -3005,12 +3005,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -2703,12 +2703,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -9728,12 +9728,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -2825,12 +2825,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -1787,12 +1787,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -4191,12 +4191,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -3045,12 +3045,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -3209,12 +3209,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -524,12 +524,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
@@ -417,12 +417,36 @@ try {
|
|||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
//Screenshot of failed step
|
||||||
await step.action();
|
await step.action();
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, step.description);
|
|
||||||
worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath);
|
//Log a successful step with no screenshot
|
||||||
|
worksheet = logStep(
|
||||||
|
worksheet,
|
||||||
|
step.description,
|
||||||
|
'Passed',
|
||||||
|
stepIndex,
|
||||||
|
timestamp,
|
||||||
|
null //No screenshot for passed steps
|
||||||
|
);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
//Only take screenshot if the step fails
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
const screenshotPath = await takeScreenshot(
|
||||||
|
driver,
|
||||||
|
stepIndex,
|
||||||
|
`${step.description}_Failed`
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
allStepsPassed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user