Compare commits

..

2 Commits

Author SHA1 Message Date
jhuerta
a27fd65cce Cleaned up results file structure 2026-10-27 14:36:03 -07:00
jhuerta
2e3a67438e Cleaned file structure 2026-10-27 14:35:16 -07:00
17 changed files with 262 additions and 210 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
import express from 'express'; import express from 'express';
import ExACT_landingPage from './tests/ExACT_landingPage.js'; import exactLandingPage from './tests/exactLandingPage.js';
//import ExACT_login from './tests/ExACT_login.js'; //import ExACT_login from './tests/ExACT_login.js';
//DASHBOARDS //DASHBOARDS
@@ -47,7 +47,7 @@ app.get('/', (req, res) => {
<div style="text-align:center; color:#001; font-size:15px; ">(Click the corresponding link to execute the desired script)</div> <div style="text-align:center; color:#001; font-size:15px; ">(Click the corresponding link to execute the desired script)</div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">EDGATE LANDING PAGE</h1> <h1 style="text-align:center; color:#055a8c; font-size:20px; ">EDGATE LANDING PAGE</h1>
<div style="padding:3px;"><strong><a href='/ExACT_landingPage' target='_blank'>ExACT Landing Page</a></strong></div> <div style="padding:3px;"><strong><a href='/exactLandingPage' target='_blank'>ExACT Landing Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">DASHBOARD</h1> <h1 style="text-align:center; color:#055a8c; font-size:20px; ">DASHBOARD</h1>
<div style="padding:3px;"><strong><a href='/correlationsDashboard' target='_blank'>Correlations Dashboard</a></strong></div> <div style="padding:3px;"><strong><a href='/correlationsDashboard' target='_blank'>Correlations Dashboard</a></strong></div>
@@ -93,7 +93,7 @@ app.get('/', (req, res) => {
}) })
//EXACT LANDING //EXACT LANDING
app.get('/ExACT_landingPage', ExACT_landingPage); app.get('/exactLandingPage', exactLandingPage);
//Login //Login
//app.get('/ExACT_login', ExACT_login); //app.get('/ExACT_login', ExACT_login);

Binary file not shown.

Binary file not shown.

View File

@@ -2238,6 +2238,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'alignAutoAlignPageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'alignAutoAlignPage'); const screenshotDir = path.join('screenshots', 'alignAutoAlignPage');
@@ -2247,9 +2249,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('alignAutoAlignPageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('alignAutoAlignPageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -2330,7 +2333,7 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'alignAutoAlignPageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }

View File

@@ -1389,6 +1389,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'alignContentPageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'alignContentPage'); const screenshotDir = path.join('screenshots', 'alignContentPage');
@@ -1398,9 +1400,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('alignContentPageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('alignContentPageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -1481,7 +1484,7 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'alignContentPageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }

View File

@@ -1882,6 +1882,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'alignStandardsPageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'alignStandardsPage'); const screenshotDir = path.join('screenshots', 'alignStandardsPage');
@@ -1891,9 +1893,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('alignStandardsPageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('alignStandardsPageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -1974,7 +1977,7 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'alignStandardsPageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }

View File

@@ -2508,6 +2508,48 @@ const steps = [
}, },
*/ */
//FOOTER
//EdGate Copyright Logo
{
description: 'EdGate Copyright Logo',
action: async () => {
const multipleChecks = 'EdGate Copyright Logo';
const element = await driver.findElement(By.css('footer .pull-right > a'));
const elementLogo = await element.findElement(By.css('img'));
const expectedHref = 'https://www.edgate.com/';
//Track all errors
const errors = [];
//icon present
if (await elementLogo.isDisplayed()) {
console.log('Passed: EdGate Copyright Logo was displayed as expected');
} else {
errors.push('Expected: EdGate Copyright Logo was not displayed');
}
//href - browser resolves the link with a trailing slash, so remove it before comparing
const actualHref = await element.getAttribute('href');
if (actualHref && actualHref === expectedHref) {
console.log('Passed: EdGate Copyright Logo href matched as expected');
} else {
errors.push(`Expected: EdGate Copyright Logo href to be: "https://www.edgate.com/"; actual: "${actualHref}"`);
}
//Throw summary if any validation failed
if (errors.length > 0) {
//Add summary line only when multiple checks failed
if (errors.length > 1) {
errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`);
}
//Throw collected messages — catch() will prefix with "FAILED:"
throw new Error(errors.join('\n'));
}
}
},
//NEXT ACTION //NEXT ACTION
{ {
description: 'Log Out', description: 'Log Out',
@@ -2572,6 +2614,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'frameworkManagementPageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'frameworkManagementPage'); const screenshotDir = path.join('screenshots', 'frameworkManagementPage');
@@ -2581,9 +2625,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('frameworkManagementPageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('frameworkManagementPageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -2666,7 +2711,7 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'frameworkManagementPageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }

View File

@@ -163,10 +163,10 @@ const steps = [
//NEXT ACTION //NEXT ACTION
{ {
description: 'Click Align navigation link', description: 'Click Upload navigation link',
action: async () => { action: async () => {
await driver.findElement(By.linkText('Align')).click(); await driver.findElement(By.linkText('Upload')).click();
console.log('----->| NEXT ACTION: Clicked Align navigation link'); console.log('----->| NEXT ACTION: Clicked Upload navigation link');
//Wait for page readyState //Wait for page readyState
await driver.wait(async () => { await driver.wait(async () => {
@@ -175,26 +175,84 @@ const steps = [
}, 30000, 'Align page did not fully load within 30 seconds'); }, 30000, 'Align page did not fully load within 30 seconds');
//Wait until the element exists in the DOM //Wait until the element exists in the DOM
const contentTab = await driver.wait( const uploadTitle = await driver.wait(
until.elementLocated(By.css('#content-tab')), until.elementLocated(By.css('h2')),
30000 30000
); );
//Wait until it becomes visible //Wait until it becomes visible
await driver.wait( await driver.wait(
until.elementIsVisible(contentTab), until.elementIsVisible(uploadTitle),
30000 30000
); );
} }
}, },
//Content tab //Upload page title
{ {
description: 'Content tab title text, size, color, and background color', description: 'Upload page title text, size, and color',
action: async () => { action: async () => {
const multipleChecks = 'Content tab title'; const multipleChecks = 'Upload page title';
const element = await driver.findElement(By.linkText('Content')); const element = await driver.findElement(By.css('h2'));
//Get text, font, size, and color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
//text
if (elementText === 'Upload') {
console.log('Passed: Upload page title text matched as expected');
} else {
errors.push(`Expected: "Upload"; Actual: "${elementText}"`);
}
//font
if (elementFont === `"DM Serif Display", serif`) {
console.log('Passed: Upload page title font-family matched as expected');
} else {
errors.push(`Expected: Upload page title font-family "DM Serif Display, serif"; Actual: ${elementFont}`);
}
//size
if (elementSize === '32px') {
console.log('Passed: Upload page title text font-size matched as expected');
} else {
errors.push(`Expected: Upload page title text font-size "32px"; Actual: "${elementSize}"`);
}
//color
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Upload page title text color matched as expected');
} else {
errors.push(`Expected: Upload page title text color: "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`);
}
//Throw summary if any validation failed
if (errors.length > 0) {
//Add summary line only when multiple checks failed
if (errors.length > 1) {
errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`);
}
//Throw collected messages — catch() will prefix with "FAILED:"
throw new Error(errors.join('\n'));
}
}
},
//Submit A Resource tab
{
description: 'Submit A Resource tab title text, size, color, and background color',
action: async () => {
const multipleChecks = 'Submit A Resource tab title';
const element = await driver.findElement(By.linkText('Submit A Resource'));
//Get text, font, size, color, and background color //Get text, font, size, color, and background color
const elementText = await element.getText(); const elementText = await element.getText();
@@ -203,85 +261,42 @@ const steps = [
const elementColor = await element.getCssValue('color'); const elementColor = await element.getCssValue('color');
const elementBgColor = await element.getCssValue('background-color'); const elementBgColor = await element.getCssValue('background-color');
//Tool-tip lives on the parent <li>; Bootstrap moves "title" into "data-original-title" and blanks "title"
const tooltipHost = await element.findElement(By.xpath('./parent::li'));
const elementTitle = (await tooltipHost.getAttribute('data-original-title')) || (await tooltipHost.getAttribute('title'));
const elementTitleFont = await element.getCssValue('font-family');
const elementTitleSize = await element.getCssValue('font-size');
const elementTitleColor = await element.getCssValue('color');
const elementTitleBgColor = await element.getCssValue('background-color');
//Track all errors //Track all errors
const errors = []; const errors = [];
//element text //element text
if (elementText === 'Content') { if (elementText === 'Submit A Resource') {
console.log('Passed: Content tab title text matched as expected'); console.log('Passed: Submit A Resource tab title text matched as expected');
} else { } else {
errors.push(`Expected: "Content"; Actual: "${elementText}"`); errors.push(`Expected: "Submit A Resource"; Actual: "${elementText}"`);
} }
//element font //element font
if (elementFont === 'Poppins, sans-serif') { if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Content tab title font-family matched as expected'); console.log('Passed: Submit A Resource tab title font-family matched as expected');
} else { } else {
errors.push(`Expected: Content tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); errors.push(`Expected: Submit A Resource tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
} }
//element size //element size
if (elementSize === '15px') { if (elementSize === '15px') {
console.log('Passed: Content tab title text font-size matched as expected'); console.log('Passed: Submit A Resource tab title text font-size matched as expected');
} else { } else {
errors.push(`Expected: Content tab title text font-size "15px"; Actual: "${elementSize}"`); errors.push(`Expected: Submit A Resource tab title text font-size "15px"; Actual: "${elementSize}"`);
} }
//element color //element color
if (elementColor === 'rgba(255, 255, 255, 1)') { if (elementColor === 'rgba(255, 255, 255, 1)') {
console.log('Passed: Content tab title text color matched as expected'); console.log('Passed: Submit A Resource tab title text color matched as expected');
} else { } else {
errors.push(`Expected: Content tab title text color: "rgba(255, 255, 255, 1)"; Actual: "${elementColor}"`); errors.push(`Expected: Submit A Resource tab title text color: "rgba(255, 255, 255, 1)"; Actual: "${elementColor}"`);
} }
//element background color //element background color
if (elementBgColor === 'rgba(40, 39, 90, 1)') { if (elementBgColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Content tab title background color matched as expected'); console.log('Passed: Submit A Resource tab title background color matched as expected');
} else { } else {
errors.push(`Expected: Content tab title background color: "rgba(40, 39, 90, 1)"; Actual: "${elementBgColor}"`); errors.push(`Expected: Submit A Resource tab title background color: "rgba(40, 39, 90, 1)"; Actual: "${elementBgColor}"`);
}
//element tool-tip text
if (elementTitle === 'Browse content and align by tagging concepts') {
console.log('Passed: Content tab tool-tip text matched as expected');
} else {
errors.push(`Expected: Content tab tool-tip "Browse content and align by tagging concepts"; Actual: "${elementTitle}"`);
}
//element tool-tip font
if (elementTitleFont === 'Poppins, sans-serif') {
console.log('Passed: Content tab tool-tip font-family matched as expected');
} else {
errors.push(`Expected: Content tab tool-tip font-family "Poppins, sans-serif"; Actual: ${elementTitleFont}`);
}
//element tool-tip size
if (elementTitleSize === '15px') {
console.log('Passed: Content tab tool-tip text font-size matched as expected');
} else {
errors.push(`Expected: Content tab tool-tip text font-size "15px"; Actual: "${elementTitleSize}"`);
}
//element tool-tip color
if (elementTitleColor === 'rgba(255, 255, 255, 1)') {
console.log('Passed: Content tab tool-tip text color matched as expected');
} else {
errors.push(`Expected: Content tab tool-tip text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTitleColor}"`);
}
//element tool-tip background color
if (elementTitleBgColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Content tab tool-tip background color matched as expected');
} else {
errors.push(`Expected: Content tab tool-tip background color: "rgba(40, 39, 90, 1)"; Actual: "${elementTitleBgColor}"`);
} }
//Throw summary if any validation failed //Throw summary if any validation failed
@@ -297,13 +312,13 @@ const steps = [
} }
}, },
//Standards tab //Batch Upload tab
{ {
description: 'Standards tab title text, size, color, and background color', description: 'Batch Upload tab title text, size, color, and background color',
action: async () => { action: async () => {
const multipleChecks = 'Standards tab title'; const multipleChecks = 'Batch Upload tab title';
const element = await driver.findElement(By.linkText('Standards')); const element = await driver.findElement(By.linkText('Batch Upload'));
//Get text, font, size, color, and background color //Get text, font, size, color, and background color
const elementText = await element.getText(); const elementText = await element.getText();
@@ -312,85 +327,42 @@ const steps = [
const elementColor = await element.getCssValue('color'); const elementColor = await element.getCssValue('color');
const elementBgColor = await element.getCssValue('background-color'); const elementBgColor = await element.getCssValue('background-color');
//Tool-tip lives on the parent <li>; Bootstrap moves "title" into "data-original-title" and blanks "title"
const tooltipHost = await element.findElement(By.xpath('./parent::li'));
const elementTitle = (await tooltipHost.getAttribute('data-original-title')) || (await tooltipHost.getAttribute('title'));
const elementTitleFont = await element.getCssValue('font-family');
const elementTitleSize = await element.getCssValue('font-size');
const elementTitleColor = await element.getCssValue('color');
const elementTitleBgColor = await element.getCssValue('background-color');
//Track all errors //Track all errors
const errors = []; const errors = [];
//element text //element text
if (elementText === 'Standards') { if (elementText === 'Batch Upload') {
console.log('Passed: Standards tab title text matched as expected'); console.log('Passed: Batch Upload tab title text matched as expected');
} else { } else {
errors.push(`Expected: "Standards"; Actual: "${elementText}"`); errors.push(`Expected: "Batch Upload"; Actual: "${elementText}"`);
} }
//element font //element font
if (elementFont === 'Poppins, sans-serif') { if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Standards tab title font-family matched as expected'); console.log('Passed: Batch Upload tab title font-family matched as expected');
} else { } else {
errors.push(`Expected: Standards tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); errors.push(`Expected: Batch Upload tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
} }
//element size //element size
if (elementSize === '15px') { if (elementSize === '15px') {
console.log('Passed: Standards tab title text font-size matched as expected'); console.log('Passed: Batch Upload tab title text font-size matched as expected');
} else { } else {
errors.push(`Expected: Standards tab title text font-size "15px"; Actual: "${elementSize}"`); errors.push(`Expected: Batch Upload tab title text font-size "15px"; Actual: "${elementSize}"`);
} }
//element color //element color
if (elementColor === 'rgba(182, 186, 181, 1)') { if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Standards tab title text color matched as expected'); console.log('Passed: Batch Upload tab title text color matched as expected');
} else { } else {
errors.push(`Expected: Standards tab title text color: "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`); errors.push(`Expected: Batch Upload tab title text color: "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`);
} }
//element background color //element background color
if (elementBgColor === 'rgba(0, 0, 0, 0)') { if (elementBgColor === 'rgba(0, 0, 0, 0)') {
console.log('Passed: Standards tab title background color matched as expected'); console.log('Passed: Batch Upload tab title background color matched as expected');
} else { } else {
errors.push(`Expected: Standards tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); errors.push(`Expected: Batch Upload tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`);
}
//element tool-tip text
if (elementTitle === 'Browse standards and align content using specific standards') {
console.log('Passed: Standards tab tool-tip text matched as expected');
} else {
errors.push(`Expected: Standards tab tool-tip "Browse standards and align content using specific standards"; Actual: "${elementTitle}"`);
}
//element tool-tip font
if (elementTitleFont === 'Poppins, sans-serif') {
console.log('Passed: Standards tab tool-tip font-family matched as expected');
} else {
errors.push(`Expected: Standards tab tool-tip font-family "Poppins, sans-serif"; Actual: ${elementTitleFont}`);
}
//element tool-tip size
if (elementTitleSize === '15px') {
console.log('Passed: Standards tab tool-tip text font-size matched as expected');
} else {
errors.push(`Expected: Standards tab tool-tip text font-size "15px"; Actual: "${elementTitleSize}"`);
}
//element tool-tip color
if (elementTitleColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Standards tab tool-tip text color matched as expected');
} else {
errors.push(`Expected: Standards tab tool-tip text color: "rgba(182, 186, 181, 1)"; Actual: "${elementTitleColor}"`);
}
//element tool-tip background color
if (elementTitleBgColor === 'rgba(0, 0, 0, 0)') {
console.log('Passed: Standards tab tool-tip background color matched as expected');
} else {
errors.push(`Expected: Standards tab tool-tip background color: "rgba(0, 0, 0, 0)"; Actual: "${elementTitleBgColor}"`);
} }
//Throw summary if any validation failed //Throw summary if any validation failed
@@ -406,13 +378,13 @@ const steps = [
} }
}, },
//AutoAlign tab //Import Alignments tab
{ {
description: 'AutoAlign tab title text, size, color, and background color', description: 'Import Alignments tab title text, size, color, and background color',
action: async () => { action: async () => {
const multipleChecks = 'AutoAlign tab title'; const multipleChecks = 'Import Alignments tab title';
const element = await driver.findElement(By.linkText('AutoAlign')); const element = await driver.findElement(By.linkText('Import Alignments'));
//Get text, font, size, color, and background color //Get text, font, size, color, and background color
const elementText = await element.getText(); const elementText = await element.getText();
@@ -421,85 +393,42 @@ const steps = [
const elementColor = await element.getCssValue('color'); const elementColor = await element.getCssValue('color');
const elementBgColor = await element.getCssValue('background-color'); const elementBgColor = await element.getCssValue('background-color');
//Tool-tip lives on the parent <li>; Bootstrap moves "title" into "data-original-title" and blanks "title"
const tooltipHost = await element.findElement(By.xpath('./parent::li'));
const elementTitle = (await tooltipHost.getAttribute('data-original-title')) || (await tooltipHost.getAttribute('title'));
const elementTitleFont = await element.getCssValue('font-family');
const elementTitleSize = await element.getCssValue('font-size');
const elementTitleColor = await element.getCssValue('color');
const elementTitleBgColor = await element.getCssValue('background-color');
//Track all errors //Track all errors
const errors = []; const errors = [];
//element text //element text
if (elementText === 'AutoAlign') { if (elementText === 'Import Alignments') {
console.log('Passed: AutoAlign tab title text matched as expected'); console.log('Passed: Import Alignments tab title text matched as expected');
} else { } else {
errors.push(`Expected: "AutoAlign"; Actual: "${elementText}"`); errors.push(`Expected: "Import Alignments"; Actual: "${elementText}"`);
} }
//element font //element font
if (elementFont === 'Poppins, sans-serif') { if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: AutoAlign tab title font-family matched as expected'); console.log('Passed: Import Alignments tab title font-family matched as expected');
} else { } else {
errors.push(`Expected: AutoAlign tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); errors.push(`Expected: Import Alignments tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
} }
//element size //element size
if (elementSize === '15px') { if (elementSize === '15px') {
console.log('Passed: AutoAlign tab title text font-size matched as expected'); console.log('Passed: Import Alignments tab title text font-size matched as expected');
} else { } else {
errors.push(`Expected: AutoAlign tab title text font-size "15px"; Actual: "${elementSize}"`); errors.push(`Expected: Import Alignments tab title text font-size "15px"; Actual: "${elementSize}"`);
} }
//element color //element color
if (elementColor === 'rgba(182, 186, 181, 1)') { if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: AutoAlign tab title text color matched as expected'); console.log('Passed: Import Alignments tab title text color matched as expected');
} else { } else {
errors.push(`Expected: AutoAlign tab title text color: "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`); errors.push(`Expected: Import Alignments tab title text color: "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`);
} }
//element background color //element background color
if (elementBgColor === 'rgba(0, 0, 0, 0)') { if (elementBgColor === 'rgba(0, 0, 0, 0)') {
console.log('Passed: AutoAlign tab title background color matched as expected'); console.log('Passed: Import Alignments tab title background color matched as expected');
} else { } else {
errors.push(`Expected: AutoAlign tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); errors.push(`Expected: Import Alignments tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`);
}
//element tool-tip text
if (elementTitle === 'AutoAlign a Content Set') {
console.log('Passed: AutoAlign tab tool-tip text matched as expected');
} else {
errors.push(`Expected: AutoAlign tab tool-tip "AutoAlign a Content Set"; Actual: "${elementTitle}"`);
}
//element tool-tip font
if (elementTitleFont === 'Poppins, sans-serif') {
console.log('Passed: AutoAlign tab tool-tip font-family matched as expected');
} else {
errors.push(`Expected: AutoAlign tab tool-tip font-family "Poppins, sans-serif"; Actual: ${elementTitleFont}`);
}
//element tool-tip size
if (elementTitleSize === '15px') {
console.log('Passed: AutoAlign tab tool-tip text font-size matched as expected');
} else {
errors.push(`Expected: AutoAlign tab tool-tip text font-size "15px"; Actual: "${elementTitleSize}"`);
}
//element tool-tip color
if (elementTitleColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: AutoAlign tab tool-tip text color matched as expected');
} else {
errors.push(`Expected: AutoAlign tab tool-tip text color: "rgba(182, 186, 181, 1)"; Actual: "${elementTitleColor}"`);
}
//element tool-tip background color
if (elementTitleBgColor === 'rgba(0, 0, 0, 0)') {
console.log('Passed: AutoAlign tab tool-tip background color matched as expected');
} else {
errors.push(`Expected: AutoAlign tab tool-tip background color: "rgba(0, 0, 0, 0)"; Actual: "${elementTitleBgColor}"`);
} }
//Throw summary if any validation failed //Throw summary if any validation failed
@@ -515,6 +444,66 @@ const steps = [
} }
}, },
//Widget sub-title
{
description: 'Widget sub-title text, size, and color',
action: async () => {
const multipleChecks = 'Widget sub-title';
const element = await driver.findElement(By.css('.chooser-intro'));
//Get text, font, size, and color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
//text
if (elementText === `Choose how you'd like to add content to the system`) {
console.log('Passed: Widget sub-title text matched as expected');
} else {
errors.push(`Expected: "Choose how you'd like to add content to the system"; Actual: "${elementText}"`);
}
//font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Widget sub-title font-family matched as expected');
} else {
errors.push(`Expected: Widget sub-title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
}
//size
if (elementSize === '13px') {
console.log('Passed: Widget sub-title text font-size matched as expected');
} else {
errors.push(`Expected: Widget sub-title text font-size "13px"; Actual: "${elementSize}"`);
}
//color
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Widget sub-title text color matched as expected');
} else {
errors.push(`Expected: Widget sub-title text color: "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`);
}
//Throw summary if any validation failed
if (errors.length > 0) {
//Add summary line only when multiple checks failed
if (errors.length > 1) {
errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`);
}
//Throw collected messages — catch() will prefix with "FAILED:"
throw new Error(errors.join('\n'));
}
}
},
/*
//NEXT ACTION //NEXT ACTION
{ {
description: 'Click AutoAlign navigation tab', description: 'Click AutoAlign navigation tab',
@@ -2114,7 +2103,7 @@ const steps = [
} }
} }
}, },
*/
@@ -2238,18 +2227,21 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'uploadSubmitAResourcePageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'uploadSumitAResourcePage'); const screenshotDir = path.join('screenshots', 'uploadSubmitAResourcePage');
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('uploadSubmitAResourcePageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('uploadSubmitAResourcePageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -2330,7 +2322,7 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'uploadSubmitAResourcePageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }

View File

@@ -5549,6 +5549,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'correlationsDashboard.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'correlationsDashboard'); const screenshotDir = path.join('screenshots', 'correlationsDashboard');
@@ -5558,9 +5560,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('correlationsDashboard.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('correlationsDashboard.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -5642,7 +5645,7 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'correlationsDashboard.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }

View File

@@ -5,8 +5,8 @@ import XLSX from 'xlsx';
import path from 'path'; import path from 'path';
import { error } from 'console'; import { error } from 'console';
const ExACT_landingPage = (req, res) => { const exactLandingPage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: EGATE LANDING PAGE: ExACT Login Page (ExACT_landingPage) | Initiated</h2>'); res.send('<h2>ExACT Automated Test Script: ExACT Landing Page(exactLandingPage) | Initiated</h2>');
(async function example() { (async function example() {
let driver = await new Builder() let driver = await new Builder()
.forBrowser('chrome') .forBrowser('chrome')
@@ -1189,31 +1189,31 @@ const steps = [
const errors = []; const errors = [];
//text //text
if (elementText === 'Already Have an account? Sign In') { if (elementText === 'Already have an account? Sign In') {
console.log('Passed: Already Have an account? Sign In text matched as expected'); console.log('Passed: Already have an account? Sign In text matched as expected');
} else { } else {
errors.push(`Expected: "Already Have an account? Sign In"; Actual: "${elementText}"`); errors.push(`Expected: "Already have an account? Sign In"; Actual: "${elementText}"`);
} }
//font-family //font-family
if (elementFont === "Poppins, sans-serif") { if (elementFont === "Poppins, sans-serif") {
console.log('Passed: Already Have an account? Sign In text font matched as expected'); console.log('Passed: Already have an account? Sign In text font matched as expected');
} else { } else {
errors.push(`Expected: Already Have an account? Sign In text font "Poppins, sans-serif"; Actual: ${elementFont}`); errors.push(`Expected: Already have an account? Sign In text font "Poppins, sans-serif"; Actual: ${elementFont}`);
} }
//color //color
if (elementColor === 'rgba(32, 32, 32, 1)') { if (elementColor === 'rgba(32, 32, 32, 1)') {
console.log('Passed: Already Have an account? Sign In color matched as expected'); console.log('Passed: Already have an account? Sign In color matched as expected');
} else { } else {
errors.push(`Expected: Already Have an account? Sign In color "rgba(32, 32, 32, 1)"; Actual: "${elementColor}"`); errors.push(`Expected: Already have an account? Sign In color "rgba(32, 32, 32, 1)"; Actual: "${elementColor}"`);
} }
//font size //font size
if (elementSize === '12px') { if (elementSize === '12px') {
console.log('Passed: Already Have an account? Sign In text font-size matched as expected'); console.log('Passed: Already have an account? Sign In text font-size matched as expected');
} else { } else {
errors.push(`Expected: Already Have an account? Sign In text font-size "12px"; Actual: "${elementSize}"`); errors.push(`Expected: Already have an account? Sign In text font-size "12px"; Actual: "${elementSize}"`);
} }
//Throw summary if any validation failed //Throw summary if any validation failed
@@ -4817,6 +4817,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'exactLandingPageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'landingPage'); const screenshotDir = path.join('screenshots', 'landingPage');
@@ -4826,9 +4828,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('landingPageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('landingPageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -4889,11 +4892,11 @@ try {
if (allStepsPassed) { if (allStepsPassed) {
console.log('------------->| THE END |<-------------'); console.log('------------->| THE END |<-------------');
console.log('PASSED: EDGATE LANDING PAGE - ExACT Landing Page (ExACT_landingPage); All test steps completed successfully'); console.log('PASSED: ExACT Landing Page(exactLandingPage); All test steps completed successfully');
testStatus = 'Passed'; testStatus = 'Passed';
} else { } else {
console.log('------------->| THE END |<-------------'); console.log('------------->| THE END |<-------------');
console.log('FAILED: EDGATE LANDING PAGE - ExACT Landing Page (ExACT_landingPage); One or more test steps failed'); console.log('FAILED: ExACT Landing Page(exactLandingPage); One or more test steps failed');
console.log('FAILED STEPS:'); console.log('FAILED STEPS:');
failedSteps.forEach(step => console.error(` ✗ ${step}`)); failedSteps.forEach(step => console.error(` ✗ ${step}`));
testStatus = 'Failed'; testStatus = 'Failed';
@@ -4905,11 +4908,11 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'landingPageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }
})(); })();
} }
export default ExACT_landingPage; export default exactLandingPage;