Compare commits
2 Commits
d536166028
...
a27fd65cce
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a27fd65cce | ||
|
|
2e3a67438e |
Binary file not shown.
Binary file not shown.
6
index.js
6
index.js
@@ -1,6 +1,6 @@
|
||||
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';
|
||||
|
||||
//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>
|
||||
|
||||
<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>
|
||||
<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
|
||||
app.get('/ExACT_landingPage', ExACT_landingPage);
|
||||
app.get('/exactLandingPage', exactLandingPage);
|
||||
//Login
|
||||
//app.get('/ExACT_login', ExACT_login);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
results/alignStandardsPageResults.xlsx
Normal file
BIN
results/alignStandardsPageResults.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
results/uploadSubmitAResourcePageResults.xlsx
Normal file
BIN
results/uploadSubmitAResourcePageResults.xlsx
Normal file
Binary file not shown.
@@ -2238,6 +2238,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'alignAutoAlignPageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'alignAutoAlignPage');
|
||||
@@ -2247,9 +2249,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('alignAutoAlignPageResults.xlsx')) {
|
||||
fs.unlinkSync('alignAutoAlignPageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -2330,11 +2333,11 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'alignAutoAlignPageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
})();
|
||||
})();
|
||||
}
|
||||
|
||||
export default alignAutoAlignPage;
|
||||
|
||||
@@ -1389,6 +1389,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'alignContentPageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'alignContentPage');
|
||||
@@ -1398,9 +1400,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('alignContentPageResults.xlsx')) {
|
||||
fs.unlinkSync('alignContentPageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -1481,7 +1484,7 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'alignContentPageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
|
||||
@@ -1882,6 +1882,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'alignStandardsPageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'alignStandardsPage');
|
||||
@@ -1891,9 +1893,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('alignStandardsPageResults.xlsx')) {
|
||||
fs.unlinkSync('alignStandardsPageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -1974,7 +1977,7 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'alignStandardsPageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
description: 'Log Out',
|
||||
@@ -2572,6 +2614,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'frameworkManagementPageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'frameworkManagementPage');
|
||||
@@ -2581,9 +2625,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('frameworkManagementPageResults.xlsx')) {
|
||||
fs.unlinkSync('frameworkManagementPageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -2666,7 +2711,7 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'frameworkManagementPageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
|
||||
@@ -163,10 +163,10 @@ const steps = [
|
||||
|
||||
//NEXT ACTION
|
||||
{
|
||||
description: 'Click Align navigation link',
|
||||
description: 'Click Upload navigation link',
|
||||
action: async () => {
|
||||
await driver.findElement(By.linkText('Align')).click();
|
||||
console.log('----->| NEXT ACTION: Clicked Align navigation link');
|
||||
await driver.findElement(By.linkText('Upload')).click();
|
||||
console.log('----->| NEXT ACTION: Clicked Upload navigation link');
|
||||
|
||||
//Wait for page readyState
|
||||
await driver.wait(async () => {
|
||||
@@ -175,26 +175,84 @@ const steps = [
|
||||
}, 30000, 'Align page did not fully load within 30 seconds');
|
||||
|
||||
//Wait until the element exists in the DOM
|
||||
const contentTab = await driver.wait(
|
||||
until.elementLocated(By.css('#content-tab')),
|
||||
const uploadTitle = await driver.wait(
|
||||
until.elementLocated(By.css('h2')),
|
||||
30000
|
||||
);
|
||||
|
||||
//Wait until it becomes visible
|
||||
await driver.wait(
|
||||
until.elementIsVisible(contentTab),
|
||||
until.elementIsVisible(uploadTitle),
|
||||
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 () => {
|
||||
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
|
||||
const elementText = await element.getText();
|
||||
@@ -203,85 +261,42 @@ const steps = [
|
||||
const elementColor = await element.getCssValue('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
|
||||
const errors = [];
|
||||
|
||||
//element text
|
||||
if (elementText === 'Content') {
|
||||
console.log('Passed: Content tab title text matched as expected');
|
||||
if (elementText === 'Submit A Resource') {
|
||||
console.log('Passed: Submit A Resource tab title text matched as expected');
|
||||
} else {
|
||||
errors.push(`Expected: "Content"; Actual: "${elementText}"`);
|
||||
errors.push(`Expected: "Submit A Resource"; Actual: "${elementText}"`);
|
||||
}
|
||||
|
||||
//element font
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
errors.push(`Expected: Content 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}"`);
|
||||
errors.push(`Expected: Submit A Resource tab title background color: "rgba(40, 39, 90, 1)"; Actual: "${elementBgColor}"`);
|
||||
}
|
||||
|
||||
//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 () => {
|
||||
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
|
||||
const elementText = await element.getText();
|
||||
@@ -312,85 +327,42 @@ const steps = [
|
||||
const elementColor = await element.getCssValue('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
|
||||
const errors = [];
|
||||
|
||||
//element text
|
||||
if (elementText === 'Standards') {
|
||||
console.log('Passed: Standards tab title text matched as expected');
|
||||
if (elementText === 'Batch Upload') {
|
||||
console.log('Passed: Batch Upload tab title text matched as expected');
|
||||
} else {
|
||||
errors.push(`Expected: "Standards"; Actual: "${elementText}"`);
|
||||
errors.push(`Expected: "Batch Upload"; Actual: "${elementText}"`);
|
||||
}
|
||||
|
||||
//element font
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
errors.push(`Expected: Standards 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}"`);
|
||||
errors.push(`Expected: Batch Upload tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`);
|
||||
}
|
||||
|
||||
//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 () => {
|
||||
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
|
||||
const elementText = await element.getText();
|
||||
@@ -421,85 +393,100 @@ const steps = [
|
||||
const elementColor = await element.getCssValue('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
|
||||
const errors = [];
|
||||
|
||||
//element text
|
||||
if (elementText === 'AutoAlign') {
|
||||
console.log('Passed: AutoAlign tab title text matched as expected');
|
||||
if (elementText === 'Import Alignments') {
|
||||
console.log('Passed: Import Alignments tab title text matched as expected');
|
||||
} else {
|
||||
errors.push(`Expected: "AutoAlign"; Actual: "${elementText}"`);
|
||||
errors.push(`Expected: "Import Alignments"; Actual: "${elementText}"`);
|
||||
}
|
||||
|
||||
//element font
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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');
|
||||
//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'));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//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: AutoAlign tab tool-tip "AutoAlign a Content Set"; Actual: "${elementTitle}"`);
|
||||
errors.push(`Expected: "Choose how you'd like to add content to the system"; Actual: "${elementText}"`);
|
||||
}
|
||||
|
||||
//element tool-tip font
|
||||
if (elementTitleFont === 'Poppins, sans-serif') {
|
||||
console.log('Passed: AutoAlign tab tool-tip font-family matched as expected');
|
||||
//font
|
||||
if (elementFont === 'Poppins, sans-serif') {
|
||||
console.log('Passed: Widget sub-title font-family matched as expected');
|
||||
} else {
|
||||
errors.push(`Expected: AutoAlign tab tool-tip font-family "Poppins, sans-serif"; Actual: ${elementTitleFont}`);
|
||||
errors.push(`Expected: Widget sub-title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
|
||||
}
|
||||
|
||||
//element tool-tip size
|
||||
if (elementTitleSize === '15px') {
|
||||
console.log('Passed: AutoAlign tab tool-tip text font-size matched as expected');
|
||||
//size
|
||||
if (elementSize === '13px') {
|
||||
console.log('Passed: Widget sub-title text font-size matched as expected');
|
||||
} else {
|
||||
errors.push(`Expected: AutoAlign tab tool-tip text font-size "15px"; Actual: "${elementTitleSize}"`);
|
||||
errors.push(`Expected: Widget sub-title text font-size "13px"; Actual: "${elementSize}"`);
|
||||
}
|
||||
|
||||
//element tool-tip color
|
||||
if (elementTitleColor === 'rgba(182, 186, 181, 1)') {
|
||||
console.log('Passed: AutoAlign tab tool-tip text color matched as expected');
|
||||
//color
|
||||
if (elementColor === 'rgba(40, 39, 90, 1)') {
|
||||
console.log('Passed: Widget sub-title 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}"`);
|
||||
errors.push(`Expected: Widget sub-title text color: "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`);
|
||||
}
|
||||
|
||||
//Throw summary if any validation failed
|
||||
@@ -515,6 +502,8 @@ const steps = [
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
//NEXT ACTION
|
||||
{
|
||||
description: 'Click AutoAlign navigation tab',
|
||||
@@ -2114,7 +2103,7 @@ const steps = [
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -2238,18 +2227,21 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'uploadSubmitAResourcePageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'uploadSumitAResourcePage');
|
||||
const screenshotDir = path.join('screenshots', 'uploadSubmitAResourcePage');
|
||||
if (fs.existsSync(screenshotDir)) {
|
||||
fs.rmSync(screenshotDir, { recursive: true, force: true });
|
||||
}
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('uploadSubmitAResourcePageResults.xlsx')) {
|
||||
fs.unlinkSync('uploadSubmitAResourcePageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -2330,11 +2322,11 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'uploadSubmitAResourcePageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
})();
|
||||
})();
|
||||
}
|
||||
|
||||
export default uploadSubmitAResourcePage;
|
||||
|
||||
@@ -5549,6 +5549,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'correlationsDashboard.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'correlationsDashboard');
|
||||
@@ -5558,9 +5560,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('correlationsDashboard.xlsx')) {
|
||||
fs.unlinkSync('correlationsDashboard.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -5642,7 +5645,7 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'correlationsDashboard.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import XLSX from 'xlsx';
|
||||
import path from 'path';
|
||||
import { error } from 'console';
|
||||
|
||||
const ExACT_landingPage = (req, res) => {
|
||||
res.send('<h2>ExACT Automated Test Script: EGATE LANDING PAGE: ExACT Login Page (ExACT_landingPage) | Initiated</h2>');
|
||||
const exactLandingPage = (req, res) => {
|
||||
res.send('<h2>ExACT Automated Test Script: ExACT Landing Page(exactLandingPage) | Initiated</h2>');
|
||||
(async function example() {
|
||||
let driver = await new Builder()
|
||||
.forBrowser('chrome')
|
||||
@@ -1189,31 +1189,31 @@ const steps = [
|
||||
const errors = [];
|
||||
|
||||
//text
|
||||
if (elementText === 'Already Have an account? Sign In') {
|
||||
console.log('Passed: Already Have an account? Sign In text matched as expected');
|
||||
if (elementText === 'Already have an account? Sign In') {
|
||||
console.log('Passed: Already have an account? Sign In text matched as expected');
|
||||
} 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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
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 {
|
||||
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
|
||||
@@ -4817,6 +4817,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
|
||||
return screenshotPath;
|
||||
};
|
||||
|
||||
const resultsFile = path.join('results', 'exactLandingPageResults.xlsx');
|
||||
|
||||
const clearOldResults = () => {
|
||||
//Remove old screenshots
|
||||
const screenshotDir = path.join('screenshots', 'landingPage');
|
||||
@@ -4826,9 +4828,10 @@ const clearOldResults = () => {
|
||||
fs.mkdirSync(screenshotDir, { recursive: true });
|
||||
|
||||
//Remove old Excel file
|
||||
if (fs.existsSync('landingPageResults.xlsx')) {
|
||||
fs.unlinkSync('landingPageResults.xlsx');
|
||||
if (fs.existsSync(resultsFile)) {
|
||||
fs.unlinkSync(resultsFile);
|
||||
}
|
||||
fs.mkdirSync('results', { recursive: true });
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -4889,11 +4892,11 @@ try {
|
||||
|
||||
if (allStepsPassed) {
|
||||
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';
|
||||
} else {
|
||||
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:');
|
||||
failedSteps.forEach(step => console.error(` ✗ ${step}`));
|
||||
testStatus = 'Failed';
|
||||
@@ -4905,11 +4908,11 @@ try {
|
||||
|
||||
//Write the updated worksheet back to the workbook and save it
|
||||
workbook.Sheets['Sheet1'] = worksheet;
|
||||
XLSX.writeFile(workbook, 'landingPageResults.xlsx');
|
||||
XLSX.writeFile(workbook, resultsFile);
|
||||
} finally {
|
||||
await driver.quit();
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
export default ExACT_landingPage;
|
||||
export default exactLandingPage;
|
||||
Reference in New Issue
Block a user