Added LogOut and updated test results
This commit is contained in:
@@ -2688,6 +2688,24 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
description: 'Validate Applications of Linear Systems description text',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.card:nth-child(6) .lo-descr')).getText();
|
||||||
|
const expectedText = 'Unit: Systems of Equations and Inequalities';
|
||||||
|
|
||||||
|
// Trim the element text to avoid mismatch due to extra spaces or appended text
|
||||||
|
if (elementText.trim() !== expectedText) {
|
||||||
|
throw new Error(`Expected: "${expectedText}" text; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Passed: Unit: Systems of Equations and Inequalities text matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//Applications of Linear Systems content set label
|
//Applications of Linear Systems content set label
|
||||||
{
|
{
|
||||||
description: 'Validate Applications of Linear Systems content set label',
|
description: 'Validate Applications of Linear Systems content set label',
|
||||||
@@ -2700,6 +2718,24 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
description: 'Validate Applications of Linear Systems content set label',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.card:nth-child(6) em')).getText();
|
||||||
|
const expectedText = 'Content Set:';
|
||||||
|
|
||||||
|
// Trim the element text to avoid mismatch due to extra spaces or appended text
|
||||||
|
if (elementText.trim() !== expectedText) {
|
||||||
|
throw new Error(`Expected: Applications of Linear Systems "Content Set:" label; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Passed: Applications of Linear Systems Content Set label matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
//Applications of Linear Systems alignment icon
|
//Applications of Linear Systems alignment icon
|
||||||
{
|
{
|
||||||
description: 'Verify Applications of Linear Systems alignment icon is present',
|
description: 'Verify Applications of Linear Systems alignment icon is present',
|
||||||
@@ -2988,6 +3024,20 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//LOG OUT
|
||||||
|
//NEXT ACTION - Log out
|
||||||
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -3035,6 +3085,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();
|
||||||
@@ -3048,13 +3100,14 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (usernameValidation) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: System logged in as expected');
|
console.log('PASSED: System logged in as expected');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_alignContentPage = (req, res) => {
|
const ExACT_alignContentPage = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Align Content Page: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script: Align Content Page(ExACT_alignContentPage); 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';
|
||||||
@@ -639,15 +639,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Subject: Mathematics (2011) label
|
//Subject: Mathematics (2012) label
|
||||||
{
|
{
|
||||||
description: 'Validate Subject Mathematics (2011) label',
|
description: 'Validate Subject Mathematics (2012) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText();
|
||||||
if (elementText !== 'Mathematics (2011)') {
|
if (elementText !== 'Mathematics (2012)') {
|
||||||
throw new Error(`Expected: Subject: "Mathematics (2011)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Subject: "Mathematics (2012)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Subject Mathematics (2011) checkbox label matched as expected');
|
console.log('Passed: Subject Mathematics (2012) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -663,15 +663,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Subject: Science (1064) label
|
//Subject: Science (1066) label
|
||||||
{
|
{
|
||||||
description: 'Validate Subject Science (1064) label',
|
description: 'Validate Subject Science (1066) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(4) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(4) .checkbox')).getText();
|
||||||
if (elementText !== 'Science (1064)') {
|
if (elementText !== 'Science (1066)') {
|
||||||
throw new Error(`Expected: Subject: "Science (2384)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Subject: "Science (1066)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Subject Science (1064) checkbox label matched as expected');
|
console.log('Passed: Subject Science (1066) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -687,15 +687,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Subject: Language Arts (414) label
|
//Subject: Language Arts (416) label
|
||||||
{
|
{
|
||||||
description: 'Validate Subject Language Arts (414) label',
|
description: 'Validate Subject Language Arts (416) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText();
|
||||||
if (elementText !== 'Language Arts (414)') {
|
if (elementText !== 'Language Arts (416)') {
|
||||||
throw new Error(`Expected: Subject: "Language Arts (414)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Subject: "Language Arts (416)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Subject Language Arts (414) checkbox label matched as expected');
|
console.log('Passed: Subject Language Arts (416) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -711,15 +711,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Subject: Social Studies (75) label
|
//Subject: Social Studies (77) label
|
||||||
{
|
{
|
||||||
description: 'Validate Subject Social Studies (75) label',
|
description: 'Validate Subject Social Studies (77) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText();
|
||||||
if (elementText !== 'Social Studies (75)') {
|
if (elementText !== 'Social Studies (77)') {
|
||||||
throw new Error(`Expected: Subject: "Social Studies (75)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Subject: "Social Studies (77)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Subject Social Studies (75) checkbox label matched as expected');
|
console.log('Passed: Subject Social Studies (77) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -803,15 +803,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Alignment Status:Not Aligned (3260) label
|
//Alignment Status:Not Aligned (3261) label
|
||||||
{
|
{
|
||||||
description: 'Validate Alignment Status Not Aligned (3260) label',
|
description: 'Validate Alignment Status Not Aligned (3261) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText();
|
||||||
if (elementText !== 'Not Aligned (3260)') {
|
if (elementText !== 'Not Aligned (3261)') {
|
||||||
throw new Error(`Expected: Alignment Status: "Not Aligned (3260)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Alignment Status: "Not Aligned (3261)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Alignment Status Not Aligned (3260) checkbox label matched as expected');
|
console.log('Passed: Alignment Status Not Aligned (3261) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -851,15 +851,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Alignment Status: Pending (16) label
|
//Alignment Status: Pending (13) label
|
||||||
{
|
{
|
||||||
description: 'Validate Alignment Status Pending (16) label',
|
description: 'Validate Alignment Status Pending (13) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText();
|
||||||
if (elementText !== 'Pending (16)') {
|
if (elementText !== 'Pending (13)') {
|
||||||
throw new Error(`Expected: Alignment Status: "Pending (16)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Alignment Status: "Pending (13)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Alignment Status Pending (16) checkbox label matched as expected');
|
console.log('Passed: Alignment Status Pending (13) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -875,15 +875,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Alignment Status: Aligned (6) label
|
//Alignment Status: Aligned (8) label
|
||||||
{
|
{
|
||||||
description: 'Validate Alignment Status Aligned (6) label',
|
description: 'Validate Alignment Status Aligned (8) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText();
|
const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText();
|
||||||
if (elementText !== 'Aligned (6)') {
|
if (elementText !== 'Aligned (8)') {
|
||||||
throw new Error(`Expected: Alignment Status: "Aligned (6)" checkbox label; Actual: "${elementText}"`);
|
throw new Error(`Expected: Alignment Status: "Aligned (8)" checkbox label; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Alignment Status Aligned (6) checkbox label matched as expected');
|
console.log('Passed: Alignment Status Aligned (8) checkbox label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1966,6 +1966,27 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//LOG OUT
|
||||||
|
//NEXT ACTION - Log out
|
||||||
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -2013,6 +2034,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();
|
||||||
@@ -2026,17 +2049,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (usernameValidation) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: System logged in as expected');
|
console.log('PASSED: Align - Edit Content and Align Concept(ExACT_alignContentPage); All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Unable to log in');
|
console.log('FAILED: Align - Edit Content and Align Concept(ExACT_alignContentPage); One or more test steps failed');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_alignStandardsPage = (req, res) => {
|
const ExACT_alignStandardsPage = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Align Standards Page: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Align Standards Page(ExACT_alignStandardsPage): 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';
|
||||||
@@ -5361,6 +5361,20 @@ const steps = [
|
|||||||
{ description: 'Click Add Direct Alighment DIV - Done button', action: async () => await driver.findElement(By.css('.modal-footer > .btn')).click() },
|
{ description: 'Click Add Direct Alighment DIV - Done button', action: async () => await driver.findElement(By.css('.modal-footer > .btn')).click() },
|
||||||
{ description: 'Browser sleep', action: async () => await driver.sleep(2000) },
|
{ description: 'Browser sleep', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//LOG OUT
|
||||||
|
//NEXT ACTION - Log out
|
||||||
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -5408,6 +5422,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();
|
||||||
@@ -5421,17 +5437,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (usernameValidation) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: System logged in as expected');
|
console.log('PASSED: Align Standards Page(ExACT_alignStandardsPage); All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Unable to log in');
|
console.log('FAILED: Align Standards Page(ExACT_alignStandardsPage); One or more test steps failed');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_contentPage = (req, res) => {
|
const ExACT_contentPage = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Content Page: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Content Page(ExACT_contentPage): 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';
|
||||||
@@ -586,11 +586,59 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Social and Emotional Learning checkbox
|
//Language Arts checkbox (added?)
|
||||||
|
{
|
||||||
|
description: 'Verify Language Arts checkbox icon is present',
|
||||||
|
action: async () =>
|
||||||
|
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsLanguage\\ Arts')), 5000).catch(() => false);
|
||||||
|
if (!expectedIcon) {
|
||||||
|
throw new Error('Expected: Language Arts checkbox icon not found');
|
||||||
|
}
|
||||||
|
console.log('Passed: Language Arts checkbox icon present');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Language Arts label (added?)
|
||||||
|
{
|
||||||
|
description: 'Validate Language Arts label',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText();
|
||||||
|
if (elementText !== 'Language Arts') {
|
||||||
|
throw new Error(`Expected: "Language Arts"; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Language Arts label matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Social Studies checkbox (added?)
|
||||||
|
{
|
||||||
|
description: 'Verify Social Studies checkbox icon is present',
|
||||||
|
action: async () =>
|
||||||
|
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsSocial\\ Studies')), 5000).catch(() => false);
|
||||||
|
if (!expectedIcon) {
|
||||||
|
throw new Error('Expected: Social Studies checkbox icon not found');
|
||||||
|
}
|
||||||
|
console.log('Passed: Social Studies checkbox icon present');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Social Studies label (added?)
|
||||||
|
{
|
||||||
|
description: 'Validate Social Studies label',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(13)')).getText();
|
||||||
|
if (elementText !== 'Social Studies') {
|
||||||
|
throw new Error(`Expected: "Social Studies"; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Social Studies label matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Social and Emotional Learning checkbox (pushed down)
|
||||||
{
|
{
|
||||||
description: 'Verify Social and Emotional Learning checkbox icon is present',
|
description: 'Verify Social and Emotional Learning checkbox icon is present',
|
||||||
action: async () =>
|
action: async () =>
|
||||||
{ const expectedIcon = await driver.wait(until.elementLocated(By.id('metasubjectsSocial and Emotional Learning')), 5000).catch(() => false);
|
{ const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsSocial\\ and\\ Emotional\\ Learning')), 5000).catch(() => false);
|
||||||
if (!expectedIcon) {
|
if (!expectedIcon) {
|
||||||
throw new Error('Expected: Social and Emotional Learning checkbox icon not found');
|
throw new Error('Expected: Social and Emotional Learning checkbox icon not found');
|
||||||
}
|
}
|
||||||
@@ -598,11 +646,11 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Social and Emotional Learning label
|
//Social and Emotional Learning label (pushed down)
|
||||||
{
|
{
|
||||||
description: 'Validate Social and Emotional Learning label',
|
description: 'Validate Social and Emotional Learning label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText();
|
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(16)')).getText();
|
||||||
if (elementText !== 'Social and Emotional Learning') {
|
if (elementText !== 'Social and Emotional Learning') {
|
||||||
throw new Error(`Expected: "Social and Emotional Learning"; Actual: "${elementText}"`);
|
throw new Error(`Expected: "Social and Emotional Learning"; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
@@ -2048,15 +2096,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Filtered Content 2 alignment label
|
//Filtered Content 2 ECS Alignment (reset) label (previously Not Aligned)
|
||||||
{
|
{
|
||||||
description: 'Validate Filtered Content 2 Not Aligned label',
|
description: 'Validate Filtered Content 2 ECS Alignment (reset) label',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('#alignstatuslink873578655 > .display-alignment')).getText();
|
const elementText = await driver.findElement(By.css('#alignstatuslink873578655 > .display-alignment')).getText();
|
||||||
if (elementText !== 'Not Aligned') {
|
if (elementText !== 'ECS Alignment (reset)') {
|
||||||
throw new Error(`Expected: Filtered Content 2 Not Aligned label did not match; Actual: "${elementText}"`);
|
throw new Error(`Expected: Filtered Content 2 "ECS Alignment (reset)" label did not match; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Filtered Content 2 Not Aligned label matched as expected');
|
console.log('Passed: Filtered Content 2 ECS Alignment (reset) label matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2099,7 +2147,7 @@ const steps = [
|
|||||||
//NEXT ACTION - VIEW EDIT MODE
|
//NEXT ACTION - VIEW EDIT MODE
|
||||||
{ description: 'Click Edit View button', action: async () => await driver.findElement(By.linkText('Edit View')).click() },
|
{ description: 'Click Edit View button', action: async () => await driver.findElement(By.linkText('Edit View')).click() },
|
||||||
|
|
||||||
//Wait for dashboard to load - Correlation Coverages View Details button
|
//Wait for page to load - Correlation Coverages View Details button
|
||||||
{
|
{
|
||||||
description: 'Wait for Actions button to load',
|
description: 'Wait for Actions button to load',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
@@ -2323,15 +2371,15 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Second content item alignment pending text
|
//Second content item ECS Alignment (reset) text (previously Not Aligned)
|
||||||
{
|
{
|
||||||
description: 'Validate Altered Elephant Behavior alignment pending text',
|
description: 'Validate Altered Elephant Behavior ECS Alignment (reset) text',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('#alignstatuslink873578655 > .display-alignment')).getText();
|
const elementText = await driver.findElement(By.css('#alignstatuslink873578655 > .display-alignment')).getText();
|
||||||
if (elementText !== 'Not Aligned') {
|
if (elementText !== 'ECS Alignment (reset)') {
|
||||||
throw new Error(`Expected: Altered Elephant Behavior "Not Aligned" text; Actual: "${elementText}"`);
|
throw new Error(`Expected: Altered Elephant Behavior "ECS Alignment (reset)" text; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Altered Elephant Behavior "Not Aligned" text matched as expected');
|
console.log('Passed: Altered Elephant Behavior ECS Alignment (reset) text matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2417,12 +2465,40 @@ const steps = [
|
|||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.linkText('Delete')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.linkText('Delete')).getCssValue('color');
|
||||||
if (elementStyle !== 'rgba(220, 53, 69, 1)') {
|
if (elementStyle !== 'rgba(220, 53, 69, 1)') {
|
||||||
throw new Error(`Expected: Actions Delete text color did not match; Actual: "${elementStyle}"`);
|
throw new Error(`Expected: ECS-2920 | Actions Delete text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Delete text color matched as expected');
|
console.log('Passed: ECS-2920 | Delete text color matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//NEXT ACTION - Reset | ECS-2920
|
||||||
|
{ description: 'Click Actions button', action: async () => await driver.findElement(By.linkText('Actions')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Detail View button', action: async () => await driver.findElement(By.linkText('Detail View')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for page to load - Content 1 edit button
|
||||||
|
{
|
||||||
|
description: 'Wait for Content 1 edit button to load',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .lo-title .fa')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//LOG OUT
|
||||||
|
//NEXT ACTION - Log out
|
||||||
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -2470,6 +2546,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();
|
||||||
@@ -2483,17 +2561,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (usernameValidation) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: System logged in as expected');
|
console.log('PASSED: Content Page(ExACT_contentPage); All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Unable to log in');
|
console.log('FAILED: Content Page(ExACT_contentPage); One or more test steps failed');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_dashboardMyContent = (req, res) => {
|
const ExACT_dashboardMyContent = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Dashboard - My Content widget: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Dashboard - My Content Widget(ExACT_dashboardMyContent): 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';
|
||||||
@@ -2596,62 +2596,76 @@ const steps = [
|
|||||||
await alert.accept();
|
await alert.accept();
|
||||||
await driver.sleep(2000);
|
await driver.sleep(2000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Validate confirmation message
|
//Validate confirmation message
|
||||||
{
|
{
|
||||||
description: 'Validate confirmation message',
|
description: 'Validate confirmation message',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('strong')).getText();
|
const elementText = await driver.findElement(By.css('strong')).getText();
|
||||||
if (elementText !== 'The content set was successfuly deleted') {
|
if (elementText !== 'The content set was successfuly deleted') {
|
||||||
throw new Error(`Expected: Alert banner deleted confirmation message did not match; Actual: "${elementText}"`);
|
throw new Error(`Expected: Alert banner deleted confirmation message did not match; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Alert banner deleted confirmation message displayed as expected');
|
||||||
}
|
}
|
||||||
console.log('Passed: Alert banner deleted confirmation message displayed as expected');
|
},
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
//Validate confirmation message background color -green
|
//Validate confirmation message background color -green
|
||||||
{
|
{
|
||||||
description: 'Validate confirmation message background color',
|
description: 'Validate confirmation message background color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('#statalert')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('#statalert')).getCssValue('background-color');
|
||||||
if (elementStyle !== 'rgba(40, 167, 69, 1)') {
|
if (elementStyle !== 'rgba(40, 167, 69, 1)') {
|
||||||
throw new Error(`Expected: Alert banner background color did not match; Actual: "${elementStyle}"`);
|
throw new Error(`Expected: Alert banner background color did not match; Actual: "${elementStyle}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Alert banner background color matched as expected');
|
||||||
}
|
}
|
||||||
console.log('Passed: Alert banner background color matched as expected');
|
},
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
//Wait for dashboard to load
|
//Wait for dashboard to load
|
||||||
{
|
{
|
||||||
description: 'Wait for dashboard load to completely',
|
description: 'Wait for dashboard load to completely',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
return await driver.wait(until.elementLocated(By.linkText('View Details')), 10000).catch(() => false);
|
return await driver.wait(until.elementLocated(By.linkText('View Details')), 10000).catch(() => false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Verify content was deleted
|
//Verify content was deleted
|
||||||
{
|
{
|
||||||
description: 'Verify content set deletion',
|
description: 'Verify content set deletion',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const filterSearch = await driver.wait(
|
const filterSearch = await driver.wait(
|
||||||
until.elementLocated(By.css('#content-org-filter')),
|
until.elementLocated(By.css('#content-org-filter')),
|
||||||
5000
|
5000
|
||||||
);
|
);
|
||||||
await filterSearch.clear();
|
await filterSearch.clear();
|
||||||
await filterSearch.sendKeys('QA');
|
await filterSearch.sendKeys('QA');
|
||||||
await driver.sleep(2000);
|
await driver.sleep(2000);
|
||||||
|
|
||||||
const createdContentSet = await driver.findElements(
|
const createdContentSet = await driver.findElements(
|
||||||
By.linkText(createContentSetName)
|
By.linkText(createContentSetName)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (createdContentSet.length > 0) {
|
if (createdContentSet.length > 0) {
|
||||||
throw new Error('Content set was not deleted successfully');
|
throw new Error('Content set was not deleted successfully');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
|
||||||
|
|
||||||
|
//LOG OUT
|
||||||
|
//NEXT ACTION - Log out
|
||||||
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -2699,6 +2713,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();
|
||||||
@@ -2712,17 +2728,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (usernameValidation) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: System logged in as expected');
|
console.log('PASSED: My Content widget(ExACT_dashboardMyContent); All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Unable to log in');
|
console.log('FAILED: My Content widget(ExACT_dashboardMyContent); One or more test steps failed');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_editItem = (req, res) => {
|
const ExACT_editItem = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Edit Item: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Edit Item(ExACT_editItem): 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';
|
||||||
@@ -2447,6 +2447,20 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//LOG OUT
|
||||||
|
//NEXT ACTION - Log out
|
||||||
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -2494,6 +2508,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();
|
||||||
@@ -2507,17 +2523,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (usernameValidation) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: System logged in as expected');
|
console.log('PASSED: Edit Item(ExACT_editItem); All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Unable to log in');
|
console.log('FAILED: Edit Item(ExACT_editItem); One or more test steps failed');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8794,7 +8794,6 @@ const steps = [
|
|||||||
console.log('Passed: Log Out button present; Script completed');
|
console.log('Passed: Log Out button present; Script completed');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -8861,7 +8860,7 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (loginButton && allStepsPassed) {
|
if (loginButton && allStepsPassed) {
|
||||||
|
|||||||
@@ -3866,7 +3866,7 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if login was successful
|
//Check if log out was successful
|
||||||
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (loginButton & allStepsPassed) {
|
if (loginButton & allStepsPassed) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import XLSX from 'xlsx';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const ExACT_login = (req, res) => {
|
const ExACT_login = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Login: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Login(ExACT_login): 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';
|
||||||
@@ -328,9 +328,17 @@ const steps = [
|
|||||||
{ description: 'Enter username', action: async () => await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan') },
|
{ description: 'Enter username', action: async () => await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan') },
|
||||||
{ description: 'Enter correct password', action: async () => await driver.findElement(By.css('.passfield')).sendKeys('Edgate1!') },
|
{ description: 'Enter correct password', action: async () => await driver.findElement(By.css('.passfield')).sendKeys('Edgate1!') },
|
||||||
{ description: 'Click Login button after entering correct password', action: async () => await driver.findElement(By.css('.login')).click() },
|
{ description: 'Click Login button after entering correct password', action: async () => await driver.findElement(By.css('.login')).click() },
|
||||||
{ description: 'Driver sleep', action: async () => await driver.sleep(10000) },
|
{ description: 'Wait for login process to complete', action: async () => await driver.sleep(10000) },
|
||||||
|
|
||||||
//Check if log out was successful - username
|
//Wait for dashboard to load - Correlation Coverages View Details button
|
||||||
|
{
|
||||||
|
description: 'Wait for dashboard load to completely',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.linkText('View Details')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Confirm username
|
||||||
{
|
{
|
||||||
description: 'Verify username',
|
description: 'Verify username',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
@@ -342,9 +350,20 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Log Out
|
//LOG OUT
|
||||||
{ description: 'Click the profile label', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
//NEXT ACTION - Log out
|
||||||
{ description: 'Click Log out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
{ description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
{ description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() },
|
||||||
|
{ description: 'Wait for action to complete', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
//Wait for login screen to load
|
||||||
|
{
|
||||||
|
description: 'Wait for log out process to complete',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -363,19 +382,19 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
|||||||
return screenshotPath;
|
return screenshotPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearOldResults = () => {
|
const clearOldResults = () => {
|
||||||
// Remove old screenshots
|
// Remove old screenshots
|
||||||
const screenshotDir = path.join('screenshots', 'login');
|
const screenshotDir = path.join('screenshots', 'login');
|
||||||
if (fs.existsSync(screenshotDir)) {
|
if (fs.existsSync(screenshotDir)) {
|
||||||
fs.rmSync(screenshotDir, { recursive: true, force: true });
|
fs.rmSync(screenshotDir, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||||
|
|
||||||
// Remove old Excel file
|
// Remove old Excel file
|
||||||
if (fs.existsSync('loginResults.xlsx')) {
|
if (fs.existsSync('loginResults.xlsx')) {
|
||||||
fs.unlinkSync('loginResults.xlsx');
|
fs.unlinkSync('loginResults.xlsx');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Initialize workbook and worksheet
|
// Initialize workbook and worksheet
|
||||||
@@ -391,6 +410,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();
|
||||||
@@ -404,17 +425,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
|
//Check if log out was successful
|
||||||
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false);
|
||||||
|
|
||||||
if (loginButton) {
|
if (loginButton && allStepsPassed) {
|
||||||
console.log('PASSED: Script completed');
|
console.log('PASSED: Login(ExACT_login); All test steps completed successfully');
|
||||||
testStatus = 'Passed';
|
testStatus = 'Passed';
|
||||||
} else {
|
} else {
|
||||||
console.log('FAILED: Script completed');
|
console.log('FAILED: Login(ExACT_login); One or more test steps failed');
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user