|
|
|
|
@@ -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;
|
|
|
|
|
|