From f1937842523ff491b4f6d1cb154e669c3735e471 Mon Sep 17 00:00:00 2001 From: jhuerta Date: Fri, 30 Oct 2026 12:30:54 -0700 Subject: [PATCH] Completed Report Build Youre Report Page script --- results/reportBuildYourReportPageResults.xlsx | Bin 18533 -> 22073 bytes tests/Report/reportBuildYourReportPage.js | 1065 ++++++++++++++++- 2 files changed, 1063 insertions(+), 2 deletions(-) diff --git a/results/reportBuildYourReportPageResults.xlsx b/results/reportBuildYourReportPageResults.xlsx index 50ae86f9365cefd8be9277d30be85415005a6b04..0e0bf41b4e0832822427ec1df1f49ba9a8d8a6f7 100644 GIT binary patch delta 2395 zcmbW3&x;&I6vuZO4U&+}L5*<umSZ z)3dq;+)M5XMGy%h;zcB2G#~^CUOgs9(Sw&9bITv#tLoY5uA0py%dqw4O;vr~tA6iW z{qXDB-CMQWUo{T?=>0x!F3im}7w&x9I8ZYzeCLPPZq<%h_zLk)Q~21XOFjPK8-J-j z%jRd6UgB>zuUGuONj)b0kDJ#Nzm19X-#B@5e!92inl|R$rJu{G;Bq`qPMvRkSMf6w zyHxrgwC*Z?YPo#ZJjQ=L_2=PoYi8O!XfN<@%zMgg7gIU=TALid6m6whj;`!%MQD&k z!A6*kHxo1r2GNk8Z#DS+_Hrd!W_mXN(tMdyOkO!3#0lzUaUNxHu>a~EtgdFo>VNRz zm2PLdOK7LP-R-o)ZYM<9N_~~sb(F8vM|oBkzh52?K8eD7wEyN!vRui_H?if5yw)68 zE4O=-2oo@tj&T%BKMOXZ{UHW%`0b^-7>+bwRB*&$0(ZeJal!at;*Gsc38U}fs zCQpL81=O8^QYNA6UI`T@Kph?GDbRPfp3JKe{>##$LA)89jUAEWIacC?2{>2BF$Gtx zs~`;1Y$Fa5{;%1su_84#!*X1i+OA)+gb6H9XZZ^2Vis-2<4rV8ah&IAg7WC|yoEkW z6Zk)hzld5WOowUKLWAP>$+sZcKyjERdyMCb+UXJg-YGZ}e9SIfBvu|!FZio+S9VLZxvW>f)po5ulof-L0!P$rZERvDCFd@GtDtI>KWHx+l+KWdCrPW+ zDoMfw646PPLYnli!ZD~NQUct3^Jv+(kP&6B5YaVimmFaNN0%d*qCUS$<7za!I6!+Q zEejMAa6MYek~9IQ%M$pjxV?JTNQEF#O^_flySN>8X{kuk1d^^u;IEP{jT3Ys{cNu@ zp0aZ$jbqS4ysO#y?x7bCK=8?=-*X~JH*v{9d5#fwn2 zLVV!M%vKe!4sdfByr<6QVQ# delta 472 zcmdnFhVkhH#tr?d0){LeInqto)+RP9)_PdZuQElk4>)CU4Z; zk0NenVGI<%$_sTk&}a)ii^;WmQj@Fo4JS9)s!V>XZ;hhE(g37GVzNKbVdi#XlMfr9 z$(w@Zc}$e-Y?2jkJL`%q&czZ1l_QZ1j_% zI$Xgz#3tw42Y^ERp#5$UE<|)pZVL%x;xU?hFT|SZpy_1kP-`Xw^T`pR=1fa1Cr=Eu aVPdtJd_L5csn2#YUzjS}6<1*7F#rJ7gN5z@ diff --git a/tests/Report/reportBuildYourReportPage.js b/tests/Report/reportBuildYourReportPage.js index 6042f4d..5cc89e9 100644 --- a/tests/Report/reportBuildYourReportPage.js +++ b/tests/Report/reportBuildYourReportPage.js @@ -444,10 +444,1071 @@ const steps = [ } }, - - + //BREADCRUMS + //Report Type breadcrum + { + description: 'Report Type breadcrumn label text, size, and color', + action: async () => { + const multipleChecks = 'Report Type breadcrumn label'; + const element = await driver.findElement(By.css('#crumb-rept')); + //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 === 'Report Type') { + console.log('Passed: Report Type breadcrumn label text matched as expected'); + } else { + errors.push(`Expected: "Report Type"; Actual: "${elementText}"`); + } + + //font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Report Type breadcrumn label font-family matched as expected'); + } else { + errors.push(`Expected: Report Type breadcrumn label font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //size + if (elementSize === '13px') { + console.log('Passed: Report Type breadcrumn label text font-size matched as expected'); + } else { + errors.push(`Expected: Report Type breadcrumn label text font-size "13px"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Report Type breadcrumn label text color matched as expected'); + } else { + errors.push(`Expected: Report Type breadcrumn label text color: "rgba(48, 200, 172, 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')); + } + } + }, + + //Main Criteria breadcrum + { + description: 'Main Criteria breadcrumn label text, size, and color', + action: async () => { + const multipleChecks = 'Main Criteria breadcrumn label'; + + const element = await driver.findElement(By.css('#crumb-main')); + + //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 === 'Main Criteria') { + console.log('Passed: Main Criteria breadcrumn label text matched as expected'); + } else { + errors.push(`Expected: "Main Criteria"; Actual: "${elementText}"`); + } + + //font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Main Criteria breadcrumn label font-family matched as expected'); + } else { + errors.push(`Expected: Main Criteria breadcrumn label font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //size + if (elementSize === '13px') { + console.log('Passed: Main Criteria breadcrumn label text font-size matched as expected'); + } else { + errors.push(`Expected: Main Criteria breadcrumn label text font-size "13px"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === 'rgba(115, 135, 156, 1)') { + console.log('Passed: Main Criteria breadcrumn label text color matched as expected'); + } else { + errors.push(`Expected: Main Criteria breadcrumn label text color: "rgba(115, 135, 156, 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')); + } + } + }, + + //Subjects breadcrum + { + description: 'Subjects breadcrumn label text, size, and color', + action: async () => { + const multipleChecks = 'Subjects breadcrumn label'; + + const element = await driver.findElement(By.css('#crumb-subjects')); + + //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 === 'Subjects') { + console.log('Passed: Subjects breadcrumn label text matched as expected'); + } else { + errors.push(`Expected: "Subjects"; Actual: "${elementText}"`); + } + + //font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Subjects breadcrumn label font-family matched as expected'); + } else { + errors.push(`Expected: Subjects breadcrumn label font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //size + if (elementSize === '13px') { + console.log('Passed: Subjects breadcrumn label text font-size matched as expected'); + } else { + errors.push(`Expected: Subjects breadcrumn label text font-size "13px"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === 'rgba(115, 135, 156, 1)') { + console.log('Passed: Subjects breadcrumn label text color matched as expected'); + } else { + errors.push(`Expected: Subjects breadcrumn label text color: "rgba(115, 135, 156, 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')); + } + } + }, + + //Grades breadcrum + { + description: 'Grades breadcrumn label text, size, and color', + action: async () => { + const multipleChecks = 'Grades breadcrumn label'; + + const element = await driver.findElement(By.css('#crumb-grades')); + + //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 === 'Grades') { + console.log('Passed: Grades breadcrumn label text matched as expected'); + } else { + errors.push(`Expected: "Grades"; Actual: "${elementText}"`); + } + + //font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Grades breadcrumn label font-family matched as expected'); + } else { + errors.push(`Expected: Grades breadcrumn label font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //size + if (elementSize === '13px') { + console.log('Passed: Grades breadcrumn label text font-size matched as expected'); + } else { + errors.push(`Expected: Grades breadcrumn label text font-size "13px"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === 'rgba(115, 135, 156, 1)') { + console.log('Passed: Grades breadcrumn label text color matched as expected'); + } else { + errors.push(`Expected: Grades breadcrumn label text color: "rgba(115, 135, 156, 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')); + } + } + }, + + //Correlations breadcrum + { + description: 'Correlations breadcrumn label text, size, and color', + action: async () => { + const multipleChecks = 'Correlations breadcrumn label'; + + const element = await driver.findElement(By.css('#crumb-correlation')); + + //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 === 'Correlations') { + console.log('Passed: Correlations breadcrumn label text matched as expected'); + } else { + errors.push(`Expected: "Correlations"; Actual: "${elementText}"`); + } + + //font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Correlations breadcrumn label font-family matched as expected'); + } else { + errors.push(`Expected: Correlations breadcrumn label font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //size + if (elementSize === '13px') { + console.log('Passed: Correlations breadcrumn label text font-size matched as expected'); + } else { + errors.push(`Expected: Correlations breadcrumn label text font-size "13px"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === 'rgba(115, 135, 156, 1)') { + console.log('Passed: Correlations breadcrumn label text color matched as expected'); + } else { + errors.push(`Expected: Correlations breadcrumn label text color: "rgba(115, 135, 156, 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')); + } + } + }, + + //Options breadcrum + { + description: 'Options breadcrumn label text, size, and color', + action: async () => { + const multipleChecks = 'Options breadcrumn label'; + + const element = await driver.findElement(By.css('#crumb-options')); + + //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 === 'Options') { + console.log('Passed: Options breadcrumn label text matched as expected'); + } else { + errors.push(`Expected: "Options"; Actual: "${elementText}"`); + } + + //font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Options breadcrumn label font-family matched as expected'); + } else { + errors.push(`Expected: Options breadcrumn label font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //size + if (elementSize === '13px') { + console.log('Passed: Options breadcrumn label text font-size matched as expected'); + } else { + errors.push(`Expected: Optionss breadcrumn label text font-size "13px"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === 'rgba(115, 135, 156, 1)') { + console.log('Passed: Options breadcrumn label text color matched as expected'); + } else { + errors.push(`Expected: Options breadcrumn label text color: "rgba(115, 135, 156, 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')); + } + } + }, + + //REPORT WIDGET + //Report Type accordian title + { + description: 'Report Type accordian title text, size, color, and background color', + action: async () => { + const multipleChecks = 'Report Type accordian title'; + + const element = await driver.findElement(By.css('#rept-head-label')); + + //Get text, font, size, color, and background color + const elementText = await driver.executeScript( + `return Array.from(arguments[0].childNodes) + .filter(node => node.nodeType === Node.TEXT_NODE) + .map(node => node.textContent) + .join('') + .trim();`, + element + ); + const elementFont = await element.getCssValue('font-family'); + const elementSize = await element.getCssValue('font-size'); + const elementColor = await element.getCssValue('color'); + const elementBgColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //element text + if (elementText === 'Report Type') { + console.log('Passed: Report Type accordian title text matched as expected'); + } else { + errors.push(`Expected: "Report Type"; Actual: "${elementText}"`); + } + + //element font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Report Type accordian title font-family matched as expected'); + } else { + errors.push(`Expected: Report Type accordian title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //element size + if (elementSize === '16px') { + console.log('Passed: Report Type accordian title text font-size matched as expected'); + } else { + errors.push(`Expected: Report Type accordian title text font-size "16px"; Actual: "${elementSize}"`); + } + + //element color + if (elementColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Report Type accordian title text color matched as expected'); + } else { + errors.push(`Expected: Report Type accordian title text color: "rgba(255, 255, 255, 1)"; Actual: "${elementColor}"`); + } + + //element background color + if (elementBgColor === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Report Type accordian title background color matched as expected'); + } else { + errors.push(`Expected: Report Type accordian title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); + } + + //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')); + } + } + }, + + //Premium Options button and icon + { + description: 'Premium Options button text, font, size, color, button color, and icon', + action: async () => { + const multipleChecks = 'Premium Options button'; + + const elementIcon = await driver.findElement(By.css('.fa-usd')); + const element = await driver.findElement(By.linkText('Premium Options')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + const elementTooltipText = await element.getAttribute('title'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Premium Options button icon was displayed as expected'); + } else { + errors.push('Expected: Premium Options button icon was not displayed'); + } + + //text + if (elementText === 'Premium Options') { + console.log('Passed: Premium Options button text matched as expected'); + } else { + errors.push(`Expected: "Premium Options"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Premium Options button text font matched as expected'); + } else { + errors.push(`Expected: Premium Options button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '12px') { + console.log('Passed: Premium Options button text font-size matched as expected'); + } else { + errors.push(`Expected: Premium Options button text font-size "12px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Premium Options button text color matched as expected'); + } else { + errors.push(`Expected: Premium Options button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); + } + + //button color + if (elementButtonColor === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Premium Options button background color matched as expected'); + } else { + errors.push(`Expected: Premium Options button background color: "rgba(40, 39, 90, 1)"; Actual: "${elementButtonColor}"`); + } + + //tool-tip + if (elementTooltipText === 'See premium report options') { + console.log('Passed: Premium Options button tool-tip text matched as expected'); + } else { + errors.push(`Expected: Premium Options tool-tip to be: "See premium report options"; Actual: "${elementTooltipText}"`); + } + + //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')); + } + } + }, + + //Content Reports list - group label and each option + { + description: 'Content Reports list label and options text, size, and color', + action: async () => { + const multipleChecks = 'Content Reports list'; + + const group = '#reporttype optgroup[label="Content Reports"]'; + const expectedItems = [ + { name: 'Content Reports label', selector: group, text: 'Content Reports', font: 'Poppins, sans-serif', size: '13px', color: 'rgba(40, 39, 90, 1)' }, + { name: 'Content Report option', selector: `${group} > option[value="2"]`, text: 'Content Report', font: 'Poppins, sans-serif', size: '13px', color: 'rgba(40, 39, 90, 1)' }, + { name: 'Rethink Content with Rationale option', selector: `${group} > option[value="4"]`, text: 'Rethink Content with Rationale', font: 'Poppins, sans-serif', size: '13px', color: 'rgba(40, 39, 90, 1)' }, + ]; + + //Track all errors + const errors = []; + + for (const expected of expectedItems) { + const element = await driver.findElement(By.css(expected.selector)); + + //Get text, font, size, and color - the group label text lives in its "label" attribute + const elementText = expected.selector === group ? await element.getAttribute('label') : (await element.getText()).trim(); + const elementFont = await element.getCssValue('font-family'); + const elementSize = await element.getCssValue('font-size'); + const elementColor = await element.getCssValue('color'); + + //text + if (elementText === expected.text) { + console.log(`Passed: ${expected.name} text matched as expected`); + } else { + errors.push(`Expected: ${expected.name} text "${expected.text}"; Actual: "${elementText}"`); + } + + //font + if (elementFont === expected.font) { + console.log(`Passed: ${expected.name} font-family matched as expected`); + } else { + errors.push(`Expected: ${expected.name} font-family "${expected.font}"; Actual: ${elementFont}`); + } + + //size + if (elementSize === expected.size) { + console.log(`Passed: ${expected.name} text font-size matched as expected`); + } else { + errors.push(`Expected: ${expected.name} text font-size "${expected.size}"; Actual: "${elementSize}"`); + } + + //color + if (elementColor === expected.color) { + console.log(`Passed: ${expected.name} text color matched as expected`); + } else { + errors.push(`Expected: ${expected.name} text color: "${expected.color}"; 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')); + } + } + }, + + //Main Criteria accordian title + { + description: 'Main Criteria accordian title text, size, color, and background color', + action: async () => { + const multipleChecks = 'Main Criteria accordian title'; + + const element = await driver.findElement(By.css('#main-head-label')); + + //Get text, font, size, color, and background 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'); + const elementBgColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //element text + if (elementText === 'Main Criteria') { + console.log('Passed: Main Criteria accordian title text matched as expected'); + } else { + errors.push(`Expected: "Main Criteria"; Actual: "${elementText}"`); + } + + //element font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Main Criteria accordian title font-family matched as expected'); + } else { + errors.push(`Expected: Main Criteria accordian title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //element size + if (elementSize === '16px') { + console.log('Passed: Main Criteria accordian title text font-size matched as expected'); + } else { + errors.push(`Expected: Main Criteria accordian title text font-size "16px"; Actual: "${elementSize}"`); + } + + //element color + if (elementColor === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Main Criteria accordian title text color matched as expected'); + } else { + errors.push(`Expected: Main Criteria accordian title text color: "rgba(33, 37, 41, 1)"; Actual: "${elementColor}"`); + } + + //element background color + if (elementBgColor === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Main Criteria accordian title background color matched as expected'); + } else { + errors.push(`Expected: Main Criteria accordian title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); + } + + //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')); + } + } + }, + + //Subjects accordian title + { + description: 'Subjects accordian title text, size, color, and background color', + action: async () => { + const multipleChecks = 'Subjects accordian title'; + + const element = await driver.findElement(By.css('#subjects-head-label')); + + //Get text, font, size, color, and background 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'); + const elementBgColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //element text + if (elementText === 'Subjects') { + console.log('Passed: Subjects accordian title text matched as expected'); + } else { + errors.push(`Expected: "Subjects"; Actual: "${elementText}"`); + } + + //element font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Subjects accordian title font-family matched as expected'); + } else { + errors.push(`Expected: Subjects accordian title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //element size + if (elementSize === '16px') { + console.log('Passed: Subjects accordian title text font-size matched as expected'); + } else { + errors.push(`Expected: Subjects accordian title text font-size "16px"; Actual: "${elementSize}"`); + } + + //element color + if (elementColor === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Subjects accordian title text color matched as expected'); + } else { + errors.push(`Expected: Subjects accordian title text color: "rgba(33, 37, 41, 1)"; Actual: "${elementColor}"`); + } + + //element background color + if (elementBgColor === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Subjects accordian title background color matched as expected'); + } else { + errors.push(`Expected: Subjects accordian title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); + } + + //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')); + } + } + }, + + //Grades accordian title + { + description: 'Grades accordian title text, size, color, and background color', + action: async () => { + const multipleChecks = 'Grades accordian title'; + + const element = await driver.findElement(By.css('#grades-head-label')); + + //Get text, font, size, color, and background 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'); + const elementBgColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //element text + if (elementText === 'Grades') { + console.log('Passed: Grades accordian title text matched as expected'); + } else { + errors.push(`Expected: "Grades"; Actual: "${elementText}"`); + } + + //element font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Grades accordian title font-family matched as expected'); + } else { + errors.push(`Expected: Grades accordian title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //element size + if (elementSize === '16px') { + console.log('Passed: Grades accordian title text font-size matched as expected'); + } else { + errors.push(`Expected: Grades accordian title text font-size "16px"; Actual: "${elementSize}"`); + } + + //element color + if (elementColor === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Grades accordian title text color matched as expected'); + } else { + errors.push(`Expected: Grades accordian title text color: "rgba(33, 37, 41, 1)"; Actual: "${elementColor}"`); + } + + //element background color + if (elementBgColor === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Grades accordian title background color matched as expected'); + } else { + errors.push(`Expected: Grades accordian title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); + } + + //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')); + } + } + }, + + //Correlations accordian title + { + description: 'Correlations accordian title text, size, color, and background color', + action: async () => { + const multipleChecks = 'Correlations accordian title'; + + const element = await driver.findElement(By.css('#correlation-head-label')); + + //Get text, font, size, color, and background 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'); + const elementBgColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //element text + if (elementText === 'Correlations') { + console.log('Passed: Correlations accordian title text matched as expected'); + } else { + errors.push(`Expected: "Correlations"; Actual: "${elementText}"`); + } + + //element font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Correlations accordian title font-family matched as expected'); + } else { + errors.push(`Expected: Correlations accordian title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //element size + if (elementSize === '16px') { + console.log('Passed: Correlations accordian title text font-size matched as expected'); + } else { + errors.push(`Expected: Correlations accordian title text font-size "16px"; Actual: "${elementSize}"`); + } + + //element color + if (elementColor === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Correlations accordian title text color matched as expected'); + } else { + errors.push(`Expected: Correlations accordian title text color: "rgba(33, 37, 41, 1)"; Actual: "${elementColor}"`); + } + + //element background color + if (elementBgColor === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Correlations accordian title background color matched as expected'); + } else { + errors.push(`Expected: Correlations accordian title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); + } + + //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')); + } + } + }, + + //Options accordian title + { + description: 'Options accordian title text, size, color, and background color', + action: async () => { + const multipleChecks = 'Options accordian title'; + + const element = await driver.findElement(By.css('#options-head-label')); + + //Get text, font, size, color, and background 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'); + const elementBgColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //element text + if (elementText === 'Options') { + console.log('Passed: Options accordian title text matched as expected'); + } else { + errors.push(`Expected: "Options"; Actual: "${elementText}"`); + } + + //element font + if (elementFont === 'Poppins, sans-serif') { + console.log('Passed: Options accordian title font-family matched as expected'); + } else { + errors.push(`Expected: Options accordian title font-family "Poppins, sans-serif"; Actual: ${elementFont}`); + } + + //element size + if (elementSize === '16px') { + console.log('Passed: Options accordian title text font-size matched as expected'); + } else { + errors.push(`Expected: Options accordian title text font-size "16px"; Actual: "${elementSize}"`); + } + + //element color + if (elementColor === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Options accordian title text color matched as expected'); + } else { + errors.push(`Expected: Options accordian title text color: "rgba(33, 37, 41, 1)"; Actual: "${elementColor}"`); + } + + //element background color + if (elementBgColor === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Options accordian title background color matched as expected'); + } else { + errors.push(`Expected: Options accordian title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`); + } + + //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')); + } + } + }, + + //Run Now button and icon + { + description: 'Run Now button text, font, size, color, button color, and icon', + action: async () => { + const multipleChecks = 'Run Now button'; + + const elementIcon = await driver.findElement(By.css('.fa-download')); + const element = await driver.findElement(By.css('#repsubmit')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + const elementDisable = await element.getAttribute('disabled'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Run Now button icon was displayed as expected'); + } else { + errors.push('Expected: Run Now button icon was not displayed'); + } + + //text + if (elementText === 'Run Now') { + console.log('Passed: Run Now button text matched as expected'); + } else { + errors.push(`Expected: "Run Now"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Run Now button text font matched as expected'); + } else { + errors.push(`Expected: Run Now button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '16px') { + console.log('Passed: Run Now button text font-size matched as expected'); + } else { + errors.push(`Expected: Run Now button text font-size "16px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Run Now button text color matched as expected'); + } else { + errors.push(`Expected: Run Now button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); + } + + //button color + if (elementButtonColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Run Now button background color matched as expected'); + } else { + errors.push(`Expected: Run Now button background color: "rgba(48, 200, 172, 1)"; Actual: "${elementButtonColor}"`); + } + + //tool-tip + if (elementDisable === 'true') { + console.log('Passed: Run Now button disabled as matched as expected'); + } else { + errors.push(`Expected: Run Now disable value to be: "true"; Actual: "${elementDisable}"`); + } + + //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')); + } + } + }, + + //Run In Background button and icon + { + description: 'Run In Background button text, font, size, color, button color, and icon', + action: async () => { + const multipleChecks = 'Run In Background button'; + + const elementIcon = await driver.findElement(By.css('.fa-hourglass')); + const element = await driver.findElement(By.css('#repqsubmit')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + const elementDisable = await element.getAttribute('disabled'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Run In Background button icon was displayed as expected'); + } else { + errors.push('Expected: Run In Background button icon was not displayed'); + } + + //text + if (elementText === 'Run In Background') { + console.log('Passed: Run In Background button text matched as expected'); + } else { + errors.push(`Expected: "Run In Background"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Run In Background button text font matched as expected'); + } else { + errors.push(`Expected: Run In Background button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '16px') { + console.log('Passed: Run In Background button text font-size matched as expected'); + } else { + errors.push(`Expected: Run In Background button text font-size "16px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Run In Background button text color matched as expected'); + } else { + errors.push(`Expected: Run In Background button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); + } + + //button color + if (elementButtonColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Run In Background button background color matched as expected'); + } else { + errors.push(`Expected: Run In Background button background color: "rgba(48, 200, 172, 1)"; Actual: "${elementButtonColor}"`); + } + + //tool-tip + if (elementDisable === 'true') { + console.log('Passed: Run In Background button disabled as matched as expected'); + } else { + errors.push(`Expected: Run In Background disable value to be: "true"; Actual: "${elementDisable}"`); + } + + //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')); + } + } + },