From 35590d07a6e8327cfc2d324b33afba851ec077ce Mon Sep 17 00:00:00 2001 From: jhuerta Date: Mon, 13 Jan 2025 12:38:31 -0800 Subject: [PATCH] Initial AlginContent script checkin --- alignContentPageResults.xlsx | Bin 0 -> 52987 bytes index.js | 2 +- tests/ExACT_alignContentPage.js | 1297 +++++++++++++++++++++++++++++++ 3 files changed, 1298 insertions(+), 1 deletion(-) create mode 100644 alignContentPageResults.xlsx create mode 100644 tests/ExACT_alignContentPage.js diff --git a/alignContentPageResults.xlsx b/alignContentPageResults.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..fa9aae62614b75140222811a647fb665ba1343a5 GIT binary patch literal 52987 zcmeI5U5G46cHeuoV`IiF>t$tF1cIcn%{6jYRn~X4x_jxbyE8lY&a`g#%#KzvNx*QB$Psei4qmn=nZi@oKN(H`@&_TutNIVs*9Gc>nzI z_Nd{dS+JS~QM?NG8h2sZ_~QO&-rRi_MnMLJ()nVYdSGRh?ltCFw%%#A(&;>025B>1 zhb#ExGESC327e}3t#vSc5nP3>PP;v5fd|?~V;|Y{-k$9>lDB7m!#lrQ! zq5C?0NVB^Lu4qX^{k;i6@3o#@T#Kh+7R-Vy&|WO_l){e|3by@I6zuKKe*EH3es*h1 z{Cr*oJ4N~MC=Yg|EfwE8flCz5lHet@o@Jy0a2YIC4Q~}JA%x$P0qUL03%|dc8$XF4 z4pvzz5~fjdCK^wON3;%zRVD1cD|F7lcN*Av?ntJ(<#(c z`C{7aJs$aog-s)qI<##cwfpTJ&TrW7T0V~t4-fm}+!tk3W>SYeEB~lH=pA%Wewj(- z?_2qMhX+ST1C(E8Quzl~{>Q`dpojCzO!H{5dST@j7xeMt+W6-UU?aG!k57mqWCCSUL=b^oFLc<1LG5wG)=7} zaV{^NCW|%nxL;le&?2?|kp0-~HZ4|L%Lg{_EfS=-(<^sNh?{ z>dGwmqu>08|LtFV-TSY<^Dlq&t$)nthptVZ=m)?3jqm^dKjJe&3(^^X_)os`r@#B1 zAO6#S@L>x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R4H6&$(uT;h)==LK+oiT`%}O1$?rjm`1u*o5%@pwQ4L$oL5Li} zQakO>e*EH3es*h1{0Kdw|NHM?8SKy?rUu^svp2r=)i*#{!p~=PX*l|yo;09?k``Tk z^vB=+(KolY#LpK{(O>(kvS``RQllYLD|Aj%8~RtDSTmfoFr8b`g}?IM(uHECg%+kW z1-kGb{XUvEpatn@PZ#|8|6q^(XlbhDb?JZp2S({a+0)`wf$HLa { console.log('Server is running on port 8000'); diff --git a/tests/ExACT_alignContentPage.js b/tests/ExACT_alignContentPage.js new file mode 100644 index 0000000..e8795f2 --- /dev/null +++ b/tests/ExACT_alignContentPage.js @@ -0,0 +1,1297 @@ +import { Builder, By, Key, until } from 'selenium-webdriver'; +import fs from 'fs'; +import XLSX from 'xlsx'; +import path from 'path'; + +const ExACT_alignContentPage = (req, res) => { + res.send('

ExACT Automated Test Script - Align Content Page: Initiated

'); + (async function example() { + let driver = await new Builder().forBrowser('chrome').build(); + let testStatus = 'Failed'; + let workbook; + let worksheet; + const startTime = new Date().toISOString(); + +const steps = [ + { description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php + { description: 'Expand browser', action: async () => await driver.manage().window().maximize() }, + + //LOGIN + { description: 'Enter username', action: async () => await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan') }, + { description: 'Enter password', action: async () => await driver.findElement(By.css('.passfield')).sendKeys('Edgate1!') }, + { description: 'Click Login button', action: async () => await driver.findElement(By.css('.login')).click() }, + { description: 'Wait for login process to complete', action: async () => await driver.sleep(10000) }, + + //Wait for dashboard to load - Correlation Coverages View Details button + { + description: 'Wait for dashboard load to completely', + action: async () => { + return await driver.wait(until.elementLocated(By.linkText('View Details')), 10000).catch(() => false); + } + }, + + //Dashboard title + { + description: 'Validate dashboard title', + action: async () => { + const elementText = await driver.findElement(By.css('.e-heading')).getText(); + if (elementText !== 'Correlation Dashboard') { + throw new Error(`Expected: "Correlation Dashboard"; Actual: "${elementText}"`); + } + console.log('Passed: Dashboard title matched as expected'); + } + }, + + //Align icon color -gray + { + description: 'Validate Align icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.fb-align')).getCssValue('color'); + if (elementStyle !== 'rgba(99, 99, 99, 1)') { + throw new Error(`Align icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Align icon color matched as expected'); + } + }, + + //NEXT ACTION - Navigate to Align page + { description: 'Click Align navigation link', action: async () => await driver.findElement(By.linkText('Align')).click() }, + + //Wait for dashboard to load - Correlation Coverages View Details button + { + description: 'Wait for dashboard load to completely', + action: async () => { + return await driver.wait(until.elementLocated(By.css('h2')), 10000).catch(() => false); + } + }, + + //Browse page title + { + description: 'Validate Browse page title', + action: async () => { + const elementText = await driver.findElement(By.css('h2')).getText(); + if (elementText !== 'Browse') { + throw new Error(`Expected: "Browse"; Actual: "${elementText}"`); + } + console.log('Passed: Browse page title matched as expected'); + } + }, + + //Browse page title text color -dark blue + { + description: 'Validate Browse page title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('h2')).getCssValue('color'); + if (elementStyle !== 'rgba(40, 39, 90, 1)') { + throw new Error(`Browse page title text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Browse page title text color matched as expected'); + } + }, + + //Browse page title text font + { + description: 'Validate Browse page title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('h2')).getCssValue('font-size'); + if (elementStyle !== '32px') { + throw new Error(`Browse page title text font-size did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Browse page title text font-size matched as expected'); + } + }, + + //Content tab label (active) + { + description: 'Validate Content tab label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Content')).getText(); + if (elementText !== 'Content') { + throw new Error(`Expected: "Content"; Actual: "${elementText}"`); + } + console.log('Passed: Content tab label matched as expected'); + } + }, + + //Content tab text color -white (active) + { + description: 'Validate Content tab color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Content')).getCssValue('color'); + if (elementStyle !== 'rgba(255, 255, 255, 1)') { + throw new Error(`Content tab text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Content tab text color matched as expected'); + } + }, + + //Content tab color -dark blue (active) + { + description: 'Validate Content tab color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Content')).getCssValue('background-color'); + if (elementStyle !== 'rgba(40, 39, 90, 1)') { + throw new Error(`Content tab color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Content tab color matched as expected'); + } + }, + + //Standards tab label (dimmed) + { + description: 'Validate Standards tab label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Standards')).getText(); + if (elementText !== 'Standards') { + throw new Error(`Expected: "Standards"; Actual: "${elementText}"`); + } + console.log('Passed: Standards tab label matched as expected'); + } + }, + + //Standards tab text color -gray (dimmed) + { + description: 'Validate Standards tab color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Standards')).getCssValue('color'); + if (elementStyle !== 'rgba(182, 186, 181, 1)') { + throw new Error(`Standards tab text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Standards tab text color matched as expected'); + } + }, + + //Standards tab color -white (dimmed) + { + description: 'Validate Standards tab color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Standards')).getCssValue('background-color'); + if (elementStyle !== 'rgba(0, 0, 0, 0)') { + throw new Error(`Standards tab color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Standards tab color matched as expected'); + } + }, + + //Concepts tab label (dimmed) + { + description: 'Validate Concepts tab label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Concepts')).getText(); + if (elementText !== 'Concepts') { + throw new Error(`Expected: "Concepts"; Actual: "${elementText}"`); + } + console.log('Passed: Concepts tab label matched as expected'); + } + }, + + //Concepts tab text color -white (dimmed) + { + description: 'Validate Concepts tab color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Concepts')).getCssValue('color'); + if (elementStyle !== 'rgba(182, 186, 181, 1)') { + throw new Error(`Concepts tab text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Concepts tab text color matched as expected'); + } + }, + + //Concepts tab color -white (dimmed) + { + description: 'Validate Concepts tab color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Concepts')).getCssValue('background-color'); + if (elementStyle !== 'rgba(0, 0, 0, 0)') { + throw new Error(`Concepts tab color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Concepts tab color matched as expected'); + } + }, + + //Available Content header + { + description: 'Validate Available Content header', + action: async () => { + const elementText = await driver.findElement(By.css('#content form > p')).getText(); + if (elementText !== 'Available Content') { + throw new Error(`Expected: "Available Content"; Actual: "${elementText}"`); + } + console.log('Passed: Available Content header matched as expected'); + } + }, + + //Available Content 1 + { + description: 'Validate Available Content 1 label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Demo - User Submitted Content')).getText(); + if (elementText !== 'Demo - User Submitted Content') { + throw new Error(`Expected: "Demo - User Submitted Content"; Actual: "${elementText}"`); + } + console.log('Passed: Demo - User Submitted Content label matched as expected'); + } + }, + + //Available Content 2 + { + description: 'Validate Available Content 2 label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Upload Demo')).getText(); + if (elementText !== 'Upload Demo') { + throw new Error(`Expected: "Upload Demo"; Actual: "${elementText}"`); + } + console.log('Passed: Upload Demo label matched as expected'); + } + }, + + //Available Content 3 + { + description: 'Validate Available Content 3 label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Exploring - Access')).getText(); + if (elementText !== 'Exploring - Access') { + throw new Error(`Expected: "Exploring - Access"; Actual: "${elementText}"`); + } + console.log('Passed: Exploring - Access label matched as expected'); + } + }, + + //Available Content 4 + { + description: 'Validate Available Content 4 label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Exploring - PowerPoint')).getText(); + if (elementText !== 'Exploring - PowerPoint') { + throw new Error(`Expected: "Exploring - PowerPoint"; Actual: "${elementText}"`); + } + console.log('Passed: Exploring - PowerPoint label matched as expected'); + } + }, + + //Available Content 5 + { + description: 'Validate Available Content 5 label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Exploring - Word')).getText(); + if (elementText !== 'Exploring - Word') { + throw new Error(`Expected: "Exploring - Word"; Actual: "${elementText}"`); + } + console.log('Passed: Exploring - Word label matched as expected'); + } + }, + + //Available Content - Advanced Options + { + description: 'Validate Available Content - Advance Options label', + action: async () => { + const elementText = await driver.findElement(By.linkText('Advanced Options')).getText(); + if (elementText !== 'Advanced Options') { + throw new Error(`Expected: "Advanced Options"; Actual: "${elementText}"`); + } + console.log('Passed: Advanced Options label matched as expected'); + } + }, + + //Advanced Options text color -green + { + description: 'Validate Advanced Options text color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Advanced Options')).getCssValue('color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Advanced Options text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Advanced Options text color matched as expected'); + } + }, + + //NEXT ACTION - Click Advanced Options link + { description: 'Click Advanced Options link', action: async () => await driver.findElement(By.linkText('Advanced Options')).click() }, + + //Wait for dashboard to load - Correlation Coverages View Details button + { + description: 'Wait for dashboard load to completely', + action: async () => { + return await driver.wait(until.elementLocated(By.css('#searchbox-content > p')), 10000).catch(() => false); + } + }, + + //Apply filters to results: + { + description: 'Validate Apply filters to results label', + action: async () => { + const elementText = await driver.findElement(By.css('#searchbox-content > p')).getText(); + if (elementText !== 'Apply filters to results:') { + throw new Error(`Expected: "Apply filters to results:"; Actual: "${elementText}"`); + } + console.log('Passed: Apply filters to results: label matched as expected'); + } + }, + + //Grade: + { + description: 'Validate Grade label', + action: async () => { + const elementText = await driver.findElement(By.css('.list-group:nth-child(2) > .list-group-item:nth-child(1)')).getText(); + if (elementText !== 'Grade:') { + throw new Error(`Expected: "Grade:"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: label matched as expected'); + } + }, + + //Subject: + { + description: 'Validate Subject label', + action: async () => { + const elementText = await driver.findElement(By.css('.list-group:nth-child(2) > .list-group-item:nth-child(2)')).getText(); + if (elementText !== 'Subject:') { + throw new Error(`Expected: "Subject:"; Actual: "${elementText}"`); + } + console.log('Passed: Subject: label matched as expected'); + } + }, + + //Alignment Status: + { + description: 'Validate Alignment Status label', + action: async () => { + const elementText = await driver.findElement(By.css('.list-group:nth-child(2) > .list-group-item:nth-child(3)')).getText(); + if (elementText !== 'Alignment Status:') { + throw new Error(`Expected: "Alignment Status:"; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status: label matched as expected'); + } + }, + + //NEXT ACTION - Click Grade dropdown + { description: 'Click Grade dropdown', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(1) .multiselect')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Maginfying glass icon + { + description: 'Verify magnifying glass icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .multiselect-item .input-group-prepend img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Magnifying glass icon not found'); + } + console.log('Passed: Magnifying glass arrow icon present'); + } + }, + + //Search dropdown placeholder + { + description: 'Validate Search dropdown placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('.show > .multiselect-item .form-control')).getAttribute('placeholder'); + if (elementValue !== 'Search') { + throw new Error(`Expected: "Search" placeholder text; Actual: "${elementValue}"`); + } + console.log('Passed: "Search" placeholder text, matched as expected'); + } + }, + + //Seach X icon + { + description: 'Verify Grade, Search X icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(1) .input-group-append img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade, Search X icon not found'); + } + console.log('Passed: Grade, Search X icon present'); + } + }, + + //Grade: Select all checkbox + { + description: 'Verify Select all checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .multiselect-item > .multiselect-all input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Select all checkbox not found'); + } + console.log('Passed: Select all checkbox present'); + } + }, + + //Grade: Select all label + { + description: 'Validate Grade, Select all label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > .multiselect-item .checkbox')).getText(); + if (elementText !== 'Select all') { + throw new Error(`Expected: "Select all" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Select all checkbox label matched as expected'); + } + }, + + //Grade: 9 checkbox + { + description: 'Verify Grade 9 checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(3) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 9 checkbox not found'); + } + console.log('Passed: Grade: 9 checkbox present'); + } + }, + + //Grade: 9 (2424) label + { + description: 'Validate Grade 9 (2424) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText(); + if (elementText !== '9 (2424)') { + throw new Error(`Expected: Grade: "9 (2424)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Grade 9 (2424) checkbox label matched as expected'); + } + }, + + //Grade: 10 checkbox + { + description: 'Verify Grade 10 checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(4) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 10 checkbox not found'); + } + console.log('Passed: Grade: 10 checkbox present'); + } + }, + + //Grade: 10 (2384) label + { + description: 'Validate Grade 10 (2384) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(4) .checkbox')).getText(); + if (elementText !== '10 (2384)') { + throw new Error(`Expected: Grade: "10 (2384)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Grade 10 (2384) checkbox label matched as expected'); + } + }, + + //Grade: 12 checkbox + { + description: 'Verify Grade 12 checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(5) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 12 checkbox not found'); + } + console.log('Passed: Grade: 12 checkbox present'); + } + }, + + //Grade: 12 (2282) label + { + description: 'Validate Grade 12 (2282) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText(); + if (elementText !== '12 (2282)') { + throw new Error(`Expected: Grade: "12 (2282)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Grade 12 (2282) checkbox label matched as expected'); + } + }, + + //Grade: 11 checkbox + { + description: 'Verify Grade 11 checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(6) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 11 checkbox not found'); + } + console.log('Passed: Grade: 11 checkbox present'); + } + }, + + //Grade: 11 (2208) label + { + description: 'Validate Grade 11 (2208) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText(); + if (elementText !== '11 (2208)') { + throw new Error(`Expected: Grade: "11 (2208)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Grade 11 (2208) checkbox label matched as expected'); + } + }, + + //NEXT ACTION - Select grade 8 + { description: 'Select grade 8', action: async () => await driver.findElement(By.css('.show > li:nth-child(10) input')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(1000) }, + //NEXT ACTION - CLick subject dropdown + { description: 'Click Subject dropdown', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) .multiselect-selected-text')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Maginfying glass icon + { + description: 'Verify magnifying glass icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .multiselect-item .input-group-prepend img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Magnifying glass icon not found'); + } + console.log('Passed: Magnifying glass arrow icon present'); + } + }, + + //Search dropdown placeholder + { + description: 'Validate Search dropdown placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('.show > .multiselect-item .form-control')).getAttribute('placeholder'); + if (elementValue !== 'Search') { + throw new Error(`Expected: "Search" placeholder text; Actual: "${elementValue}"`); + } + console.log('Passed: "Search" placeholder text, matched as expected'); + } + }, + + //Seach X icon + { + description: 'Verify Search X icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(1) .input-group-append img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Search X icon not found'); + } + console.log('Passed: Search X icon present'); + } + }, + + //Select all checkbox + { + description: 'Verify Select all checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .multiselect-item > .multiselect-all input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Select all checkbox not found'); + } + console.log('Passed: Select all checkbox present'); + } + }, + + //Select all label + { + description: 'Validate Grade, Select all label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > .multiselect-item .checkbox')).getText(); + if (elementText !== 'Select all') { + throw new Error(`Expected: "Select all" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Select all checkbox label matched as expected'); + } + }, + + //Subject: Mathematics checkbox + { + description: 'Verify Subject Mathematics checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(3) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Mathematics checkbox not found'); + } + console.log('Passed: Subject: Mathematics checkbox present'); + } + }, + + //Subject: Mathematics (2011) label + { + description: 'Validate Subject Mathematics (2011) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText(); + if (elementText !== 'Mathematics (2011)') { + throw new Error(`Expected: Subject: "Mathematics (2011)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Subject: Mathematics (2011) checkbox label matched as expected'); + } + }, + + //Subject: Science checkbox + { + description: 'Verify Subject Science checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(4) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Science checkbox not found'); + } + console.log('Passed: Subject: Science checkbox present'); + } + }, + + //Subject: Science (1064) label + { + description: 'Validate Subject Science (1064) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(4) .checkbox')).getText(); + if (elementText !== 'Science (1064)') { + throw new Error(`Expected: Subject: "Science (2384)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Subject Science (1064) checkbox label matched as expected'); + } + }, + + //Subject: Language Arts checkbox + { + description: 'Verify Subject Language Arts checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(5) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Language Arts checkbox not found'); + } + console.log('Passed: Subject: Language Arts checkbox present'); + } + }, + + //Subject: Language Arts (414) label + { + description: 'Validate Subject Language Arts (414) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText(); + if (elementText !== 'Language Arts (414)') { + throw new Error(`Expected: Subject: "Language Arts (414)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Subject Language Arts (414) checkbox label matched as expected'); + } + }, + + //Subject: Social Studies checkbox + { + description: 'Verify Subject Social Studies checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(6) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Social Studies checkbox not found'); + } + console.log('Passed: Subject: Social Studies checkbox present'); + } + }, + + //Subject: Social Studies (75) label + { + description: 'Validate Subject Social Studies (75) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText(); + if (elementText !== 'Social Studies (75)') { + throw new Error(`Expected: Subject: "Social Studies (75)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Subject Social Studies (75) checkbox label matched as expected'); + } + }, + + //NEXT ACTION - Select subject Mathematics and Language Arts + { description: 'Select subject Mathematics', action: async () => await driver.findElement(By.css('.show > li:nth-child(4) input')).click() }, + { description: 'Select subject Language Arts', action: async () => await driver.findElement(By.css('.show > li:nth-child(6) input')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(1000) }, + //NEXT ACTION - CLick alignment status dropdown + { description: 'Click Alignment Status dropdown', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(3) .multiselect-selected-text')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Maginfying glass icon + { + description: 'Verify magnifying glass icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .multiselect-item .input-group-prepend img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Magnifying glass icon not found'); + } + console.log('Passed: Magnifying glass arrow icon present'); + } + }, + + //Search dropdown placeholder + { + description: 'Validate Search dropdown placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('.show > .multiselect-item .form-control')).getAttribute('placeholder'); + if (elementValue !== 'Search') { + throw new Error(`Expected: "Search" placeholder text; Actual: "${elementValue}"`); + } + console.log('Passed: "Search" placeholder text, matched as expected'); + } + }, + + //Seach X icon + { + description: 'Verify Search X icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(1) .input-group-append img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Search X icon not found'); + } + console.log('Passed: Search X icon present'); + } + }, + + //Select all checkbox + { + description: 'Verify Select all checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .multiselect-item > .multiselect-all input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Select all checkbox not found'); + } + console.log('Passed: Select all checkbox present'); + } + }, + + //Select all label + { + description: 'Validate Select all label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > .multiselect-item .checkbox')).getText(); + if (elementText !== 'Select all') { + throw new Error(`Expected: "Select all" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Select all checkbox label matched as expected'); + } + }, + + //Alignment Status: Not Aligned checkbox + { + description: 'Verify Alignment Status Not Aligned checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(3) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Alignment Status: Not Aligned checkbox not found'); + } + console.log('Passed: Alignment Status: Not Aligned checkbox present'); + } + }, + + //Alignment Status:Not Aligned (3259) label + { + description: 'Validate Alignment Status Not Aligned (3259) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(3) .checkbox')).getText(); + if (elementText !== 'Not Aligned (3259)') { + throw new Error(`Expected: Alignment Status: "Not Aligned (3259)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status: Not Aligned (3259) checkbox label matched as expected'); + } + }, + + //Alignment Status: ECS Alignment checkbox + { + description: 'Verify Alignment Status ECS Alignment checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(4) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Alignment Status: ECS Alignment checkbox not found'); + } + console.log('Passed: Alignment Status: ECS Alignment checkbox present'); + } + }, + + //Alignment Status: ECS Alignment (244) label + { + description: 'Validate Alignment Status ECS Alignment (244) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(4) .checkbox')).getText(); + if (elementText !== 'ECS Alignment (244)') { + throw new Error(`Expected: Alignment Status: "ECS Alignment (244)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status ECS Alignment (244) checkbox label matched as expected'); + } + }, + + //Alignment Status: Pending checkbox + { + description: 'Verify Alignment Status Pending checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(5) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Alignment Status: Pending checkbox not found'); + } + console.log('Passed: Alignment Status: Pending checkbox present'); + } + }, + + //Alignment Status: Pending (17) label + { + description: 'Validate Alignment Status Pending (17) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(5) .checkbox')).getText(); + if (elementText !== 'Pending (17)') { + throw new Error(`Expected: Alignment Status: "Pending (17)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status Pending (17) checkbox label matched as expected'); + } + }, + + //Alignment Status: Aligned checkbox + { + description: 'Verify Alignment Status Aligned checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(6) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Alignment Status: Aligned checkbox not found'); + } + console.log('Passed: Alignment Status: Aligned checkbox present'); + } + }, + + //Alignment Status: Aligned (6) label + { + description: 'Validate Alignment Status Aligned (6) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(6) .checkbox')).getText(); + if (elementText !== 'Aligned (6)') { + throw new Error(`Expected: Alignment Status: "Aligned (6)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status Aligned (6) checkbox label matched as expected'); + } + }, + + //Alignment Status: Needs Review checkbox + { + description: 'Verify Alignment Status Needs Review checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(7) input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Alignment Status: Needs Review checkbox not found'); + } + console.log('Passed: Alignment Status: Needs Review checkbox present'); + } + }, + + //Alignment Status: Needs Review (1) label + { + description: 'Validate Alignment Status Needs Review (1) label', + action: async () => { + const elementText = await driver.findElement(By.css('.show > li:nth-child(7) .checkbox')).getText(); + if (elementText !== 'Needs Review (1)') { + throw new Error(`Expected: Alignment Status: "Needs Review (1)" checkbox label; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status Needs Review (1) checkbox label matched as expected'); + } + }, + + //NEXT ACTION - Select alignment status Pending and Aligned then click main page to close DIV + { description: 'Select alignment status Pending', action: async () => await driver.findElement(By.css('.show > li:nth-child(5) input')).click() }, + { description: 'Select alignment status Aligned', action: async () => await driver.findElement(By.css('.show > li:nth-child(6) input')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(1000) }, + { description: 'Click main window to close DIV', action: async () => await driver.findElement(By.css('#content form')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(1000) }, + + //VERIFY SELECTIONS + //Grade: + { + description: 'Validate Grade label', + action: async () => { + const elementText = await driver.findElement(By.css('.list-group:nth-child(2) > .list-group-item:nth-child(1)')).getText(); + if (elementText !== 'Grade:') { + throw new Error(`Expected: "Grade:"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: label matched as expected'); + } + }, + + //Subject: + { + description: 'Validate Subject label', + action: async () => { + const elementText = await driver.findElement(By.css('.list-group:nth-child(2) > .list-group-item:nth-child(2)')).getText(); + if (elementText !== 'Subject:') { + throw new Error(`Expected: "Subject:"; Actual: "${elementText}"`); + } + console.log('Passed: Subject: label matched as expected'); + } + }, + + //Alignment Status: + { + description: 'Validate Alignment Status label', + action: async () => { + const elementText = await driver.findElement(By.css('.list-group:nth-child(2) > .list-group-item:nth-child(3)')).getText(); + if (elementText !== 'Alignment Status:') { + throw new Error(`Expected: "Alignment Status:"; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status: label matched as expected'); + } + }, + + //NEXT ACTION - Navigate to Align page + { description: 'Click Biology - QA link', action: async () => await driver.findElement(By.linkText('Biology - QA')).click() }, + + //Wait page to load + { + description: 'Wait for page to load', + action: async () => { + return await driver.wait(until.elementLocated(By.css('.well > b')), 10000).catch(() => false); + } + }, + + //FILTERS + //Filter Results title + { + description: 'Validate Filter Results title', + action: async () => { + const elementText = await driver.findElement(By.css('.well > b')).getText(); + if (elementText !== 'Filter Results') { + throw new Error(`Expected: "Filter Results"; Actual: "${elementText}"`); + } + console.log('Passed: Filter Results title matched as expected'); + } + }, + + //Content Set title + { + description: 'Validate Content Set title', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getText(); + if (elementText !== 'Content Set') { + throw new Error(`Expected: "Content Set"; Actual: "${elementText}"`); + } + console.log('Passed: Content Set title matched as expected'); + } + }, + + //Biology - QA checkbox + { + description: 'Verify Biology - QA checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaorgobjectid873576067')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Biology - QA checkbox icon not found'); + } + console.log('Passed: Biology - QA checkbox icon present'); + } + }, + + //Biology - QA count + { + description: 'Validate Biology - QA count', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText(); + if (elementText !== 'Biology - QA (2)') { + throw new Error(`Expected: "Biology - QA (2)"; Actual: "${elementText}"`); + } + console.log('Passed: Biology - QA (2) label matched as expected'); + } + }, + + //Grade title + { + description: 'Validate Grade title', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getText(); + if (elementText !== 'Grade') { + throw new Error(`Expected: "Grade"; Actual: "${elementText}"`); + } + console.log('Passed: Grade title matched as expected'); + } + }, + + //Grade: Clear link text + { + description: 'Validate Grade: Clear link text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Clear')).getText(); + if (elementText !== 'Clear') { + throw new Error(`Expected: Grade: "Clear"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: Clear link text matched as expected'); + } + }, + + //Grade: See All link text + { + description: 'Validate Grade: See All link text', + action: async () => { + const elementText = await driver.findElement(By.linkText('See All>>')).getText(); + if (elementText !== 'See All>>') { + throw new Error(`Expected: Grade: "See All>>"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: See All>> link text matched as expected'); + } + }, + + //Grade: 6 checkbox + { + description: 'Verify Grade: 6 checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades45')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 6 checkbox icon not found'); + } + console.log('Passed: Grade: 6 checkbox icon present'); + } + }, + + //Grade: 6 count + { + description: 'Validate Grade: 6 count', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(6)')).getText(); + if (elementText !== '6') { + throw new Error(`Expected: Grade: "6"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: 6 label matched as expected'); + } + }, + + //Grade: 7 checkbox + { + description: 'Verify Grade: 7 checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades47')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 7 checkbox icon not found'); + } + console.log('Passed: Grade: 7 checkbox icon present'); + } + }, + + //Grade: 7 count + { + description: 'Validate Grade: 7 count', + action: async () => { + const elementText = await driver.findElement(By.css('label:nth-child(9)')).getText(); + if (elementText !== '7') { + throw new Error(`Expected: Grade: "7"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: 7 label matched as expected'); + } + }, + + //Grade: 8 checkbox + { + description: 'Verify Grade: 8 checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades48')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 8 checkbox icon not found'); + } + console.log('Passed: Grade: 8 checkbox icon present'); + } + }, + + //Grade: 8 count + { + description: 'Validate Grade: 8 count', + action: async () => { + const elementText = await driver.findElement(By.css('label:nth-child(12)')).getText(); + if (elementText !== '8') { + throw new Error(`Expected: Grade: "8"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: 8 label matched as expected'); + } + }, + + //Grade: 9 checkbox + { + description: 'Verify Grade: 9 checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades49')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 9 checkbox icon not found'); + } + console.log('Passed: Grade: 9 checkbox icon present'); + } + }, + + //Grade: 9 count + { + description: 'Validate Grade: 9 count', + action: async () => { + const elementText = await driver.findElement(By.css('label:nth-child(15)')).getText(); + if (elementText !== '9') { + throw new Error(`Expected: Grade: "9"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: 9 label matched as expected'); + } + }, + + //Grade: 10 checkbox + { + description: 'Verify Grade: 10 checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades51')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Grade: 10 checkbox icon not found'); + } + console.log('Passed: Grade: 10 checkbox icon present'); + } + }, + + //Grade: 10 count + { + description: 'Validate Grade: 10 count', + action: async () => { + const elementText = await driver.findElement(By.css('label:nth-child(18)')).getText(); + if (elementText !== '10') { + throw new Error(`Expected: Grade: "10"; Actual: "${elementText}"`); + } + console.log('Passed: Grade: 10 label matched as expected'); + } + }, + + //More link + { + description: 'Validate More link', + action: async () => { + const elementText = await driver.findElement(By.linkText('More>>')).getText(); + if (elementText !== 'More>>') { + throw new Error(`Expected: "More>>"; Actual: "${elementText}"`); + } + console.log('Passed: More>> link matched as expected'); + } + }, + + //Subject title + { + description: 'Validate Subject title', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getText(); + if (elementText !== 'Subject') { + throw new Error(`Expected: "Subject"; Actual: "${elementText}"`); + } + console.log('Passed: Subject title matched as expected'); + } + }, + + //Subject: Clear link text + { + description: 'Validate Subject: Clear link text', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > small > a')).getText(); + if (elementText !== 'Clear') { + throw new Error(`Expected: Subject: "Clear"; Actual: "${elementText}"`); + } + console.log('Passed: Subject: Clear link text matched as expected'); + } + }, + + //Subject: See All link text + { + description: 'Validate Subject: See All link text', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) .modalink')).getText(); + if (elementText !== 'See All>>') { + throw new Error(`Expected: Subject: "See All>>"; Actual: "${elementText}"`); + } + console.log('Passed: Subject: See All>> link text matched as expected'); + } + }, + + //Subject: Science checkbox + { + description: 'Verify Subject: Science checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsScience')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Science checkbox icon not found'); + } + console.log('Passed: Subject: Science checkbox icon present'); + } + }, + + //Subject: Science count + { + description: 'Validate Subject: Science count', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText(); + if (elementText !== 'Science (2)') { + throw new Error(`Expected: "Subject: Science (2)"; Actual: "${elementText}"`); + } + console.log('Passed: Subject: Science (2) label matched as expected'); + } + }, + +]; + +const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => { + const json_data = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); + json_data.push([stepIndex, stepDescription, status, timestamp, screenshotPath]); + return XLSX.utils.aoa_to_sheet(json_data); +}; + +const takeScreenshot = async (driver, stepIndex, stepDescription) => { + const screenshot = await driver.takeScreenshot(); + + const dir = path.join('screenshots', 'alignContentPage'); + + const screenshotFileName = `step_${stepIndex}_${stepDescription.replace(/\s+/g, '_')}.png`; + const screenshotPath = path.join(dir, screenshotFileName); + fs.writeFileSync(screenshotPath, screenshot, 'base64'); + return screenshotPath; +}; + +const clearOldResults = () => { + // Remove old screenshots + const screenshotDir = path.join('screenshots', 'alignContentPage'); + if (fs.existsSync(screenshotDir)) { + fs.rmSync(screenshotDir, { recursive: true, force: true }); + } + fs.mkdirSync(screenshotDir, { recursive: true }); + + // Remove old Excel file + if (fs.existsSync('alignContentPageResults.xlsx')) { + fs.unlinkSync('alignContentPageResults.xlsx'); + } +}; + +try { + // Initialize workbook and worksheet + clearOldResults(); + + // Initialize workbook and worksheet + workbook = XLSX.utils.book_new(); + worksheet = XLSX.utils.aoa_to_sheet([ + ['Step Number', 'Step Description', 'Status', 'Timestamp', 'Screenshot'] + ]); + XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1'); + + // Log test start time + worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, ''); + + for (const step of steps) { + const stepIndex = steps.indexOf(step) + 1; + const timestamp = new Date().toISOString(); + + try { + await step.action(); + const screenshotPath = await takeScreenshot(driver, stepIndex, step.description); + worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath); + } catch (error) { + const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`); + worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath); + console.error(`Step ${stepIndex} FAILED: ${error.message}`); + testStatus = 'Failed'; + } + } + + //Check if login was successful + const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false); + + if (usernameValidation) { + console.log('PASSED: System logged in as expected'); + testStatus = 'Passed'; + } else { + console.log('FAILED: Unable to log in'); + testStatus = 'Failed'; + } + + // Log test end time + const endTime = new Date().toISOString(); + worksheet = logStep(worksheet, 'Test End', testStatus, '', endTime, ''); + + // Write the updated worksheet back to the workbook and save it + workbook.Sheets['Sheet1'] = worksheet; + XLSX.writeFile(workbook, 'alignContentPageResults.xlsx'); +} finally { + await driver.quit(); +} +})(); +} + +export default ExACT_alignContentPage;