From a6fcb195bce67943b659b3041622beb54929d41f Mon Sep 17 00:00:00 2001 From: jhuerta Date: Thu, 22 Oct 2026 17:16:33 -0700 Subject: [PATCH] Renamed file --- tests/ExACT_alignStandardsPage.js | 5537 ----------------------------- 1 file changed, 5537 deletions(-) delete mode 100644 tests/ExACT_alignStandardsPage.js diff --git a/tests/ExACT_alignStandardsPage.js b/tests/ExACT_alignStandardsPage.js deleted file mode 100644 index 8a6c87f..0000000 --- a/tests/ExACT_alignStandardsPage.js +++ /dev/null @@ -1,5537 +0,0 @@ -import { Builder, By, Key, until } from 'selenium-webdriver'; -import fs from 'fs'; -import XLSX from 'xlsx'; -import path from 'path'; - -const ExACT_alignStandardsPage = (req, res) => { - res.send('

ExACT Automated Test Script - Align Standards Page(ExACT_alignStandardsPage): 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 page to load - { - description: 'Wait for page to load', - 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'); - } - }, - - //NEXT ACTION - Navigate to Align Standards - { description: 'Click Standards tab', action: async () => await driver.findElement(By.linkText('Standards')).click() }, - - //Wait for page to load - { - description: 'Wait for page to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('#std p')), 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 (dimmed) - { - 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 -gray (dimmed) - { - description: 'Validate Content tab color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('Content')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 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 -white (dimmed) - { - description: 'Validate Content tab color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('Content')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Content tab color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Content tab color matched as expected'); - } - }, - - //Standards tab label (active) - { - 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 -white (active) - { - description: 'Validate Standards tab color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('Standards')).getCssValue('color'); - if (elementStyle !== 'rgba(255, 255, 255, 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 -navy blue (active) - { - description: 'Validate Standards tab color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('Standards')).getCssValue('background-color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - 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'); - } - }, - - //Browse standards header - { - description: 'Validate Browse standards header', - action: async () => { - const elementText = await driver.findElement(By.css('#std p')).getText(); - if (elementText !== 'Browse standards') { - throw new Error(`Expected: "Browse standards"; Actual: "${elementText}"`); - } - console.log('Passed: Browse standards header matched as expected'); - } - }, - - //Standards label - { - description: 'Validate Standards label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(4) > .col-sm-2')).getText(); - if (elementText !== 'Standards') { - throw new Error(`Expected: "Standards"; Actual: "${elementText}"`); - } - console.log('Passed: Standards label matched as expected'); - } - }, - - //Select standards dropdown value - { - description: 'Validate Standards dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#stdselect')).getAttribute('value'); - if (elementText !== 'none') { - throw new Error(`Expected: Standards dropdown value, none = "Select standards" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Standards dropdown value, Select standards matched as expected'); - } - }, - - //Standards Display label - { - description: 'Validate Standards Display label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(5) > .col-sm-2')).getText(); - if (elementText !== 'Standards Display') { - throw new Error(`Expected: "Standards Display"; Actual: "${elementText}"`); - } - console.log('Passed: Standards Display label matched as expected'); - } - }, - - //All radio option - { - description: 'Verify All radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#gap1')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('All radio option not found'); - } - console.log('Passed: All radio option present'); - } - }, - - //All radio option -active - { - description: 'Validate All radio option enabled', - action: async () => { - const elementStyle = await driver.findElement(By.css('#gap1')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`All radio option value checked did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: All radio option value matched as expected'); - } - }, - - //All radio option handle - { - description: 'Validate All radio option handle', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(1) > .form-check-label')).getText(); - if (elementText !== 'All') { - throw new Error(`Expected: "All" radio option handle; Actual: "${elementText}"`); - } - console.log('Passed: All radion optio handle matched as expected'); - } - }, - - //Correlated Only radio option - { - description: 'Verify Correlated Only radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#gap2')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Correlated Only radio option not found'); - } - console.log('Passed: Correlated Only radio option present'); - } - }, - - //Correlated Only radio option handle - { - description: 'Validate Correlated Only radio option handle', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(2) > .form-check-label')).getText(); - if (elementText !== 'Correlated Only') { - throw new Error(`Expected: "Correlated Only" radio option handle; Actual: "${elementText}"`); - } - console.log('Passed: Correlated Only radio option handle matched as expected'); - } - }, - - //Uncorrelated Only radio option - { - description: 'Verify Uncorrelated Only radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#gap3')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Uncorrelated Only radio option not found'); - } - console.log('Passed: Uncorrelated Only radio option present'); - } - }, - - //Uncorrelated Only radio option handle - { - description: 'Validate Uncorrelated Only radio option handle', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(3) > .form-check-label')).getText(); - if (elementText !== 'Uncorrelated Only') { - throw new Error(`Expected: "Uncorrelated Only" radio option handle; Actual: "${elementText}"`); - } - console.log('Passed: Uncorrelated Only radio option handle matched as expected'); - } - }, - - //Show Correlations From label - { - description: 'Validate Show Correlations From label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > .col-sm-2')).getText(); - if (elementText !== 'Show Correlations From') { - throw new Error(`Expected: "Show Correlations From"; Actual: "${elementText}"`); - } - console.log('Passed: Show Correlations From label matched as expected'); - } - }, - - //Show Correlations From dropdown value - { - description: 'Validate Show Correlations From dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('.col-sm-10 .multiselect-selected-text')).getText(); - if (elementText !== 'All Content Sets') { - throw new Error(`Expected: "All Content Sets" dropdown value did not match; Actual: "${elementText}"`); - } - console.log('Passed: All Content Sets dropdown value matched as expected'); - } - }, - - //Term Search label - { - description: 'Validate Term Search label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(12) > .col-sm-2')).getText(); - if (elementText !== 'Term Search') { - throw new Error(`Expected: "Term Search"; Actual: "${elementText}"`); - } - console.log('Passed: Term Search label matched as expected'); - } - }, - - //Term Search dropdown value - { - description: 'Validate Term Search dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#searchTerm')).getAttribute('value'); - if (elementText !== '') { - throw new Error(`Expected: Term Search dropdown placeholder, "empty" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Term Search dropdown placeholder matched as expected'); - } - }, - - //Include Related Standards checkbox - { - description: 'Verify Include Related Standards checkbox is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#gap3')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Include Related Standards checkbox not found'); - } - console.log('Passed: Include Related Standards checkbox present'); - } - }, - - //Include Related Standards label - { - description: 'Validate Include Related Standards label', - action: async () => { - const elementText = await driver.findElement(By.css('.col-sm-offset-2 > label')).getText(); - if (elementText !== 'Include Related Standards') { - throw new Error(`Expected: "Include Related Standards"; Actual: "${elementText}"`); - } - console.log('Passed: Include Related Standards label matched as expected'); - } - }, - - //Search button text - { - description: 'Validate Search button text', - action: async () => { - const elementText = await driver.findElement(By.css('#stdsubmit')).getAttribute('value'); - if (elementText !== 'Search') { - throw new Error(`Expected: "Search" button text did not match; Actual: "${elementText}"`); - } - console.log('Passed: Search button text matched as expected'); - } - }, - - //Search button color -green - { - description: 'Validate Search button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#stdsubmit')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Search button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Search button color matched as expected'); - } - }, - - //NEXT ACTION -Validation 1 (no inputs) - { - description: 'Click search button without inputs and validate assert message', - action: async () => { - const searchButton = await driver.wait( - until.elementLocated(By.css('#stdsubmit')), - 5000 - ); - await searchButton.click(); - await driver.sleep(2000); - - const alert = await driver.wait( - until.alertIsPresent(), - 5000 - ); - - const alertText = await alert.getText(); - - try { - if (alertText !== 'You must select a set of standards') { - throw new Error(`Expected: "You must select a set of standards"; Actual: "${alertText}"`); - } - console.log('Passed: "You must select a set of standards" Alert DIV text matched as expected'); - console.log('Passed: "OK" button text matched as expected'); - } catch (error) { - console.error('FAILED: Alert DIV, unable to validate text; Error Message: ', error.message); - await alert.dismiss(); - throw error; - } - - await alert.accept(); - await driver.sleep(2000); - } - }, - - //NEXT ACTION - Select standard - { description: 'Select Standard - Common Core State Standards', action: async () => await driver.findElement(By.css('#stdselect > optgroup:nth-child(3) > option')).click() }, - - //Wait for Subject dropdown to load - { - description: 'Wait for subject dropdown to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.hideSubject > .col-sm-2')), 10000).catch(() => false); - } - }, - - //Select standards dropdown value - { - description: 'Validate Standards dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#stdselect')).getAttribute('value'); - if (elementText !== '392236052') { - throw new Error(`Expected: Standards dropdown value, "Common Core State Standards" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Standards dropdown value, Common Core State Standards matched as expected'); - } - }, - - //Subject label - { - description: 'Validate Subject label', - action: async () => { - const elementText = await driver.findElement(By.css('.hideSubject > .col-sm-2')).getText(); - if (elementText !== 'Subject') { - throw new Error(`Expected: "Subject"; Actual: "${elementText}"`); - } - console.log('Passed: Subject label matched as expected'); - } - }, - - //Subject dropdown value - { - description: 'Validate Subject dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#selectSubjects')).getAttribute('value'); - if (elementText !== 'none') { - throw new Error(`Expected: Subject dropdown value, none = "Select a subject" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Subject dropdown value, Select a subject matched as expected'); - } - }, - - //NEXT ACTION -Validation 1 (no subject) - { - description: 'Click search button without selecting subject and validate assert message', - action: async () => { - const searchButton = await driver.wait( - until.elementLocated(By.css('#stdsubmit')), - 5000 - ); - await searchButton.click(); - await driver.sleep(2000); - - const alert = await driver.wait( - until.alertIsPresent(), - 5000 - ); - - const alertText = await alert.getText(); - - try { - if (alertText !== 'You must select a subject') { - throw new Error(`Expected: "You must select a subject (ECS-2829)"; Actual: "${alertText}"`); - } - console.log('Passed: "You must select a subject" Alert DIV text matched as expected'); - console.log('Passed: "OK" button text matched as expected'); - } catch (error) { - console.error('FAILED: Alert DIV, unable to validate text; Error Message: ', error.message); - await alert.dismiss(); - throw error; - } - - await alert.accept(); - await driver.sleep(2000); - } - }, - - //NEXT ACTION - Select subject - { description: 'Select Subject - Mathematics', action: async () => await driver.findElement(By.css('#selectSubjects > option:nth-child(3)')).click() }, - - //Wait for Subject dropdown to load - { - description: 'Wait for subject dropdown to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('#selectSubjects')), 10000).catch(() => false); - } - }, - - //Subject dropdown value - { - description: 'Validate Subject dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#selectSubjects')).getAttribute('value'); - if (elementText !== 'Mathematics') { - throw new Error(`Expected: Subject dropdown value, "Mathematics" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Subject dropdown value, Mathematics matched as expected'); - } - }, - - //Grade label - { - description: 'Validate Grade label', - action: async () => { - const elementText = await driver.findElement(By.css('.hideGrade > .col-sm-2')).getText(); - if (elementText !== 'Grade') { - throw new Error(`Expected: "Grade"; Actual: "${elementText}"`); - } - console.log('Passed: Grade label matched as expected'); - } - }, - - //Grade dropdown value - { - description: 'Validate Grade dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#selectGrade')).getAttribute('value'); - if (elementText !== 'none') { - throw new Error(`Expected: Grade dropdown value, none = "Select a grade" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Grade dropdown value, Select a grade matched as expected'); - } - }, - - //NEXT ACTION -Validation 1 (no grade) - { - description: 'Click search button without selecting grade and validate assert message', - action: async () => { - const searchButton = await driver.wait( - until.elementLocated(By.css('#stdsubmit')), - 5000 - ); - await searchButton.click(); - await driver.sleep(2000); - - const alert = await driver.wait( - until.alertIsPresent(), - 5000 - ); - - const alertText = await alert.getText(); - - try { - if (alertText !== 'You must select a grade') { - throw new Error(`Expected: "You must select a grade"; Actual: "${alertText}"`); - } - console.log('Passed: "You must select a grade" Alert DIV text matched as expected'); - console.log('Passed: "OK" button text matched as expected'); - } catch (error) { - console.error('FAILED: Alert DIV, unable to validate text; Error Message: ', error.message); - await alert.dismiss(); - throw error; - } - - await alert.accept(); - await driver.sleep(2000); - } - }, - - //NEXT ACTION - Select grade - { description: 'Select Grade - 8', action: async () => await driver.findElement(By.css('#selectGrade > option:nth-child(10)')).click() }, - - //Grade dropdown value - { - description: 'Validate Grade dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('#selectGrade')).getAttribute('value'); - if (elementText !== '48') { - throw new Error(`Expected: Grade dropdown value, "8" did not match; Actual: "${elementText}"`); - } - console.log('Passed: Grade dropdown value, 8 matched as expected'); - } - }, - - //NEXT ACTION - Click Show Correlations From dropdown - { description: 'Click All Content Set dropdown', action: async () => await driver.findElement(By.css('.col-sm-10 .multiselect-selected-text')).click() }, - - //Wait for Subject dropdown to load - { - description: 'Wait for subject dropdown to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.show > .multiselect-item .input-group-prepend img')), 10000).catch(() => false); - } - }, - - //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'); - } - }, - - //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'); - } - }, - - //Algebra - QA checkbox - { - description: 'Verify Algebra - QA checkbox is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(8) input')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Algebra - QA checkbox not found'); - } - console.log('Passed: Algebra - QA checkbox present'); - } - }, - - //Algebra - QA label - { - description: 'Validate Algebra - QA label', - action: async () => { - const elementText = await driver.findElement(By.css('.show > li:nth-child(8) .checkbox')).getText(); - if (elementText !== 'Algebra - QA') { - throw new Error(`Expected: "Algebra - QA" checkbox label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA checkbox label matched as expected'); - } - }, - - //Geometry - QA checkbox - { - description: 'Verify Geometry - QA checkbox is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(11) input')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Geometry - QA checkbox not found'); - } - console.log('Passed: Geometry - QA checkbox present'); - } - }, - - //Geometry - QA label - { - description: 'Validate Geometry - QA label', - action: async () => { - const elementText = await driver.findElement(By.css('.show > li:nth-child(11) .checkbox')).getText(); - if (elementText !== 'Geometry - QA') { - throw new Error(`Expected: "Geometry - QA" checkbox label; Actual: "${elementText}"`); - } - console.log('Passed: Geometry - QA checkbox label matched as expected'); - } - }, - - //NEXT ACTION - Select Algebra & Geometry - QA labels - { description: 'Click Algebra - QA checkbox', action: async () => await driver.findElement(By.css('.show > li:nth-child(8) input')).click() }, - { description: 'Click Geometry - QA checkbox label', action: async () => await driver.findElement(By.css('.show > li:nth-child(11) .checkbox')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - //NEXT ACTION - Click away to close DIV - { description: 'Click main page to close DIV', action: async () => await driver.findElement(By.css('.form-group:nth-child(8) > .col-sm-10')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Show Correlations From dropdown value - { - description: 'Validate Show Correlations From dropdown value', - action: async () => { - const elementText = await driver.findElement(By.css('.col-sm-10 .multiselect-selected-text')).getText(); - if (elementText !== 'Algebra - QA , Geometry - QA') { - throw new Error(`Expected: "Algebra - QA , Geometry - QA" dropdown value did not match; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA , Geometry - QA dropdown value matched as expected'); - } - }, - - //NEXT ACTION - Select Included Related Standards - { description: 'Click Included Related Standards checkbox', action: async () => await driver.findElement(By.css('#doRel')).click() }, - - //Wait for Related standards dropdown to load - { - description: 'Wait for related standards dropdown to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.col-auto .multiselect-selected-text')), 10000).catch(() => false); - } - }, - - //Related Standards default text - { - description: 'Validate Related Standards default text', - action: async () => { - const elementText = await driver.findElement(By.css('.col-auto .multiselect-selected-text')).getText(); - if (elementText !== 'None Selected') { - throw new Error(`Expected: "None Selected" dropdown text; Actual: "${elementText}"`); - } - console.log('Passed: None Selected dropdown text matched as expected'); - } - }, - - //NEXT ACTION - Click Related standards dropdown - { description: 'Click Related standards dropdown', action: async () => await driver.findElement(By.css('.col-auto .multiselect-selected-text')).click() }, - - //Wait for Subject dropdown to load - { - description: 'Wait for subject dropdown to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.show > .multiselect-item .input-group-prepend img')), 10000).catch(() => false); - } - }, - - //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'); - } - }, - - //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'); - } - }, - - //Washington Standards checkbox - { - description: 'Validate Washington Standards checkbox is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > li:nth-child(12) input')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Washington Standards checkbox not found'); - } - console.log('Passed: Washington Standards checkbox present'); - } - }, - - //Washington Standards label - { - description: 'Validate Washington Standards label', - action: async () => { - const elementText = await driver.findElement(By.css('.show > li:nth-child(12) .checkbox')).getText(); - if (elementText !== 'Washington Standards') { - throw new Error(`Expected: "Washington Standards" checkbox label; Actual: "${elementText}"`); - } - console.log('Passed: Washington Standards checkbox label matched as expected'); - } - }, - - //NEXT ACTION - Select Washington Standards - { description: 'Click checkbox for Washington Standards', action: async () => await driver.findElement(By.css('.show > li:nth-child(12) input')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - //NEXT ACTION - Click away to close DIV - { description: 'Click main page to close DIV', action: async () => await driver.findElement(By.css('.align-items-center')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Related Standards default text - { - description: 'Validate Related Standards default text', - action: async () => { - const elementText = await driver.findElement(By.css('.col-auto .multiselect-selected-text')).getText(); - if (elementText !== 'Washington Standards') { - throw new Error(`Expected: "Washington Standards" dropdown text; Actual: "${elementText}"`); - } - console.log('Passed: Washington Standards dropdown text matched as expected'); - } - }, - - //Based on text - { - description: 'Validate based on text', - action: async () => { - const elementText = await driver.findElement(By.css('.col-auto:nth-child(2)')).getText(); - if (elementText !== 'based on') { - throw new Error(`Expected: "based on" text; Actual: "${elementText}"`); - } - console.log('Passed: based on text matched as expected'); - } - }, - - //Best match dropdown text - { - description: 'Validate Best match dropdown text', - action: async () => { - const elementText = await driver.findElement(By.css('.custom-select')).getAttribute('value'); - if (elementText !== 'best') { - throw new Error(`Expected: "best match" text; Actual: "${elementText}"`); - } - console.log('Passed: best match text matched as expected'); - } - }, - - //Help icon color -navy blue - { - description: 'Validate help icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.fa-2')).getCssValue('color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Help icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Help icon color matched as expected'); - } - }, - - //Note text - { - description: 'Validate Note text', - action: async () => { - const elementText = await driver.findElement(By.css('em')).getText(); - if (elementText !== '** note - including related standards may cause increased page load times') { - throw new Error(`Expected: "** note - including related standards may cause increased page load times" text; Actual: "${elementText}"`); - } - console.log('Passed: ** note - including related standards may cause increased page load times text matched as expected'); - } - }, - - //NEXT ACTION - Click search button - { description: 'Click Search button', action: async () => await driver.findElement(By.css('#stdsubmit')).click() }, - - //Wait for page to load - Common Core State Standards - { - description: 'Wait for Common Core State Standards page to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('h1')), 10000).catch(() => false); - } - }, - - //Search link - { - description: 'Validate Seach link', - action: async () => { - const elementText = await driver.findElement(By.linkText('Search')).getText(); - if (elementText !== 'Search') { - throw new Error(`Expected: "Search"; Actual: "${elementText}"`); - } - console.log('Passed: Search link matched as expected'); - } - }, - - //Standards breadcrumb - { - description: 'Validate Standards breadcrumb', - action: async () => { - const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText(); - if (elementText !== 'Standards') { - throw new Error(`Expected: "Standards"; Actual: "${elementText}"`); - } - console.log('Passed: Standards text matched as expected'); - } - }, - - //Standards breadcrumb color -green - { - description: 'Validate Standards breadcrumb color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Standards link text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Standards link text color matched as expected'); - } - }, - - //Save icon - { - description: 'Verify Save icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.float-right > a:nth-child(1) > img')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Save icon not found'); - } - console.log('Passed: Save icon present'); - } - }, - - //Save icon tool-tip - { - description: 'Validate Save icon tool-tip', - action: async () => { - const elementStyle = await driver.findElement(By.css('body > div.container.body > div > div.right_col > div > div.float-right.ml-1 > a:nth-child(1)')).getAttribute('title'); - if (elementStyle !== 'Save This Search') { - throw new Error(`Expected: "Save This Search"; Actual: "${elementStyle}"`); - } - console.log('Passed: Save This Search tool-tip matched as expected'); - } - }, - - //Print icon - { - description: 'Verify Print icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.icon-link > img')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Print icon not found'); - } - console.log('Passed: Print icon present'); - } - }, - - //Printicon tool-tip - { - description: 'Validate Print icon tool-tip', - action: async () => { - const elementStyle = await driver.findElement(By.css('.icon-link > img')).getAttribute('title'); - if (elementStyle !== 'Print This Page') { - throw new Error(`Expected: "Print This Page"; Actual: "${elementStyle}"`); - } - console.log('Passed: Print This Page tool-tip matched as expected'); - } - }, - - //Page title - { - description: 'Validate page title', - action: async () => { - const elementText = await driver.findElement(By.css('h1')).getText(); - if (elementText !== 'Common Core State Standards') { - throw new Error(`Expected: "Common Core State Standards" text; Actual: "${elementText}"`); - } - console.log('Passed: Common Core State Standards text matched as expected'); - } - }, - - //Page sub-title - { - description: 'Validate page sub-title', - action: async () => { - const elementText = await driver.findElement(By.css('strong')).getText(); - if (elementText !== 'Mathematics - Grade 8') { - throw new Error(`Expected: "Mathematics - Grade 8" text; Actual: "${elementText}"`); - } - console.log('Passed: Mathematics - Grade 8 text matched as expected'); - } - }, - - //Info icon color -navy blue - { - description: 'Validate Info icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.fa-info-circle')).getCssValue('color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Info icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Info icon color matched as expected'); - } - }, - - //NEXT ACTION - Click info icon - { description: 'Click info icon', action: async () => await driver.findElement(By.css('.fa-info-circle')).click() }, - - //Wait for info DIV to open - { - description: 'Wait for info DIV to open', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.modal-title')), 10000).catch(() => false); - } - }, - - //Info DIV title - { - description: 'Validate info DIV title', - action: async () => { - const elementText = await driver.findElement(By.css('.modal-title')).getText(); - if (elementText !== 'Alignment Modification Help') { - throw new Error(`Expected: "Alignment Modification Help" text; Actual: "${elementText}"`); - } - console.log('Passed: Alignment Modification Help text matched as expected'); - } - }, - - //Info DIV instructions - { - description: 'Validate info DIV instructions', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(1) > td')).getText(); - if (elementText !== 'Clicking on a Add Direct Alignment button opens a dialog window to align content directly to a standard.') { - throw new Error(`Expected: "Clicking on a Add Direct Alignment button opens a dialog window to align content directly to a standard." instructions text; Actual: "${elementText}"`); - } - console.log('Passed: Info DIV instructions text matched as expected'); - } - }, - - //Icon Key header text - { - description: 'Validate Icon Key header text', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(2) > .text-center')).getText(); - if (elementText !== 'Icon Key') { - throw new Error(`Expected: "Icon Key" header text; Actual: "${elementText}"`); - } - console.log('Passed: Icon Key header text matched as expected'); - } - }, - - //True correlation icon - { - description: 'Validate True correlation icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-check-circle')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('True correlation icon not found'); - } - console.log('Passed: True correlation icon present'); - } - }, - - //True correlation label - { - description: 'Validate True correlation label', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(3) > td:nth-child(2)')).getText(); - if (elementText !== 'True correlation') { - throw new Error(`Expected: "True correlation" label; Actual: "${elementText}"`); - } - console.log('Passed: True correlation label matched as expected'); - } - }, - - //Hidden correlation icon - { - description: 'Validate Hidden correlation icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-pause-circle')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Hidden correlation icon not found'); - } - console.log('Passed: Hidden correlation icon present'); - } - }, - - //Hidden correlation label - { - description: 'Validate Hidden correlation label', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(4) > td:nth-child(2)')).getText(); - if (elementText !== 'Hidden correlation') { - throw new Error(`Expected: "Hidden correlation" label; Actual: "${elementText}"`); - } - console.log('Passed: Hidden correlation label matched as expected'); - } - }, - - //Added direct alignment icon - { - description: 'Validate Added direct alignment icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-dot-circle-o')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Added direct alignment icon not found'); - } - console.log('Passed: Added direct alignment icon present'); - } - }, - - //Added direct alignment label - { - description: 'Validate Added direct alignment label', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(5) > td:nth-child(2)')).getText(); - if (elementText !== 'Added direct alignment') { - throw new Error(`Expected: "Added direct alignment" label; Actual: "${elementText}"`); - } - console.log('Passed: Added direct alignment label matched as expected'); - } - }, - - //Not correlated icon - { - description: 'Validate Not correlated icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-circle-o')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Not correlated icon not found'); - } - console.log('Passed: Not correlated icon present'); - } - }, - - //Not correlated label - { - description: 'Validate Not correlated label', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(6) > td:nth-child(2)')).getText(); - if (elementText !== 'Not correlated') { - throw new Error(`Expected: "Not correlated" label; Actual: "${elementText}"`); - } - console.log('Passed: Not correlated label matched as expected'); - } - }, - - //Button header text - { - description: 'Validate Button header text', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(7) > .text-center')).getText(); - if (elementText !== 'Buttons') { - throw new Error(`Expected: "Buttons" header text; Actual: "${elementText}"`); - } - console.log('Passed: Buttons header text matched as expected'); - } - }, - - //Select All label - { - description: 'Validate Select All label', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(8) > .text-right')).getText(); - if (elementText !== 'Select All') { - throw new Error(`Expected: "Select All" label text; Actual: "${elementText}"`); - } - console.log('Passed: Select All label matched as expected'); - } - }, - - //Select All instruction - { - description: 'Validate Select All instruction', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(8) > td:nth-child(2)')).getText(); - if (elementText !== 'Check/select all for this content item') { - throw new Error(`Expected: "Check/select all for this content item" instruction text; Actual: "${elementText}"`); - } - console.log('Passed: Check/select all for this content item instruction matched as expected'); - } - }, - - //Clear label - { - description: 'Validate Clear label', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(9) > .text-right')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: "Clear" label text; Actual: "${elementText}"`); - } - console.log('Passed: Clear label matched as expected'); - } - }, - - //Clear instruction - { - description: 'Validate Clear instruction', - action: async () => { - const elementText = await driver.findElement(By.css('.align-middle:nth-child(9) > td:nth-child(2)')).getText(); - if (elementText !== 'Hide/un-select all for this content item') { - throw new Error(`Expected: "Hide/un-select all for this content item" instruction text; Actual: "${elementText}"`); - } - console.log('Passed: Hide/un-select all for this content item instruction matched as expected'); - } - }, - - //Info close icon color -red - { - description: 'Validate Info close icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.close > span')).getCssValue('color'); - if (elementStyle !== 'rgba(246, 60, 40, 1)') { - throw new Error(`Info close icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Info close icon color matched as expected'); - } - }, - - //NEXT ACTION - Click info close icon - { description: 'Click info close icon', action: async () => await driver.findElement(By.css('.close > span')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Show All Correlations button text - { - description: 'Validate Show All Correlations button text', - action: async () => { - const elementText = await driver.findElement(By.css('.btn:nth-child(2)')).getText(); - if (elementText !== 'Show All Correlations') { - throw new Error(`Expected: "Show All Correlations" text; Actual: "${elementText}"`); - } - console.log('Passed: Show All Correlations text matched as expected'); - } - }, - - //Show All Correlations button -green - { - description: 'Validate Show All Correlations button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.btn:nth-child(2)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Show All Correlations button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Show All Correlations button color matched as expected'); - } - }, - - //Show All Correlations button text - { - description: 'Validate Show All Correlations button text', - action: async () => { - const elementText = await driver.findElement(By.css('.btn:nth-child(2)')).getText(); - if (elementText !== 'Show All Correlations') { - throw new Error(`Expected: "Show All Correlations" text; Actual: "${elementText}"`); - } - console.log('Passed: Show All Correlations text matched as expected'); - } - }, - - //Parent standard title - { - description: 'Validate parent standard title', - action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(8) > .card-header')).getText(); - if (elementText !== 'CCSS.Math.Practice Mathematical Practices (Grade 8)') { - throw new Error(`Expected: "CCSS.Math.Practice Mathematical Practices (Grade 8)" title; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice Mathematical Practices (Grade 8) title matched as expected'); - } - }, - - //Parent standard title background color -green - { - description: 'Validate Show All Correlations title background color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.btn:nth-child(2)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Show All Correlations title background color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Show All Correlations title background color matched as expected'); - } - }, - - //Child standard 1 title - { - description: 'Validate child standard 1 title', - action: async () => { - const elementText = await driver.findElement(By.xpath(`//div[@id='stdbox']/b`)).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1" title; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice.MP1 title matched as expected'); - } - }, - - //Child standard 1 text - { - description: 'Validate child standard 1 text', - action: async () => { - try { - const element = await driver.findElement(By.xpath(`//div[@id='stdbox']`)); - - //Get different versions of the text for debugging - const fullText = await element.getText(); - - //Check for the expected text in different ways - const expectedText = 'Make sense of problems and persevere in solving them.'; - const trimmedFullText = fullText.trim(); - const firstLine = trimmedFullText.split('\n')[0].trim(); - - //Try multiple matching strategies - if (firstLine.includes(expectedText)) { - console.log(`Passed: "${expectedText}" text in first line`); - } else if (trimmedFullText.includes(expectedText)) { - console.log(`Passed: "${expectedText}" text within full text`); - } else { - throw new Error( - `Text validation failed.\nExpected: "${expectedText}"\n` + - `Full text: "${fullText}"\n` + - `First line: "${firstLine}"\n` - ); - } - - } catch (error) { - console.error('Detailed error during validation:', error); - throw error; //Re-throw after logging - } - } - }, - - //Child standard 1 tools icon - { - description: 'Verify child standard 1 tools icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.xpath(`//div[@id='stdbox']/div/div/button/i`)), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Child standard 1 tools icon is not found'); - } - console.log('Passed: Child standrd 1 tools icon present'); - } - }, - - //Child standard 1 tools button text - { - description: 'Validate child standard 1 tools button text', - action: async () => { - const elementText = await driver.findElement(By.xpath(`//button[@type='button']`)).getText(); - if (elementText !== 'Tools') { - throw new Error(`Expected: "Tools" button text; Actual: "${elementText}"`); - } - console.log('Passed: Tools button text matched as expected'); - } - }, - - //Child standard 1 tools button color -green - { - description: 'Validate Child standard 1 tools button color', - action: async () => { - const elementStyle = await driver.findElement(By.xpath(`//button[@type='button']`)).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Child standard 1 tools button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Child standard 1 tools button color matched as expected'); - } - }, - - //NEXT ACTION - Click Tools button - { description: 'Click Tools button', action: async () => await driver.findElement(By.xpath(`//button[@type='button']`)).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Tools - Align Content to This Standard icon - { - description: 'Verify Align Content to This Standard icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show .email > img')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Child standard 1 tools icon is not found'); - } - console.log('Passed: Child standrd 1 tools icon present'); - } - }, - - //Tools - Align Content to This Standard link - { - description: 'Validate Align Content to This Standard text', - action: async () => { - const elementText = await driver.findElement(By.linkText('Align Content to This Standard')).getText(); - if (elementText !== 'Align Content to This Standard') { - throw new Error(`Expected: "Align Content to This Standard" text; Actual: "${elementText}"`); - } - console.log('Passed: Align Content to This Standard text matched as expected'); - } - }, - - //Tools - Submit A Lesson or Resource icon - { - description: 'Verify Submit A Lesson or Resource icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.show > .dropdown-item:nth-child(2) img')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Child standard 2 tools icon is not found'); - } - console.log('Passed: Child standrd 2 tools icon present'); - } - }, - - //Tools - Submit A Lesson or Resource link - { - description: 'Validate Submit A Lesson or Resource text', - action: async () => { - const elementText = await driver.findElement(By.linkText('Submit A Lesson or Resource')).getText(); - if (elementText !== 'Submit A Lesson or Resource') { - throw new Error(`Expected: "Submit A Lesson or Resource" text; Actual: "${elementText}"`); - } - console.log('Passed: Submit A Lesson or Resource text matched as expected'); - } - }, - - //NEXT ACTION - Click Align Content to This Standard link - { description: 'Click Align Content to This Standard link', action: async () => await driver.findElement(By.linkText('Align Content to This Standard')).click() }, - - //Wait for info DIV to open - { - description: 'Wait for info DIV to open', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.modal-title')), 10000).catch(() => false); - } - }, - - //Align to Standard DIV title - { - description: 'Validate Align to Standard DIV title', - action: async () => { - const elementText = await driver.findElement(By.css('.modal-title')).getText(); - if (elementText !== 'Align to Standard') { - throw new Error(`Expected: "Align to Standard" DIV title; Actual: "${elementText}"`); - } - console.log('Passed: Align to Standard DIV title matched as expected'); - } - }, - - //Search titles textbox placeholder - { - description: 'Validate Search titles textbox placeholder', - action: async () => { - const elementText = await driver.findElement(By.css('.form-control')).getAttribute('placeholder'); - if (elementText !== 'Search titles...') { - throw new Error(`Expected: "Search titles..." textbox placeholder did not match; Actual: "${elementText}"`); - } - console.log('Passed: Search titles... textbox placeholder matched as expected'); - } - }, - - //Search button text - { - description: 'Validate Search button text', - action: async () => { - const elementText = await driver.findElement(By.css('.col-auto > .btn')).getAttribute('value'); - if (elementText !== 'Search') { - throw new Error(`Expected: "Search" button text; Actual: "${elementText}"`); - } - console.log('Passed: Search button text matched as expected'); - } - }, - - //Search button color -gray - { - description: 'Validate Search button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.col-auto > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Search button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Search button color matched as expected'); - } - }, - - //Standard text - { - description: 'Validate Standard text', - action: async () => { - const elementText = await driver.findElement(By.css('div:nth-child(3) > b:nth-child(1)')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1" text; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice.MP1 text matched as expected'); - } - }, - - //Standard description text - { - description: 'Validate Standard description text', - action: async () => { - const elementText = await driver.findElement(By.css('#content_search > div:nth-child(3)')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them." text; Actual: "${elementText}"`); - } - console.log('Passed: Standard description text matched as expected'); - } - }, - - //Show Concepts button text - { - description: 'Validate Show Concepts button text', - action: async () => { - const elementText = await driver.findElement(By.css('.m-2:nth-child(2)')).getAttribute('value'); - if (elementText !== 'Show Concepts') { - throw new Error(`Expected: "Show Concepts" button text; Actual: "${elementText}"`); - } - console.log('Passed: Show Concepts button text matched as expected'); - } - }, - - //Show Concepts button color -green - { - description: 'Validate Show Concepts button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.m-2:nth-child(2)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Show Concepts button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Show Concepts button color matched as expected'); - } - }, - - //Geometry expansion icon - { - description: 'Verify Geometry expansion icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#toggle-organization-label-0 > img')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Geometry expansion icon is not found'); - } - console.log('Passed: Geometry expansion icon present'); - } - }, - - //Geometry - QA label - { - description: 'Validate Geometry - QA label', - action: async () => { - const elementText = await driver.findElement(By.css('#toggle-organization-label-0')).getText(); - if (elementText !== 'Geometry - QA') { - throw new Error(`Expected: "Geometry - QA" label; Actual: "${elementText}"`); - } - console.log('Passed: Geometry - QA label matched as expected'); - } - }, - - //Algebra expansion icon - { - description: 'Verify Algebra expansion icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#toggle-organization-label-1 > img')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Algebra expansion icon is not found'); - } - console.log('Passed: Algebra expansion icon present'); - } - }, - - //Algebra - QA label - { - description: 'Validate Algebra - QA label', - action: async () => { - const elementText = await driver.findElement(By.css('#toggle-organization-label-1')).getText(); - if (elementText !== 'Algebra - QA') { - throw new Error(`Expected: "Algebra - QA" label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA label matched as expected'); - } - }, - - //NEXT ACTION - Click Geometry - QA link - { description: 'Click Geometry - QA label', action: async () => await driver.findElement(By.css('#toggle-organization-label-0')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //All Details button text - { - description: 'Validate All Details button text', - action: async () => { - const elementText = await driver.findElement(By.css('#\\38 73576071')).getText(); - if (elementText !== 'All Details') { - throw new Error(`Expected: "All Details" button text; Actual: "${elementText}"`); - } - console.log('Passed: All Details button text matched as expected'); - } - }, - - //All Details button color -gray - { - description: 'Validate All Details buttoncolor', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\38 73576071')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`All Details button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: All Details button color matched as expected'); - } - }, - - //3-variable linear system word problems link text - { - description: 'Validate 3-variable linear system word problems link text', - action: async () => { - const elementText = await driver.findElement(By.linkText('3-variable linear system word problems')).getText(); - if (elementText !== '3-variable linear system word problems') { - throw new Error(`Expected: "3-variable linear system word problems" link text; Actual: "${elementText}"`); - } - console.log('Passed: 3-variable linear system word problems link text matched as expected'); - } - }, - - //3-variable linear system word problems link text color -gray - { - description: 'Validate 3-variable linear system word problems link text color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('3-variable linear system word problems')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`3-variable linear system word problems link text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: 3-variable linear system word problems link text color matched as expected'); - } - }, - - //Alignment 1 Details button text - { - description: 'Validate Alignment 1 Details button text', - action: async () => { - const elementText = await driver.findElement(By.css('#\\38 73598469')).getText(); - if (elementText !== 'Details') { - throw new Error(`Expected: Alignment 1 "Details" button text; Actual: "${elementText}"`); - } - console.log('Passed: Alignment 1 Details button text matched as expected'); - } - }, - - //Alignment 1 Details button color -gray - { - description: 'Validate Alignment 1 Details button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\38 73598469')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Alignment 1 Details button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Alignment 1 Details button color matched as expected'); - } - }, - - //NEXT ACTION - Click alignment 1 Details button - { description: 'Click alignment 1 Deatils button', action: async () => await driver.findElement(By.css('#\\38 73598469')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //3-variable linear system word problems description 1 - { - description: 'Validate 3-variable linear system word problems description', - action: async () => { - const elementText = await driver.findElement(By.css('#smry-id-873598469')).getText(); - if (elementText !== 'Learn how to make the most out of the familiar algebraic techniques in order to solve systems of three equations with three variables.') { - throw new Error(`Expected: Alignment 1 description text did not match; Actual: "${elementText}"`); - } - console.log('Passed: Alignment 1 description matched as expected'); - } - }, - - //Alignment Pending warning icon 1 - { - description: 'Verify Alignment Pending warning icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#lsn-id-873598469 > .display-alignment')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Alignment Pending" warning icon not found'); - } - console.log('Passed: Alignment Pending warning icon present'); - } - }, - - //Alignment Pending label 1 - { - description: 'Validate Alignment Pending label', - action: async () => { - const elementText = await driver.findElement(By.css('#lsn-id-873598469 span')).getText(); - if (elementText !== 'Alignment Pending') { - throw new Error(`Expected: "Alignment Pending" label; Actual: "${elementText}"`); - } - console.log('Passed: Alignment Pending label matched as expected'); - } - }, - - //Alignment Pending checkbox icon 1 - { - description: 'Verify Alignment Pending checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#lsn-id-873598469 input')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Alignment Pending" checkbox icon not found'); - } - console.log('Passed: Alignment Pending checkbox icon present'); - } - }, - - //A Lunch-In Affair link text 2 - { - description: 'Validate A Lunch-In Affair link text', - action: async () => { - const elementText = await driver.findElement(By.linkText('A Lunch-In Affair')).getText(); - if (elementText !== 'A Lunch-In Affair') { - throw new Error(`Expected: "A Lunch-In Affair" link text; Actual: "${elementText}"`); - } - console.log('Passed: A Lunch-In Affair link text matched as expected'); - } - }, - - //A Lunch-In Affair link text 2 color -gray - { - description: 'Validate A Lunch-In Affair link text color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('A Lunch-In Affair')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`A Lunch-In Affair link text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: A Lunch-In Affair link text color matched as expected'); - } - }, - - //Alignment 2 Details button text 2 - { - description: 'Validate Alignment 2 Details button text', - action: async () => { - const elementText = await driver.findElement(By.css('#\\38 73598488')).getText(); - if (elementText !== 'Details') { - throw new Error(`Expected: Alignment 2 "Details" button text; Actual: "${elementText}"`); - } - console.log('Passed: Alignment 2 Details button text matched as expected'); - } - }, - - //Alignment 2 Details button 2 color -gray - { - description: 'Validate Alignment 2 Details button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\38 73598488')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Alignment 2 Details button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Alignment 2 Details button color matched as expected'); - } - }, - - //Not Aligned warning icon 2 - { - description: 'Verify Not Aligned warning icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#lsn-id-873598488 > .display-alignment')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Not Aligned" warning icon not found'); - } - console.log('Passed: Not Aligned warning icon present'); - } - }, - - //Not Aligned label 2 - { - description: 'Validate Not Aligned label', - action: async () => { - const elementText = await driver.findElement(By.css('#lsn-id-873598488 span')).getText(); - if (elementText !== 'Not Aligned') { - throw new Error(`Expected: "Not Aligned" label; Actual: "${elementText}"`); - } - console.log('Passed: Not Aligned label matched as expected'); - } - }, - - //Not Aligned checkbox icon 2 - { - description: 'Verify Not Aligned checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#lsn-id-873598488 input')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Not Aligned" checkbox icon not found'); - } - console.log('Passed: Not Aligned checkbox icon present'); - } - }, - - //Show Concepts button text - { - description: 'Validate Show Concepts button text', - action: async () => { - const elementText = await driver.findElement(By.css('.m-2:nth-child(1)')).getAttribute('value'); - if (elementText !== 'Show Concepts') { - throw new Error(`Expected: "Show Concepts" button text; Actual: "${elementText}"`); - } - console.log('Passed: Show Concepts button text matched as expected'); - } - }, - - //Show Concepts button color -green - { - description: 'Validate Show Concepts button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.m-2:nth-child(1)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Show Concepts button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Show Concepts button color matched as expected'); - } - }, - - //NEXT ACTION - Click X icon - { description: 'Click X icon to close DIV', action: async () => await driver.findElement(By.css('.modal-header span')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - //NEXT ACTION - Click Tools button - { description: 'Click Tools button', action: async () => await driver.findElement(By.xpath(`//button[@type='button']`)).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - //NEXT ACTION - Click Submit A Lesson or Resource link - { description: 'Click Submit A Lesson or Resource link', action: async () => await driver.findElement(By.linkText('Submit A Lesson or Resource')).click() }, - - //Wait for info DIV to open - { - description: 'Wait for info DIV to open', - action: async () => { - return await driver.wait(until.elementLocated(By.css('#myModalLabel')), 10000).catch(() => false); - } - }, - - //Submit A Resource DIV title - { - description: 'Validate Submit A Resource DIV title', - action: async () => { - const elementText = await driver.findElement(By.css('#myModalLabel')).getText(); - if (elementText !== 'Submit A Resource') { - throw new Error(`Expected: "Submit A Resource" DIV title; Actual: "${elementText}"`); - } - console.log('Passed: Submit A Resource DIV title matched as expected'); - } - }, - - //Resource tab title - { - description: 'Validate Resource tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-1')).getText(); - if (elementText !== 'Resource') { - throw new Error(`Expected: "Resource" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Resource tab title matched as expected'); - } - }, - - //Resource tab title color -dark blue (active) - { - description: 'Validate Resource tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-1')).getCssValue('color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Resource tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Resource tab title color matched as expected'); - } - }, - - //Metadata tab title - { - description: 'Validate Metadata tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-3')).getText(); - if (elementText !== 'Metadata') { - throw new Error(`Expected: "Metadata" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Metadata tab title matched as expected'); - } - }, - - //Metadata tab title color -gray (dimmed) - { - description: 'Validate Metadata tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-3')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 1)') { - throw new Error(`Metadata tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Metadata tab title color matched as expected'); - } - }, - - //Concepts tab title - { - description: 'Validate Concepts tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-4')).getText(); - if (elementText !== 'Concepts') { - throw new Error(`Expected: "Concepts" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Concepts tab title matched as expected'); - } - }, - - //Concepts tab title color -gray (dimmed) - { - description: 'Validate Concepts tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-4')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 1)') { - throw new Error(`Concepts tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Concepts tab title color matched as expected'); - } - }, - - //* Required text - { - description: 'Validate Required text', - action: async () => { - const elementText = await driver.findElement(By.css('#tabsr-1 > span')).getText(); - if (elementText !== '* Required') { - throw new Error(`Expected: "* Required" text; Actual: "${elementText}"`); - } - console.log('Passed: * Required text matched as expected'); - } - }, - - //Required text color -red - { - description: 'Validate Required text color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tabsr-1 > span')).getCssValue('color'); - if (elementStyle !== 'rgba(255, 0, 0, 1)') { - throw new Error(`Required text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Required text color matched as expected'); - } - }, - - //Standard title - { - description: 'Validate Standard title', - action: async () => { - const elementText = await driver.findElement(By.css('legend > b')).getText(); - if (elementText !== 'Common Core State Standards') { - throw new Error(`Expected: "Common Core State Standards" text; Actual: "${elementText}"`); - } - console.log('Passed: Standard title matched as expected'); - } - }, - - //Submit button text - { - description: 'Validate Submit button text', - action: async () => { - const elementText = await driver.findElement(By.css('.float-right:nth-child(3) > .btn')).getAttribute('value'); - if (elementText !== 'Submit') { - throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); - } - console.log('Passed: Submit button text matched as expected'); - } - }, - - //Submit button color -green - { - description: 'Validate Submit button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.float-right:nth-child(3) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Submit button color matched as expected'); - } - }, - - //Standard text - { - description: 'Validate Standard text', - action: async () => { - const elementText = await driver.findElement(By.css('fieldset > div > b')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1" text; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice.MP1 text matched as expected'); - } - }, - - //Standard description text - { - description: 'Validate Standard description text', - action: async () => { - const elementText = await driver.findElement(By.css('fieldset > div')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them." text; Actual: "${elementText}"`); - } - console.log('Passed: Standard description text matched as expected'); - } - }, - - //Title label - { - description: 'Validate Title label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getText(); - if (elementText !== '* Title') { - throw new Error(`Expected: "* Title" label; Actual: "${elementText}"`); - } - console.log('Passed: * Title label matched as expected'); - } - }, - - //Title textbox - { - description: 'Validate Title textbox', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title')).getAttribute('type'); - if (elementStyle !== 'text') { - throw new Error(`Title text type did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Title text type matched as expected'); - } - }, - - //Description label - { - description: 'Validate Description label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText(); - if (elementText !== 'Description') { - throw new Error(`Expected: "Description" label; Actual: "${elementText}"`); - } - console.log('Passed: Description label matched as expected'); - } - }, - - //Description textbox - { - description: 'Validate Description textbox', - action: async () => { - const elementStyle = await driver.findElement(By.css('#description')).getAttribute('type'); - if (elementStyle !== 'textarea') { - throw new Error(`Description textarea type did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Description textarea type matched as expected'); - } - }, - - //URL label - { - description: 'Validate URL label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(7) > label')).getText(); - if (elementText !== 'URL') { - throw new Error(`Expected: "URL" label; Actual: "${elementText}"`); - } - console.log('Passed: URL label matched as expected'); - } - }, - - //URL textbox - { - description: 'Validate URL textbox placeholder', - action: async () => { - const elementStyle = await driver.findElement(By.css('#url')).getAttribute('placeholder'); - if (elementStyle !== 'https://example.com') { - throw new Error(`URL placeholder "https://example.com" did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: URL placeholder matched as expected'); - } - }, - - //Content Set label - { - description: 'Validate Content Set label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label')).getText(); - if (elementText !== '* Content Set') { - throw new Error(`Expected: "* Content Set" label; Actual: "${elementText}"`); - } - console.log('Passed: * Content Set label matched as expected'); - } - }, - - //Content Set textbox - { - description: 'Validate Content Set textbox', - action: async () => { - const elementStyle = await driver.findElement(By.css('#orgs')).getAttribute('value'); - if (elementStyle !== '873576065') { - throw new Error(`Content Set value "Algebra - QA" did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Content Set value matched as expected'); - } - }, - - //Grades Set label - { - description: 'Validate Grades label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(9) > label')).getText(); - if (elementText !== '* Grades') { - throw new Error(`Expected: "* Grades" label; Actual: "${elementText}"`); - } - console.log('Passed: * Grades label matched as expected'); - } - }, - - //K grade checkbox - { - description: 'Verify K grade checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('38')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"K grade" checkbox icon not found'); - } - console.log('Passed: K grade checkbox icon present'); - } - }, - - //K grade label - { - description: 'Validate K grade label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(3) > .form-check-label')).getText(); - if (elementText !== 'K') { - throw new Error(`Expected: "K grade"; Actual: "${elementText}"`); - } - console.log('Passed: K grade label matched as expected'); - } - }, - - //Grade 1 checkbox - { - description: 'Verify grade 1 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('39')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 1" checkbox icon not found'); - } - console.log('Passed: Grade 1 checkbox icon present'); - } - }, - - //Grade 1 label - { - description: 'Validate grade 1 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(4) > .form-check-label')).getText(); - if (elementText !== '1') { - throw new Error(`Expected: "Grade 1"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 1 label matched as expected'); - } - }, - - //Grade 2 checkbox - { - description: 'Verify grade 2 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('40')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 2" checkbox icon not found'); - } - console.log('Passed: Grade 2 checkbox icon present'); - } - }, - - //Grade 2 label - { - description: 'Validate grade 2 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(5) > .form-check-label')).getText(); - if (elementText !== '2') { - throw new Error(`Expected: "Grade 2"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 2 label matched as expected'); - } - }, - - //Grade 3 checkbox - { - description: 'Verify grade 3 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('41')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 3" checkbox icon not found'); - } - console.log('Passed: Grade 3 checkbox icon present'); - } - }, - - //Grade 3 label - { - description: 'Validate grade 3 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(6) > .form-check-label')).getText(); - if (elementText !== '3') { - throw new Error(`Expected: "Grade 3"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 3 label matched as expected'); - } - }, - - //Grade 4 checkbox - { - description: 'Verify grade 4 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('43')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 4" checkbox icon not found'); - } - console.log('Passed: Grade 4 checkbox icon present'); - } - }, - - //Grade 4 label - { - description: 'Validate grade 4 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(7) > .form-check-label')).getText(); - if (elementText !== '4') { - throw new Error(`Expected: "Grade 4"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 4 label matched as expected'); - } - }, - - //Grade 5 checkbox - { - description: 'Verify grade 5 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('44')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 5" checkbox icon not found'); - } - console.log('Passed: Grade 5 checkbox icon present'); - } - }, - - //Grade 5 label - { - description: 'Validate grade 5 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(8) > .form-check-label')).getText(); - if (elementText !== '5') { - throw new Error(`Expected: "Grade 5"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 5 label matched as expected'); - } - }, - - //Grade 6 checkbox - { - description: 'Verify grade 6 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('45')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 6" checkbox icon not found'); - } - console.log('Passed: Grade 6 checkbox icon present'); - } - }, - - //Grade 6 label - { - description: 'Validate grade 6 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(9) > .form-check-label')).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.id('47')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 7" checkbox icon not found'); - } - console.log('Passed: Grade 7 checkbox icon present'); - } - }, - - //Grade 7 label - { - description: 'Validate grade 7 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(10) > .form-check-label')).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.id('48')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 8" checkbox icon not found'); - } - console.log('Passed: Grade 8 checkbox icon present'); - } - }, - - //Grade 8 label - { - description: 'Validate grade 8 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(11) > .form-check-label')).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.id('49')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 9" checkbox icon not found'); - } - console.log('Passed: Grade 9 checkbox icon present'); - } - }, - - //Grade 9 label - { - description: 'Validate grade 9 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(12) > .form-check-label')).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.id('51')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 10" checkbox icon not found'); - } - console.log('Passed: Grade 10 checkbox icon present'); - } - }, - - //Grade 10 label - { - description: 'Validate grade 10 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(13) > .form-check-label')).getText(); - if (elementText !== '10') { - throw new Error(`Expected: "Grade 10"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 10 label matched as expected'); - } - }, - - //Grade 11 checkbox - { - description: 'Verify grade 11 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('52')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 11" checkbox icon not found'); - } - console.log('Passed: Grade 11 checkbox icon present'); - } - }, - - //Grade 11 label - { - description: 'Validate grade 11 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(14) > .form-check-label')).getText(); - if (elementText !== '11') { - throw new Error(`Expected: "Grade 11"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 11 label matched as expected'); - } - }, - - //Grade 12 checkbox - { - description: 'Verify grade 12 checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.id('53')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('"Grade 12" checkbox icon not found'); - } - console.log('Passed: Grade 12 checkbox icon present'); - } - }, - - //Grade 12 label - { - description: 'Validate grade 12 label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-check:nth-child(15) > .form-check-label')).getText(); - if (elementText !== '12') { - throw new Error(`Expected: "Grade 12"; Actual: "${elementText}"`); - } - console.log('Passed: Grade 12 label matched as expected'); - } - }, - - //Submit button text - { - description: 'Validate Submit button text', - action: async () => { - const elementText = await driver.findElement(By.css('.float-right:nth-child(5) > .btn:nth-child(1)')).getAttribute('value'); - if (elementText !== 'Submit') { - throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); - } - console.log('Passed: Submit button text matched as expected'); - } - }, - - //Submit button color -green - { - description: 'Validate Submit button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.float-right:nth-child(5) > .btn:nth-child(1)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Submit button color matched as expected'); - } - }, - - //NEXT ACTION - Click Metadata tab - { description: 'Click Metadata tab', action: async () => await driver.findElement(By.css('#tab-tabsr-3')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Resource tab title - { - description: 'Validate Resource tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-1')).getText(); - if (elementText !== 'Resource') { - throw new Error(`Expected: "Resource" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Resource tab title matched as expected'); - } - }, - - //Resource tab title color -gray (dimmed) - { - description: 'Validate Resource tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-1')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 1)') { - throw new Error(`Resource tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Resource tab title color matched as expected'); - } - }, - - //Metadata tab title - { - description: 'Validate Metadata tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-3')).getText(); - if (elementText !== 'Metadata') { - throw new Error(`Expected: "Metadata" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Metadata tab title matched as expected'); - } - }, - - //Metadata tab title color -dark blue (active) - { - description: 'Validate Metadata tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-3')).getCssValue('color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Metadata tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Metadata tab title color matched as expected'); - } - }, - - //Concepts tab title - { - description: 'Validate Concepts tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-4')).getText(); - if (elementText !== 'Concepts') { - throw new Error(`Expected: "Concepts" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Concepts tab title matched as expected'); - } - }, - - //Concepts tab title color -gray (dimmed) - { - description: 'Validate Concepts tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-4')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 1)') { - throw new Error(`Concepts tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Concepts tab title color matched as expected'); - } - }, - - //Field Name label - { - description: 'Validate Field Name label', - action: async () => { - const elementText = await driver.findElement(By.css('#tabsr-4 > div:nth-child(1) > b')).getText(); - if (elementText !== 'Field Name') { - throw new Error(`Expected: "Field Name" label; Actual: "${elementText}"`); - } - console.log('Passed: Field Name label matched as expected'); - } - }, - - //Submit button text - { - description: 'Validate Submit button text', - action: async () => { - const elementText = await driver.findElement(By.css('.float-right:nth-child(3) > .btn')).getAttribute('value'); - if (elementText !== 'Submit') { - throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); - } - console.log('Passed: Submit button text matched as expected'); - } - }, - - //Submit button color -green - { - description: 'Validate Submit button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.float-right:nth-child(3) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Submit button color matched as expected'); - } - }, - - //Field Name dropdown placeholder - { - description: 'Validate Field Name dropdown placeholder', - action: async () => { - const elementText = await driver.findElement(By.css('.combobox:nth-child(1)')).getAttribute('placeholder'); - if (elementText !== 'Select/Enter Field...') { - throw new Error(`Expected: "Select/Enter Field..." dropdown placeholder did not match; Actual: "${elementText}"`); - } - console.log('Passed: Select/Enter Field... dropdown placeholder matched as expected'); - } - }, - - //Value label - { - description: 'Validate Value label', - action: async () => { - const elementText = await driver.findElement(By.css('#tabsr-4 > div:nth-child(2) > b')).getText(); - if (elementText !== 'Value') { - throw new Error(`Expected: "Value" label; Actual: "${elementText}"`); - } - console.log('Passed: Value label matched as expected'); - } - }, - - //Value textbox placeholder - { - description: 'Validate Value textbox placeholder', - action: async () => { - const elementText = await driver.findElement(By.css('#meta_value')).getAttribute('value'); - if (elementText !== '') { - throw new Error(`Expected: Empty Value textbox did not match; Actual: "${elementText}"`); - } - console.log('Passed: Empty Value textbox matched as expected'); - } - }, - - //Add Metadata button text - { - description: 'Validate Add Metadata button text', - action: async () => { - const elementText = await driver.findElement(By.css('.btn:nth-child(5)')).getAttribute('value'); - if (elementText !== 'Add Metadata') { - throw new Error(`Expected: "Add Metadata" button text; Actual: "${elementText}"`); - } - console.log('Passed: Add Metadata button text matched as expected'); - } - }, - - //Add Metadata button color -green - { - description: 'Validate Add Metadata button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.btn:nth-child(5)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Add Metadata button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Add Metadata button color matched as expected'); - } - }, - - //Current Metadata title - { - description: 'Validate Current Metadata title', - action: async () => { - const elementText = await driver.findElement(By.css('span:nth-child(7)')).getText(); - if (elementText !== 'Current Metadata') { - throw new Error(`Expected: "Current Metadata" title; Actual: "${elementText}"`); - } - console.log('Passed: Current Metadata title matched as expected'); - } - }, - - //Name label - { - description: 'Validate Name label', - action: async () => { - const elementText = await driver.findElement(By.css('td:nth-child(1) > span')).getText(); - if (elementText !== 'Name') { - throw new Error(`Expected: "Name" label; Actual: "${elementText}"`); - } - console.log('Passed: Name label matched as expected'); - } - }, - - //Data label - { - description: 'Validate Data label', - action: async () => { - const elementText = await driver.findElement(By.css('td:nth-child(2) > span')).getText(); - if (elementText !== 'Data') { - throw new Error(`Expected: "Data" label; Actual: "${elementText}"`); - } - console.log('Passed: Data label matched as expected'); - } - }, - - //No metadata defined text - { - description: 'Validate No metadata defined text', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(2) > td')).getText(); - if (elementText !== 'No metadata defined.') { - throw new Error(`Expected: "No metadata defined." text; Actual: "${elementText}"`); - } - console.log('Passed: No metadata defined. text matched as expected'); - } - }, - - //Submit button text - { - description: 'Validate Submit button text', - action: async () => { - const elementText = await driver.findElement(By.css('.float-right:nth-child(5) > .btn:nth-child(1)')).getAttribute('value'); - if (elementText !== 'Submit') { - throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); - } - console.log('Passed: Submit button text matched as expected'); - } - }, - - //Submit button color -green - { - description: 'Validate Submit button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.float-right:nth-child(5) > .btn:nth-child(1)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Submit button color matched as expected'); - } - }, - - //NEXT ACTION - Click Concepts tab - { description: 'Click Concepts tab', action: async () => await driver.findElement(By.css('#tab-tabsr-4')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Resource tab title - { - description: 'Validate Resource tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-1')).getText(); - if (elementText !== 'Resource') { - throw new Error(`Expected: "Resource" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Resource tab title matched as expected'); - } - }, - - //Resource tab title color -gray (dimmed) - { - description: 'Validate Resource tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-1')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 1)') { - throw new Error(`Resource tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Resource tab title color matched as expected'); - } - }, - - //Metadata tab title - { - description: 'Validate Metadata tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-3')).getText(); - if (elementText !== 'Metadata') { - throw new Error(`Expected: "Metadata" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Metadata tab title matched as expected'); - } - }, - - //Metadata tab title color -gray (dimmed) - { - description: 'Validate Metadata tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-3')).getCssValue('color'); - if (elementStyle !== 'rgba(182, 186, 181, 1)') { - throw new Error(`Metadata tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Metadata tab title color matched as expected'); - } - }, - - //Concepts tab title - { - description: 'Validate Concepts tab title', - action: async () => { - const elementText = await driver.findElement(By.css('#tab-tabsr-4')).getText(); - if (elementText !== 'Concepts') { - throw new Error(`Expected: "Concepts" tab title; Actual: "${elementText}"`); - } - console.log('Passed: Concepts tab title matched as expected'); - } - }, - - //Concepts tab title color -dark blue (active) - { - description: 'Validate Concepts tab title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tab-tabsr-4')).getCssValue('color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Concepts tab title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Concepts tab title color matched as expected'); - } - }, - - //Required label - { - description: 'Validate Required label', - action: async () => { - const elementText = await driver.findElement(By.css('#tabsr-3 > span:nth-child(1)')).getText(); - if (elementText !== '* Required') { - throw new Error(`Expected: "* Required" label; Actual: "${elementText}"`); - } - console.log('Passed: * Required label matched as expected'); - } - }, - - //Required label color -red - { - description: 'Validate Required label color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tabsr-3 > span:nth-child(1)')).getCssValue('color'); - if (elementStyle !== 'rgba(255, 0, 0, 1)') { - throw new Error(`Required label color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Required label color matched as expected'); - } - }, - - //Submit button text - { - description: 'Validate Submit button text', - action: async () => { - const elementText = await driver.findElement(By.css('.float-right:nth-child(3) > .btn')).getAttribute('value'); - if (elementText !== 'Submit') { - throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); - } - console.log('Passed: Submit button text matched as expected'); - } - }, - - //Submit button color -green - { - description: 'Validate Submit button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.float-right:nth-child(3) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Submit button color matched as expected'); - } - }, - - //Concept List label - { - description: 'Validate Concept List label', - action: async () => { - try { - const element = await driver.findElement(By.css('#tabsr-3')); - - //Get different versions of the text for debugging - const fullText = await element.getText(); - - //Check for the expected text in different ways - const expectedText = '* Concept List'; - const trimmedFullText = fullText.trim(); - const firstLine = trimmedFullText.split('\n')[0].trim(); - - //Try multiple matching strategies - if (firstLine.includes(expectedText)) { - console.log(`Passed: "${expectedText}" text in first line`); - } else if (trimmedFullText.includes(expectedText)) { - console.log(`Passed: "${expectedText}" text within full text`); - } else { - throw new Error( - `Text validation failed.\nExpected: "${expectedText}"\n` + - `Full text: "${fullText}"\n` + - `First line: "${firstLine}"\n` - ); - } - - } catch (error) { - console.error('Detailed error during validation:', error); - throw error; //Re-throw after logging - } - } - }, - - //Concept 1 checkbox selected - { - description: 'Validate Concept 1 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\31 68638762')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Concept 1 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Concept 1 checkbox is selected as expected'); - } - }, - - //Concept 1 label - { - description: 'Validate Concept 1 label', - action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(1) > label')).getText(); - if (elementText !== 'Mathematics | Process Standards | Problem Solving | Methods/Steps/Strategies') { - throw new Error(`Expected: "Mathematics | Process Standards | Problem Solving | Methods/Steps/Strategies" label; Actual: "${elementText}"`); - } - console.log('Passed: Concept 1 label matched as expected'); - } - }, - - //Concept 2 checkbox selected - { - description: 'Validate Concept 2 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\31 68638753')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Concept 2 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Concept 2 checkbox is selected as expected'); - } - }, - - //Concept 2 label - { - description: 'Validate Concept 2 label', - action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) > label')).getText(); - if (elementText !== 'Mathematics | Process Standards | Computation | Methods/Steps/Strategies') { - throw new Error(`Expected: "Mathematics | Process Standards | Computation | Methods/Steps/Strategies" label; Actual: "${elementText}"`); - } - console.log('Passed: Concept 2 label matched as expected'); - } - }, - - //Concept 3 checkbox selected - { - description: 'Validate Concept 3 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\36 62108736')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Concept 3 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Concept 3 checkbox is selected as expected'); - } - }, - - //Concept 3 label - { - description: 'Validate Concept 3 label', - action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) > label')).getText(); - if (elementText !== 'Mathematics | Internal Use | CCSS.MP1') { - throw new Error(`Expected: "Mathematics | Internal Use | CCSS.MP1" label; Actual: "${elementText}"`); - } - console.log('Passed: Concept 3 label matched as expected'); - } - }, - - //Concept 4 checkbox selected - { - description: 'Validate Concept 4 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#\\36 68294786')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Concept 4 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Concept 4 checkbox is selected as expected'); - } - }, - - //Concept 4 label - { - description: 'Validate Concept 4 label', - action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(4) > label')).getText(); - if (elementText !== 'Mathematics | Project Carrot | add to standards') { - throw new Error(`Expected: "Mathematics | Project Carrot | add to standards" label; Actual: "${elementText}"`); - } - console.log('Passed: Concept 4 label matched as expected'); - } - }, - - //Instruction text - { - description: 'Validate Instruction text', - action: async () => { - const elementText = await driver.findElement(By.css('small:nth-child(3) > em')).getText(); - if (elementText !== 'Uncheck any concepts you do not wish to tag to this resource.') { - throw new Error(`Expected: "Uncheck any concepts you do not wish to tag to this resource." label; Actual: "${elementText}"`); - } - console.log('Passed: Instruction text matched as expected'); - } - }, - - //Submit button text - { - description: 'Validate Submit button text', - action: async () => { - const elementText = await driver.findElement(By.css('.float-right:nth-child(5) > .btn:nth-child(1)')).getAttribute('value'); - if (elementText !== 'Submit') { - throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); - } - console.log('Passed: Submit button text matched as expected'); - } - }, - - //Submit button color -green - { - description: 'Validate Submit button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.float-right:nth-child(5) > .btn:nth-child(1)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Submit button color matched as expected'); - } - }, - - //NEXT ACTION - Click X icon - { description: 'Click X icon to close DIV', action: async () => await driver.findElement(By.css('.modal-header span')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Aligned content 1 button text - { - description: 'Validate Aligned content 1 button text', - action: async () => { - const elementText = await driver.findElement(By.css('#corr-599773300-tab')).getText(); - if (elementText !== 'Aligned Content 2') { - throw new Error(`Expected: "Aligned Content" button text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content button text matched as expected'); - } - }, - - //Aligned content 1 button color -blue (active) - { - description: 'Validate Aligned content 1 button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#corr-599773300-tab')).getCssValue('background-color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Aligned content 1 button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Aligned content 1 button color matched as expected'); - } - }, - - //Aligned content 1 count - { - description: 'Validate Aligned content 1 count button text', - action: async () => { - const elementText = await driver.findElement(By.css('#count599773300')).getText(); - if (elementText !== '2') { - throw new Error(`Expected: Aligned Content 1 count "2"t; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 count 2 matched as expected'); - } - }, - - //Aligned content 1 carrot icon - { - description: 'Verify Aligned content 1 carrot icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#colstate599773300')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Aligned content 1 carrot icon is not found'); - } - console.log('Passed: Aligned content 1 carrot icon present'); - } - }, - - //Related standards 1 button text - { - description: 'Validate Related standards 1 button text', - action: async () => { - const elementText = await driver.findElement(By.css('#rel-599773300-tab')).getText(); - if (elementText !== 'Related Standards 13') { - throw new Error(`Expected: "Related Standards" button text; Actual: "${elementText}"`); - } - console.log('Passed: Related Standards button text matched as expected'); - } - }, - - //Related standards 1 count - { - description: 'Validate Related standards 1 count button text', - action: async () => { - const elementText = await driver.findElement(By.css('#relcount599773300')).getText(); - if (elementText !== '13') { - throw new Error(`Expected: Related standards 1 count "13"t; Actual: "${elementText}"`); - } - console.log('Passed: Related standards 1 count 13 matched as expected'); - } - }, - - //Related standards 1 button color -white (dimmed) - { - description: 'Validate Related standards 1 button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#rel-599773300-tab')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Related standards 1 button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Related standards 1 button color matched as expected'); - } - }, - - //Add Direct Alignment 1 add icon - { - description: 'Verify Add Direct Alignment 1 add icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#add-599773300-tab > .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Add Direct Alignment 1 add icon is not found'); - } - console.log('Passed: Add Direct Alignment 1 add icon present'); - } - }, - - //Add Direct Alignment 1 button text - { - description: 'Validate Add Direct Alignment 1 button text', - action: async () => { - const elementText = await driver.findElement(By.css('#add-599773300-tab')).getText(); - if (elementText !== 'Add Direct Alignment') { - throw new Error(`Expected: "Add Direct Alignment" button text; Actual: "${elementText}"`); - } - console.log('Passed: Add Direct Alignment button text matched as expected'); - } - }, - - //Add Direct Alignment 1 button color -white (dimmed) - { - description: 'Validate Add Direct Alignment 1 button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#add-599773300-tab')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Add Direct Alignment 1 button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Add Direct Alignment 1 button color matched as expected'); - } - }, - - //NEXT ACTION - Click Aligned Content button - { description: 'Click Aligned Content 1 button', action: async () => await driver.findElement(By.css('#colstate599773300')).click() }, - - //Wait for button to be present - { - description: 'Wait for button to be present', - action: async () => { - return await driver.wait(until.elementLocated(By.css('#opennew599773300')), 10000).catch(() => false); - } - }, - - //Standard 1 Open Alignments in New Window - { - description: 'Verify Standard 1 Open Alignments in New Window icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-external-link')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Standard 1 Open Alignments in New Window icon is not found'); - } - console.log('Passed: Standard 1 Open Alignments in New Window icon present'); - } - }, - - //Standard 1 Open Alignments in New Window button text - { - description: 'Validate Standard 1 Open Alignments in New Window button text', - action: async () => { - const elementText = await driver.findElement(By.css('#opennew599773300')).getText(); - if (elementText !== 'Open Alignments in New Window') { - throw new Error(`Expected: Standard 1 "Open Alignments in New Window" button text; Actual: "${elementText}"`); - } - console.log('Passed: Standard 1 Open Alignments in New Window button text matched as expected'); - } - }, - - //Standard 1 Open Alignments in New Window button color -green - { - description: 'Validate Standard 1 Open Alignments in New Window button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#opennew599773300')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Standard 1 Open Alignments in New Window button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Standard 1 Open Alignments in New Window button color matched as expected'); - } - }, - - //Subject 1 title - { - description: 'Validate Subject 1 title', - action: async () => { - const elementText = await driver.findElement(By.css('td > b')).getText(); - if (elementText !== 'Geometry - QA') { - throw new Error(`Expected: "Geometry - QA" title; Actual: "${elementText}"`); - } - console.log('Passed: Geometry - QA title matched as expected'); - } - }, - - //Subject 1 grade K column title - { - description: 'Validate Subject 1 grade K column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(2)')).getText(); - if (elementText !== 'K') { - throw new Error(`Expected: Grade "K" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade K column title matched as expected'); - } - }, - - //Subject 1 grade 1 column title - { - description: 'Validate Subject 1 grade 1 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(3)')).getText(); - if (elementText !== '1') { - throw new Error(`Expected: Grade "1" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 1 column title matched as expected'); - } - }, - - //Subject 1 grade 2 column title - { - description: 'Validate Subject 1 grade 2 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(4)')).getText(); - if (elementText !== '2') { - throw new Error(`Expected: Grade "2" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 2 column title matched as expected'); - } - }, - - //Subject 1 grade 3 column title - { - description: 'Validate Subject 1 grade 3 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(5)')).getText(); - if (elementText !== '3') { - throw new Error(`Expected: Grade "3" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 3 column title matched as expected'); - } - }, - - //Subject 1 grade 4 column title - { - description: 'Validate Subject 1 grade 4 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(6)')).getText(); - if (elementText !== '4') { - throw new Error(`Expected: Grade "4" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 4 column title matched as expected'); - } - }, - - //Subject 1 grade 5 column title - { - description: 'Validate Subject 1 grade 5 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(7)')).getText(); - if (elementText !== '5') { - throw new Error(`Expected: Grade "5" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 5 column title matched as expected'); - } - }, - - //Subject 1 grade 6 column title - { - description: 'Validate Subject 1 grade 6 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(8)')).getText(); - if (elementText !== '6') { - throw new Error(`Expected: Grade "6" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 6 column title matched as expected'); - } - }, - - //Subject 1 grade 7 column title - { - description: 'Validate Subject 1 grade 7 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(9)')).getText(); - if (elementText !== '7') { - throw new Error(`Expected: Grade "7" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 7 column title matched as expected'); - } - }, - - //Subject 1 grade 8 column title - { - description: 'Validate Subject 1 grade 8 column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .grades-reviewed')).getText(); - if (elementText !== '8') { - throw new Error(`Expected: Grade "8" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 8 column title matched as expected'); - } - }, - - //Subject 1 grade 9 column title - { - description: 'Validate Subject 1 grade 9 column title', - action: async () => { - const elementText = await driver.findElement(By.css('.text-center:nth-child(11)')).getText(); - if (elementText !== '9') { - throw new Error(`Expected: Grade "9" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 9 column title matched as expected'); - } - }, - - //Subject 1 grade 10 column title - { - description: 'Validate Subject 1 grade 10 column title', - action: async () => { - const elementText = await driver.findElement(By.css('.text-center:nth-child(12)')).getText(); - if (elementText !== '10') { - throw new Error(`Expected: Grade "10" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 10 column title matched as expected'); - } - }, - - //Subject 1 grade 11 column title - { - description: 'Validate Subject 1 grade 11 column title', - action: async () => { - const elementText = await driver.findElement(By.css('.text-center:nth-child(13)')).getText(); - if (elementText !== '11') { - throw new Error(`Expected: Grade "11" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 11 column title matched as expected'); - } - }, - - //Subject 1 grade 12 column title - { - description: 'Validate Subject 1 grade 12 column title', - action: async () => { - const elementText = await driver.findElement(By.css('.text-center:nth-child(14)')).getText(); - if (elementText !== '12') { - throw new Error(`Expected: Grade "12" column title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 12 column title matched as expected'); - } - }, - - //Subject 1 Select column title - { - description: 'Validate Select column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(15)')).getText(); - if (elementText !== 'Select') { - throw new Error(`Expected: "Select" column title; Actual: "${elementText}"`); - } - console.log('Passed: Select column title matched as expected'); - } - }, - - //Subject 1 Clear column title - { - description: 'Validate Clear column title', - action: async () => { - const elementText = await driver.findElement(By.css('tr:nth-child(1) > .text-center:nth-child(16)')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: "Clear" column title; Actual: "${elementText}"`); - } - console.log('Passed: Clear column title matched as expected'); - } - }, - - //Aligned Content 1 title - { - description: 'Validate Aligned Content 1 title', - action: async () => { - const elementText = await driver.findElement(By.css('#href599773300873599009')).getText(); - if (elementText !== 'Inversions') { - throw new Error(`Expected: Aligned Content 1 "Inversions" title; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions title matched as expected'); - } - }, - - //Align content 1 title text color -dark gray - { - description: 'Validate Align content 1 title text color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#href599773300873599009')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`Align content 1 title text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Align content 1 title text color matched as expected'); - } - }, - - //Align content 1 info icon color -dark gray - { - description: 'Validate Align content 1 info icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title599773300873599009 > a > .fa')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`Align content 1 info icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Align content 1 info icon color matched as expected'); - } - }, - - //NEXT ACTION - Click Inversions info icon - { description: 'Click Inversions info icon', action: async () => await driver.findElement(By.css('#title599773300873599009 > a > .fa')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Aligned Content 1 Inversions description - { - description: 'Validate Aligned Content 1 Inversions description', - action: async () => { - const elementText = await driver.findElement(By.css('#descr599773300873599009')).getText(); - if (elementText !== 'Learning About Symmetry with Inversions Using inversions words that can be read in more than one wayas the context, students will be introduced to various types of symmetry. After exploring the symmetries that exist with letters of the alphabet, they will make inversions of their own name.') { - throw new Error(`Expected: Aligned Content 1 "Learning About Symmetry with Inversions Using inversions words that can be read in more than one wayas the context, students will be introduced to various types of symmetry. After exploring the symmetries that exist with letters of the alphabet, they will make inversions of their own name." title; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions description matched as expected'); - } - }, - - //Align content 1 tag icon color -dark gray - { - description: 'Validate Align content 1 tag icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title599773300873599009 > .fa')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`Align content 1 tag icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Align content 1 tag icon color matched as expected'); - } - }, - - //NEXT ACTION - Click Inversions tag icon - { description: 'Click Inversions tag icon', action: async () => await driver.findElement(By.css('#title599773300873599009 > .fa')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Alginged content 1 Inversions primary toggle icon - { - description: 'Verify Alginged content 1 Inversions primary toggle icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#concept-873599009-599773300-168638762 label')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 Inversions primary toggle icon not found'); - } - console.log('Passed: Alginged Content 1 Inversions primary toggle icon present'); - } - }, - - //Aligned Content 1 Inversions tag title - { - description: 'Validate Aligned Content 1 Inversions tag title', - action: async () => { - const elementText = await driver.findElement(By.css('#concept_div599773300873599009 > h6')).getText(); - if (elementText !== 'Aligment created by these matching concepts') { - throw new Error(`Expected: Aligned Content 1 "Aligment created by these matching concepts" tag title; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions tag title matched as expected'); - } - }, - - //Aligned Content 1 Inversions tag breadcrumbs - { - description: 'Validate Aligned Content 1 Inversions tag breadcrumbs', - action: async () => { - const elementText = await driver.findElement(By.css('#concept-873599009-599773300-168638762 > td:nth-child(2)')).getText(); - if (elementText !== 'Mathematics -> Process Standards -> Problem Solving -> Methods/Steps/Strategies') { - throw new Error(`Expected: Aligned Content 1 "Mathematics -> Process Standards -> Problem Solving -> Methods/Steps/Strategies" breadcrumbs; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions tag breadcrumbs matched as expected'); - } - }, - - //Align content 1 Inversions x icon -tooltip - { - description: 'Validate Align content 1 Inversions x icon tool-tip', - action: async () => { - const elementStyle = await driver.findElement(By.css('#concept-873599009-599773300-168638762 > td:nth-child(3) > span')).getAttribute('title'); - if (elementStyle !== 'Click here to remove this concept') { - throw new Error(`Expected: "Click here to remove this concept"; Actual: "${elementStyle}"`); - } - console.log('Passed: Click here to remove this concept tool-tip matched as expected'); - } - }, - - //NEXT ACTION - Click X icon - { description: 'Click X icon to remove concept', action: async () => await driver.findElement(By.css('#concept-873599009-599773300-168638762 .fa')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Aligned Content 1 Inversions remove concept DIV header - { - description: 'Validate Aligned Content 1 Inversions remove concept DIV header', - action: async () => { - const elementText = await driver.findElement(By.css('#toast-873599009-599773300-168638762 .mr-auto')).getText(); - if (elementText !== 'Remove Concept') { - throw new Error(`Expected: Aligned Content 1, remove DIV header "Remove Concept"; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions remove concept DIV header matched as expected'); - } - }, - - //Aligned Content 1 Inversions remove concept DIV description - { - description: 'Validate Aligned Content 1 Inversions remove concept DIV description', - action: async () => { - const elementText = await driver.findElement(By.css('#toast-873599009-599773300-168638762 > .toast-body > div')).getText(); - if (elementText !== 'Are you sure you want to remove this concept from this item? This will affect alignments on other standards as well.') { - throw new Error(`Expected: Aligned Content 1, remove DIV description "Are you sure you want to remove this concept from this item? This will affect alignments on other standards as well."; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions remove concept DIV description matched as expected'); - } - }, - - //Aligned Content 1 Inversions remove concept DIV OK text - { - description: 'Validate Aligned Content 1 Inversions remove concept DIV OK text', - action: async () => { - const elementText = await driver.findElement(By.css('#toast-873599009-599773300-168638762 > div.toast-body.text-success > button:nth-child(2)')).getText(); - if (elementText !== 'Yes') { - throw new Error(`Expected: Aligned Content 1 Inversions, remove concept DIV "OK" text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions, remove concept DIV OK button text'); - } - }, - - //Aligned Content 1 Inversions remove concept DIV No text - { - description: 'Validate Aligned Content 1 Inversions remove concept DIV No text', - action: async () => { - const elementText = await driver.findElement(By.css('#toast-873599009-599773300-168638762 .btn')).getText(); - if (elementText !== 'No') { - throw new Error(`Expected: Aligned Content 1 Inversions, remove concept DIV "No" text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Inversions, remove concept DIV No button text'); - } - }, - - //NEXT ACTION - Click No button - { description: 'Click No button to remove concept DIV', action: async () => await driver.findElement(By.css('#toast-873599009-599773300-168638762 .btn')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Alginged content 1 Inversions remove concepts icon - { - description: 'Verify Alginged content 1 Inversions remove concepts icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#concept-873599009-599773300-168638762 > td:nth-child(3) > span > i')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 Inversions remove concepts icon not found'); - } - console.log('Passed: Alginged Content 1 Inversions remove concepts icon present'); - } - }, - - //Alginged content 1 grade 3 check icon - { - description: 'Verify Alginged content 1 grade 3 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 1_599772973_873599009 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 grade 3 check icon not found'); - } - console.log('Passed: Alginged Content 1 grade 3 check icon present'); - } - }, - - //Alginged content 1 grade 4 check icon - { - description: 'Verify Alginged content 1 grade 4 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 3_599773035_873599009 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 grade 4 check icon not found'); - } - console.log('Passed: Alginged Content 1 grade 4 check icon present'); - } - }, - - //Alginged content 1 grade 5 check icon - { - description: 'Verify Alginged content 1 grade 5 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 4_599773098_873599009 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 grade 5 check icon not found'); - } - console.log('Passed: Alginged Content 1 grade 5 check icon present'); - } - }, - - //Alginged content 1 grade 6 check icon - { - description: 'Verify Alginged content 1 grade 6 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 5_599773163_873599009 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 grade 6 check icon not found'); - } - console.log('Passed: Alginged Content 1 grade 6 check icon present'); - } - }, - - //Alginged content 1 grade 7 check icon - { - description: 'Verify Alginged content 1 grade 7 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 7_599773234_873599009 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 grade 7 check icon not found'); - } - console.log('Passed: Alginged Content 1 grade 7 check icon present'); - } - }, - - //Alginged content 1 grade 8 check icon - { - description: 'Verify Alginged content 1 grade 8 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 8_599773300_873599009 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 1 grade 8 check icon not found'); - } - console.log('Passed: Alginged Content 1 grade 8 check icon present'); - } - }, - - //Aligned Content 1 all button text - { - description: 'Validate Aligned Content 1 all button text', - action: async () => { - const elementText = await driver.findElement(By.css('#tr599773300873599009 > td:nth-child(15) > button')).getText(); - if (elementText !== 'All') { - throw new Error(`Expected: Aligned Content 1 "All" button text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 All button text matched as expected'); - } - }, - - //Aligned Content 1 all button color -gray - { - description: 'Validate Aligned Content 1 all button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tr599773300873599009 > td:nth-child(15) > button')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Aligned Content 1 all button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Aligned Content 1 all button color matched as expected'); - } - }, - - //Aligned Content 1 clear button text - { - description: 'Validate Aligned Content 1 clear button text', - action: async () => { - const elementText = await driver.findElement(By.css('#tr599773300873599009 > td:nth-child(16) > button')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: Aligned Content 1 "Clear" button text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 Clear button text matched as expected'); - } - }, - - //Aligned Content 1 clear button color -gray - { - description: 'Validate Aligned Content 1 clear button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tr599773300873599009 > td:nth-child(16) > button')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Aligned Content 1 clear button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Aligned Content 1 Clear button color matched as expected'); - } - }, - - //Aligned Content 2 title - { - description: 'Validate Aligned Content 2 title', - action: async () => { - const elementText = await driver.findElement(By.css('#href599773300873599383')).getText(); - if (elementText !== 'Turtle Pond') { - throw new Error(`Expected: Aligned Content 2 "Turtle Pond" title; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 2 Turtle Pond title matched as expected'); - } - }, - - //Align content 2 title text color -dark gray - { - description: 'Validate Align content 2 title text color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#href599773300873599383')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`Align content 2 title text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Align content 2 title text color matched as expected'); - } - }, - - //Align content 2 info icon -tooltip - { - description: 'Validate Align content 2 info icon tool-tip', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title599773300873599383 > a:nth-child(2)')).getAttribute('title'); - if (elementStyle !== 'Click to view item description') { - throw new Error(`Expected: "Click to view item description"; Actual: "${elementStyle}"`); - } - console.log('Passed: Click to view item description tool-tip matched as expected'); - } - }, - - //Align content 2 info icon color -dark gray - { - description: 'Validate Align content 2 info icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title599773300873599383 > a > .fa')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`Align content 2 info icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Align content 2 info icon color matched as expected'); - } - }, - - //Align content 2 tag icon -tooltip - { - description: 'Validate Align content 2 tag icon tool-tip', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title599773300873599383 > .fa')).getAttribute('title'); - if (elementStyle !== 'View Matching Concepts') { - throw new Error(`Expected: "View Matching Concepts"; Actual: "${elementStyle}"`); - } - console.log('Passed: View Matching Concepts tool-tip matched as expected'); - } - }, - - //Align content 2 tag icon color -dark gray - { - description: 'Validate Align content 2 tag icon color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#title599773300873599383 > .fa')).getCssValue('color'); - if (elementStyle !== 'rgba(73, 80, 87, 1)') { - throw new Error(`Align content 2 tag icon color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Align content 2 tag icon color matched as expected'); - } - }, - - //Alginged content 2 grade K check icon - { - description: 'Verify Alginged content 2 grade 3 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\33 8_599772826_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade K check icon not found'); - } - console.log('Passed: Alginged Content 2 grade K check icon present'); - } - }, - - //Alginged content 2 grade 1 check icon - { - description: 'Verify Alginged content 2 grade 1 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\33 9_599772874_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 1 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 1 check icon present'); - } - }, - - //Alginged content 2 grade 2 check icon - { - description: 'Verify Alginged content 2 grade 2 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\33 9_599772874_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 2 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 2 check icon present'); - } - }, - - //Alginged content 2 grade 3 check icon - { - description: 'Verify Alginged content 2 grade 3 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 1_599772973_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 3 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 3 check icon present'); - } - }, - - //Alginged content 2 grade 4 check icon - { - description: 'Verify Alginged content 2 grade 4 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 3_599773035_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 4 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 4 check icon present'); - } - }, - - //Alginged content 2 grade 5 check icon - { - description: 'Verify Alginged content 2 grade 5 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 4_599773098_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 5 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 5 check icon present'); - } - }, - - //Alginged content 2 grade 6 check icon - { - description: 'Verify Alginged content 2 grade 6 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 5_599773163_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 6 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 6 check icon present'); - } - }, - - //Alginged content 2 grade 7 check icon - { - description: 'Verify Alginged content 2 grade 7 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 7_599773234_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 7 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 7 check icon present'); - } - }, - - //Alginged content 2 grade 8 check icon - { - description: 'Verify Alginged content 2 grade 8 check icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#\\34 8_599773300_873599383 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Alginged Content 2 grade 8 check icon not found'); - } - console.log('Passed: Alginged Content 2 grade 8 check icon present'); - } - }, - - //Aligned Content 2 all button text - { - description: 'Validate Aligned Content 2 all button text', - action: async () => { - const elementText = await driver.findElement(By.css('#tr599773300873599383 > td:nth-child(15) > button')).getText(); - if (elementText !== 'All') { - throw new Error(`Expected: Aligned Content 2 "All" button text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 2 All button text matched as expected'); - } - }, - - //Aligned Content 2 all button color -gray - { - description: 'Validate Aligned Content 2 all button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tr599773300873599383 > td:nth-child(15) > button')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Aligned Content 2 all button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Aligned Content 2 all button color matched as expected'); - } - }, - - //Aligned Content 2 clear button text - { - description: 'Validate Aligned Content 2 clear button text', - action: async () => { - const elementText = await driver.findElement(By.css('#tr599773300873599383 > td:nth-child(16) > button')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: Aligned Content 2 "Clear" button text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 2 Clear button text matched as expected'); - } - }, - - //Aligned Content 2 clear button color -gray - { - description: 'Validate Aligned Content 2 clear button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#tr599773300873599383 > td:nth-child(16) > button')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Aligned Content 2 clear button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Aligned Content 2 Clear button color matched as expected'); - } - }, - - //NEXT ACTION - Click Related Standards button - { description: 'Click Related Standards button', action: async () => await driver.findElement(By.css('#rel-599773300-tab')).click() }, - - //Wait for tab to load - { - description: 'Wait for tab to load', - action: async () => { - return await driver.wait(until.elementLocated(By.css('#rel-std-599773300 > .ml-2')), 10000).catch(() => false); - } - }, - - //Aligned content 1 button text - { - description: 'Validate Aligned content 1 button text', - action: async () => { - const elementText = await driver.findElement(By.css('#corr-599773300-tab')).getText(); - if (elementText !== 'Aligned Content 2') { - throw new Error(`Expected: "Aligned Content" button text; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content button text matched as expected'); - } - }, - - //Aligned content 1 button color -blue (dimmed) - { - description: 'Validate Aligned content 1 button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#corr-599773300-tab')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Aligned content 1 button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Aligned content 1 button color matched as expected'); - } - }, - - //Aligned content 1 count - { - description: 'Validate Aligned content 1 count button text', - action: async () => { - const elementText = await driver.findElement(By.css('#count599773300')).getText(); - if (elementText !== '2') { - throw new Error(`Expected: Aligned Content 1 count "2"t; Actual: "${elementText}"`); - } - console.log('Passed: Aligned Content 1 count 2 matched as expected'); - } - }, - - //Aligned content 1 carrot icon - { - description: 'Verify Aligned content 1 carrot icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#colstate599773300')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Aligned content 1 carrot icon is not found'); - } - console.log('Passed: Aligned content 1 carrot icon present'); - } - }, - - //Related standards 1 button text - { - description: 'Validate Related standards 1 button text', - action: async () => { - const elementText = await driver.findElement(By.css('#rel-599773300-tab')).getText(); - if (elementText !== 'Related Standards 13') { - throw new Error(`Expected: "Related Standards" button text; Actual: "${elementText}"`); - } - console.log('Passed: Related Standards button text matched as expected'); - } - }, - - //Related standards 1 count - { - description: 'Validate Related standards 1 count button text', - action: async () => { - const elementText = await driver.findElement(By.css('#relcount599773300')).getText(); - if (elementText !== '13') { - throw new Error(`Expected: Related standards 1 count "13"t; Actual: "${elementText}"`); - } - console.log('Passed: Related standards 1 count 13 matched as expected'); - } - }, - - //Related standards 1 button color -white (active) - { - description: 'Validate Related standards 1 button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#rel-599773300-tab')).getCssValue('background-color'); - if (elementStyle !== 'rgba(40, 39, 90, 1)') { - throw new Error(`Related standards 1 button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Related standards 1 button color matched as expected'); - } - }, - - //Add Direct Alignment 1 add icon - { - description: 'Verify Add Direct Alignment 1 add icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#add-599773300-tab > .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Add Direct Alignment 1 add icon is not found'); - } - console.log('Passed: Add Direct Alignment 1 add icon present'); - } - }, - - //Add Direct Alignment 1 button text - { - description: 'Validate Add Direct Alignment 1 button text', - action: async () => { - const elementText = await driver.findElement(By.css('#add-599773300-tab')).getText(); - if (elementText !== 'Add Direct Alignment') { - throw new Error(`Expected: "Add Direct Alignment" button text; Actual: "${elementText}"`); - } - console.log('Passed: Add Direct Alignment button text matched as expected'); - } - }, - - //Add Direct Alignment 1 button color -white (dimmed) - { - description: 'Validate Add Direct Alignment 1 button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#add-599773300-tab')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Add Direct Alignment 1 button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Add Direct Alignment 1 button color matched as expected'); - } - }, - - //Select All/None checkbox - { - description: 'Verify select AllNone checkbox is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#selectToggle599773300')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Select All/None checkbox not found'); - } - console.log('Passed: Select All/None checkbox present'); - } - }, - - //Select All/None text - { - description: 'Validate Select AllNone text', - action: async () => { - const elementText = await driver.findElement(By.css('#rel-std-599773300 > .ml-2')).getText(); - if (elementText !== 'Select All/None') { - throw new Error(`Expected: "Select All/None" text; Actual: "${elementText}"`); - } - console.log('Passed: Select All/None text matched as expected'); - } - }, - - //Expand All button text - { - description: 'Validate Expand All button text', - action: async () => { - const elementText = await driver.findElement(By.css('#rel-std-599773300 > .btn:nth-child(3)')).getText(); - if (elementText !== 'Expand All') { - throw new Error(`Expected: "Expand All" button text; Actual: "${elementText}"`); - } - console.log('Passed: Expand All button text matched as expected'); - } - }, - - //Expand All button color -green - { - description: 'Validate Expand All button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#rel-std-599773300 > .btn:nth-child(3)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Expand All button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Expand All button color matched as expected'); - } - }, - - //Collapse All button text - { - description: 'Validate Collapse All button text', - action: async () => { - const elementText = await driver.findElement(By.css('#rel-std-599773300 > .btn:nth-child(4)')).getText(); - if (elementText !== 'Collapse All') { - throw new Error(`Expected: "Collapse All" button text; Actual: "${elementText}"`); - } - console.log('Passed: Collapse All button text matched as expected'); - } - }, - - //Collapse All button color -green - { - description: 'Validate Collapse All button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#rel-std-599773300 > .btn:nth-child(4)')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Collapse All button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Collapse All button color matched as expected'); - } - }, - - //Related standard title - { - description: 'Validate Related standard title', - action: async () => { - const elementText = await driver.findElement(By.css('#headingWashington-State-K---12-Learning-Standards-and-Guidelines599773300 > .btn')).getText(); - if (elementText !== 'Washington State K–12 Learning Standards and Guidelines (13 of 13 selected)') { - throw new Error(`Expected: "Washington State K–12 Learning Standards and Guidelines (13 of 13 selected)" title; Actual: "${elementText}"`); - } - console.log('Passed: Related standard title matched as expected'); - } - }, - - /*Related standard title color -green RETURNS 0,0,0,0 - { - description: 'Validate Related standard title color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#headingWashington-State-K---12-Learning-Standards-and-Guidelines599773300 > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Related standard title color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Related standard title color matched as expected'); - } - },*/ - - //NEXT ACTION - Click Related Standards button - { description: 'Click Related Washington State Standards button', action: async () => await driver.findElement(By.css('#headingWashington-State-K---12-Learning-Standards-and-Guidelines599773300 > .btn')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //Related standard Grade K title - { - description: 'Validate Related standard Grade K title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(1) > b')).getText(); - if (elementText !== 'Grade K') { - throw new Error(`Expected: "Grade K" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade K title matched as expected'); - } - }, - - //Grade K checkbox selected - { - description: 'Validate Grade K checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984548')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade K checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade K checkbox is selected as expected'); - } - }, - - //Grade K guideline description text - { - description: 'Validate Grade K guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(2) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade K guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade K guideline description matched as expected'); - } - }, - - //Related standard Grade 1 title - { - description: 'Validate Related standard Grade 1 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(3) > b')).getText(); - if (elementText !== 'Grade 1') { - throw new Error(`Expected: "Grade 1" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 1 title matched as expected'); - } - }, - - //Grade 1 checkbox selected - { - description: 'Validate Grade 1 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984596')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 1 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 1 checkbox is selected as expected'); - } - }, - - //Grade 1 guideline description text - { - description: 'Validate Grade 1 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(4) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 1 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 1 guideline description matched as expected'); - } - }, - - //Related standard Grade 2 title - { - description: 'Validate Related standard Grade 2 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(5) > b')).getText(); - if (elementText !== 'Grade 2') { - throw new Error(`Expected: "Grade 2" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 2 title matched as expected'); - } - }, - - //Grade 2 checkbox selected - { - description: 'Validate Grade 2 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984644')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 2 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 2 checkbox is selected as expected'); - } - }, - - //Grade 2 guideline description text - { - description: 'Validate Grade 2 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(6) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 2 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 2 guideline description matched as expected'); - } - }, - - //Related standard Grade 3 title - { - description: 'Validate Related standard Grade 3 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(7) > b')).getText(); - if (elementText !== 'Grade 3') { - throw new Error(`Expected: "Grade 3" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 3 title matched as expected'); - } - }, - - //Grade 3 checkbox selected - { - description: 'Validate Grade 3 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984695')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 3 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 3 checkbox is selected as expected'); - } - }, - - //Grade 3 guideline description text - { - description: 'Validate Grade 3 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(8) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 3 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 3 guideline description matched as expected'); - } - }, - - //Related standard Grade 4 title - { - description: 'Validate Related standard Grade 4 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(9) > b')).getText(); - if (elementText !== 'Grade 4') { - throw new Error(`Expected: "Grade 4" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 4 title matched as expected'); - } - }, - - //Grade 4 checkbox selected - { - description: 'Validate Grade 4 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984757')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 4 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 4 checkbox is selected as expected'); - } - }, - - //Grade 4 guideline description text - { - description: 'Validate Grade 4 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(10) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 4 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 4 guideline description matched as expected'); - } - }, - - //Related standard Grade 5 title - { - description: 'Validate Related standard Grade 5 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(11) > b')).getText(); - if (elementText !== 'Grade 5') { - throw new Error(`Expected: "Grade 5" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 5 title matched as expected'); - } - }, - - //Grade 5 checkbox selected - { - description: 'Validate Grade 5 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984820')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 5 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 5 checkbox is selected as expected'); - } - }, - - //Grade 5 guideline description text - { - description: 'Validate Grade 5 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(12) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 5 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 5 guideline description matched as expected'); - } - }, - - //Related standard Grade 6 title - { - description: 'Validate Related standard Grade 6 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(13) > b')).getText(); - if (elementText !== 'Grade 6') { - throw new Error(`Expected: "Grade 6" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 6 title matched as expected'); - } - }, - - //Grade 6 checkbox selected - { - description: 'Validate Grade 6 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984885')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 6 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 6 checkbox is selected as expected'); - } - }, - - //Grade 6 guideline description text - { - description: 'Validate Grade 6 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(14) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 6 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 6 guideline description matched as expected'); - } - }, - - //Related standard Grade 7 title - { - description: 'Validate Related standard Grade 7 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(15) > b')).getText(); - if (elementText !== 'Grade 7') { - throw new Error(`Expected: "Grade 7" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 7 title matched as expected'); - } - }, - - //Grade 7 checkbox selected - { - description: 'Validate Grade 7 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677984956')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 7 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 7 checkbox is selected as expected'); - } - }, - - //Grade 7 guideline description text - { - description: 'Validate Grade 7 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(16) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 7 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 7 guideline description matched as expected'); - } - }, - - //Related standard Grade 8 title - { - description: 'Validate Related standard Grade 8 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(17) > b')).getText(); - if (elementText !== 'Grade 8') { - throw new Error(`Expected: "Grade 8" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 8 title matched as expected'); - } - }, - - //Grade 8 checkbox selected - { - description: 'Validate Grade 8 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677985022')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 8 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 8 checkbox is selected as expected'); - } - }, - - //Grade 8 guideline description text - { - description: 'Validate Grade 8 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(18) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 8 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 8 guideline description matched as expected'); - } - }, - - //Related standard Grade 9 title - { - description: 'Validate Related standard Grade 9 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(19) > b')).getText(); - if (elementText !== 'Grade 9') { - throw new Error(`Expected: "Grade 9" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 9 title matched as expected'); - } - }, - - //Grade 9 checkbox selected - { - description: 'Validate Grade 9 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677985082')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 9 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 9 checkbox is selected as expected'); - } - }, - - //Grade 9 guideline description text - { - description: 'Validate Grade 9 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(20) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 9 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 9 guideline description matched as expected'); - } - }, - - //Related standard Grade 10 title - { - description: 'Validate Related standard Grade 10 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(21) > b')).getText(); - if (elementText !== 'Grade 10') { - throw new Error(`Expected: "Grade 10" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 10 title matched as expected'); - } - }, - - //Grade 10 checkbox selected - { - description: 'Validate Grade 10 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677985364')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 10 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 10 checkbox is selected as expected'); - } - }, - - //Grade 10 guideline description text - { - description: 'Validate Grade 10 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(22) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 10 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 10 guideline description matched as expected'); - } - }, - - //Related standard Grade 11 title - { - description: 'Validate Related standard Grade 11 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(23) > b')).getText(); - if (elementText !== 'Grade 11') { - throw new Error(`Expected: "Grade 11" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 11 title matched as expected'); - } - }, - - //Grade 11 checkbox selected - { - description: 'Validate Grade 11 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677985646')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 11 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 11 checkbox is selected as expected'); - } - }, - - //Grade 11 guideline description text - { - description: 'Validate Grade 11 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(24) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 11 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 11 guideline description matched as expected'); - } - }, - - //Related standard Grade 12 title - { - description: 'Validate Related standard Grade 12 title', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(25) > b')).getText(); - if (elementText !== 'Grade 12') { - throw new Error(`Expected: "Grade 12" title; Actual: "${elementText}"`); - } - console.log('Passed: Grade 12 title matched as expected'); - } - }, - - //Grade 12 checkbox selected - { - description: 'Validate Grade 12 checkbox is selected', - action: async () => { - const elementStyle = await driver.findElement(By.css('#chk599773300677985928')).getAttribute('checked'); - if (elementStyle !== 'true') { - throw new Error(`Grade 12 checkbox is not selected; Actual: "${elementStyle}"`); - } - console.log('Passed: Grade 12 checkbox is selected as expected'); - } - }, - - //Grade 12 guideline description text - { - description: 'Validate Grade 12 guideline description text', - action: async () => { - const elementText = await driver.findElement(By.css('#rellist599773300 > .list-group-item:nth-child(26) .form-check-label')).getText(); - if (elementText !== 'MP.1. Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: Grade 12 guideline description "MP.1. Make sense of problems and persevere in solving them."; Actual: "${elementText}"`); - } - console.log('Passed: Grade 12 guideline description matched as expected'); - } - }, - - //NEXT ACTION - Click Collapse All button - { description: 'Click Collapse All button', action: async () => await driver.findElement(By.css('#rel-std-599773300 > .btn:nth-child(4)')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - //NEXT ACTION - Click Add Direct Alignment button - { description: 'Click Add Direct Alignment button', action: async () => await driver.findElement(By.linkText('Add Direct Alignment')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(5000) }, - - //Wait for DIV to open - { - description: 'Wait for DIV to open', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.modal-title')), 10000).catch(() => false); - } - }, - - //Add Direct Alignment DIV title - { - description: 'Validate Add Direct Alignment DIV title', - action: async () => { - const elementText = await driver.findElement(By.css('.modal-title')).getText(); - if (elementText !== 'Add Direct Alignment') { - throw new Error(`Expected: "Add Direct Alignment" DIV title; Actual: "${elementText}"`); - } - console.log('Passed: Add Direct Alignment DIV title matched as expected'); - } - }, - - //Add Direct Alignment Standard tab title - { - description: 'Validate Add Direct Alignment standard tab title', - action: async () => { - const elementText = await driver.findElement(By.linkText('CCSS.Math.Practice.MP1')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1" tab title; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice.MP1 tab title matched as expected'); - } - }, - - //Add Direct Alignment Standard handle - { - description: 'Validate Add Direct Alignment standard handle', - action: async () => { - const elementText = await driver.findElement(By.css('#std b')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1" handle; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice.MP1 handle matched as expected'); - } - }, - - //Add Direct Alignment Standard description text - { - description: 'Validate Add Direct Alignment standard description text', - action: async () => { - const elementText = await driver.findElement(By.css('#std > div:nth-child(1)')).getText(); - if (elementText !== 'CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: "CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them." description text; Actual: "${elementText}"`); - } - console.log('Passed: CCSS.Math.Practice.MP1 - Make sense of problems and persevere in solving them. description text matched as expected'); - } - }, - - //Add Direct Alignment find content text - { - description: 'Validate Add Direct Alignment find content text', - action: async () => { - const elementText = await driver.findElement(By.css('#content-search-container > span')).getText(); - if (elementText !== 'Find content and align directly to a standard.') { - throw new Error(`Expected: "Find content and align directly to a standard."; Actual: "${elementText}"`); - } - console.log('Passed: Find content and align directly to a standard. text matched as expected'); - } - }, - - //Search content dropdown placeholder - { - description: 'Validate Search content dropdown placeholder', - action: async () => { - const elementText = await driver.findElement(By.css('.form-control')).getAttribute('placeholder'); - if (elementText !== 'Search content...') { - throw new Error(`Expected: "Search content..." dropdown placeholder did not match; Actual: "${elementText}"`); - } - console.log('Passed: Search content... dropdown placeholder matched as expected'); - } - }, - - //Add Direct Alignment Search button text - { - description: 'Validate Add Direct Alignment Search button text', - action: async () => { - const elementText = await driver.findElement(By.css('.col-auto > .btn')).getAttribute('value'); - if (elementText !== 'Search') { - throw new Error(`Expected: "Search"; Actual: "${elementText}"`); - } - console.log('Passed: Search button text matched as expected'); - } - }, - - //Search button color -green - { - description: 'Validate Search button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.col-auto > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Search button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Search button color matched as expected'); - } - }, - - //Geometry - QA (441) expansion carrot - { - description: 'Verify Geometry - QA (441) expansion carrot is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#toggle-organization-label-0 > .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Geometry - QA (441) expansion carrot not found'); - } - console.log('Passed: Geometry - QA (441) expansion carrot present'); - } - }, - - //Geometry - QA (441) label - { - description: 'Validate Geometry - QA (441) label', - action: async () => { - const elementText = await driver.findElement(By.css('#toggle-organization-label-0')).getText(); - if (elementText !== 'Geometry - QA ( 441 )') { - throw new Error(`Expected: "Geometry - QA (441)"; Actual: "${elementText}"`); - } - console.log('Passed: Geometry - QA (441) label matched as expected'); - } - }, - - //Algebra - QA (18) expansion carrot - { - description: 'Verify Algebra - QA (18) expansion carrot is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#toggle-organization-label-1 > .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Algebra - QA (18) expansion carrot not found'); - } - console.log('Passed: Algebra - QA (18)) expansion carrot present'); - } - }, - - //Algebra - QA (18) label - { - description: 'Validate Algebra - QA (18) label', - action: async () => { - const elementText = await driver.findElement(By.css('#toggle-organization-label-1')).getText(); - if (elementText !== 'Algebra - QA ( 18 )') { - throw new Error(`Expected: "Algebra - QA (18)"; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA (18) label matched as expected'); - } - }, - - //Add Direct Alignment Done button text - { - description: 'Validate Add Direct Alignment Done button text', - action: async () => { - const elementText = await driver.findElement(By.css('.modal-footer > .btn')).getText(); - if (elementText !== 'Done') { - throw new Error(`Expected: Add Direct Alignment "Done"; Actual: "${elementText}"`); - } - console.log('Passed: Add Direct Alignment Done button text matched as expected'); - } - }, - - //Done button color -white - { - description: 'Validate Done button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.modal-footer > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Add Direct Alignment Done button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Add Direct Alignment Done button color matched as expected'); - } - }, - - //NEXT ACTION - Click Algebra - QA handle - { description: 'Click Algebra - QA handle', action: async () => await driver.findElement(By.css('#toggle-organization-label-1')).click() }, - - //Wait Algebra - QA to expand - { - description: 'Wait for Algebra - QA to expand', - action: async () => { - return await driver.wait(until.elementLocated(By.css('#org-id-873576065 .text-center:nth-child(2)')), 10000).catch(() => false); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade K column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade K column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(2)')).getText(); - if (elementText !== 'K') { - throw new Error(`Expected: Algebra - QA Grade "K" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade K column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 1 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 1 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(3)')).getText(); - if (elementText !== '1') { - throw new Error(`Expected: Algebra - QA Grade "1" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 1 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 2 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 2 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(4)')).getText(); - if (elementText !== '2') { - throw new Error(`Expected: Algebra - QA Grade "2" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 2 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 3 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 3 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(5)')).getText(); - if (elementText !== '3') { - throw new Error(`Expected: Algebra - QA Grade "3" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 3 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 4 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 4 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(6)')).getText(); - if (elementText !== '4') { - throw new Error(`Expected: Algebra - QA Grade "4" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 4 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 5 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 5 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(7)')).getText(); - if (elementText !== '5') { - throw new Error(`Expected: Algebra - QA Grade "5" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 5 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 6 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 6 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(8)')).getText(); - if (elementText !== '6') { - throw new Error(`Expected: Algebra - QA Grade "6" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 6 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 7 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 7 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(9)')).getText(); - if (elementText !== '7') { - throw new Error(`Expected: Algebra - QA Grade "7" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 7 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 8 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 8 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(10)')).getText(); - if (elementText !== '8') { - throw new Error(`Expected: Algebra - QA Grade "8" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 8 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 9 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 9 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(11)')).getText(); - if (elementText !== '9') { - throw new Error(`Expected: Algebra - QA Grade "9" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 9 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 10 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 10 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(12)')).getText(); - if (elementText !== '10') { - throw new Error(`Expected: Algebra - QA Grade "10" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 10 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 11 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 11 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(13)')).getText(); - if (elementText !== '11') { - throw new Error(`Expected: Algebra - QA Grade "11" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 11 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - QA Grade 12 column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Grade 12 column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 .text-center:nth-child(14)')).getText(); - if (elementText !== '12') { - throw new Error(`Expected: Algebra - QA Grade "12" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Grade 12 column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - Select column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Select column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 tr:nth-child(1) > .text-center:nth-child(15)')).getText(); - if (elementText !== 'Select') { - throw new Error(`Expected: Algebra - QA "Select" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Select column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - Clear column label - { - description: 'Validate Add Direct Alignment DIV Algebra - QA Clear column label', - action: async () => { - const elementText = await driver.findElement(By.css('#org-id-873576065 tr:nth-child(1) > .text-center:nth-child(16)')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: Algebra - QA "Clear" column label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - QA Clear column label matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - Standard row 1 label - { - description: 'Validate Add Direct Alignment DIV Algebra - Standard row 1 label', - action: async () => { - const elementText = await driver.findElement(By.linkText('AAB Another one, EDITED')).getText(); - if (elementText !== 'AAB Another one, EDITED') { - throw new Error(`Expected: "AAB Another one, EDITED" label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - Standard row 1 label matched as expected'); - } - }, - - //Add Direct Alignment DIV 7th grade radio option - { - description: 'Verify Add Direct Alignment DIV Standard 1, 7th grade radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#add47_599773234_874446281 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Standard row 1, 7th grade radio option not found'); - } - console.log('Passed: Standard row 1, 7th grade radio option present'); - } - }, - - //Add Direct Alignment DIV 8th grade radio option - { - description: 'Verify Add Direct Alignment DIV Standard 1, 8th grade radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#add48_599773300_874446281 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Standard row 1, 8th grade radio option not found'); - } - console.log('Passed: Standard row 1, 8th grade radio option present'); - } - }, - - //Add Direct Alignment DIV Standard row 1 - All button text - { - description: 'Validate Add Direct Alignment DIV standard row 1 - All button text', - action: async () => { - const elementText = await driver.findElement(By.css('#addtr599773300874446281 > .align-middle:nth-child(15) > .btn')).getText(); - if (elementText !== 'All') { - throw new Error(`Expected: Standard row 1 - "All" text; Actual: "${elementText}"`); - } - console.log('Passed: Standard row 1 - All button text matched as expected'); - } - }, - - //Add Direct Alignment DIV Standard row 1 - All button -gray - { - description: 'Validate Add Direct Alignment DIV standard row 1 - All button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#addtr599773300874446281 > .align-middle:nth-child(15) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Standard row 1 - All button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Standard row 1 - All button color matched as expected'); - } - }, - - //Standard row 1 - Clear button text - { - description: 'Validate Add Direct Alignment DIV standard row 1 - Clear button text', - action: async () => { - const elementText = await driver.findElement(By.css('#addtr599773300874446281 > .align-middle:nth-child(16) > .btn')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: Standard row 1 - "Clear" text; Actual: "${elementText}"`); - } - console.log('Passed: Standard row 1 - Clear button text matched as expected'); - } - }, - - //Add Direct Alignment Standard row 1 - Clear button -gray - { - description: 'Validate Add Direct Alignment DIV standard row 1 - Clear button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#addtr599773300874446281 > .align-middle:nth-child(16) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Standard row 1 - Clear button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Standard row 1 - Clear button color matched as expected'); - } - }, - - //Add Direct Alignment DIV Algebra - Standard row 2 label - { - description: 'Validate Add Direct Alignment DIV Algebra - Standard row 2 label', - action: async () => { - const elementText = await driver.findElement(By.linkText('Angle relationships example (Video) LATEST')).getText(); - if (elementText !== 'Angle relationships example (Video) LATEST') { - throw new Error(`Expected: "Angle relationships example (Video) LATEST" label; Actual: "${elementText}"`); - } - console.log('Passed: Algebra - Standard row 2 label matched as expected'); - } - }, - - //Add Direct Alignment DIV 7th grade radio option - { - description: 'Verify Add Direct Alignment DIV Standard 2, 7th grade radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#add47_599773234_873576079 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Standard row 2, 7th grade radio option not found'); - } - console.log('Passed: Standard row 2, 7th grade radio option present'); - } - }, - - //Add Direct Alignment DIV 8th grade radio option - { - description: 'Verify Add Direct Alignment DIV Standard 2, 8th grade radio option is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#add48_599773300_873576079 .fa')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Standard row 2, 8th grade radio option not found'); - } - console.log('Passed: Standard row 2, 8th grade radio option present'); - } - }, - - //Add Direct Alignment DIV Standard row 2 - All button text - { - description: 'Validate Add Direct Alignment DIV standard row 2 - All button text', - action: async () => { - const elementText = await driver.findElement(By.css('#addtr599773300873576079 > .align-middle:nth-child(15) > .btn')).getText(); - if (elementText !== 'All') { - throw new Error(`Expected: Standard row 2 - "All" text; Actual: "${elementText}"`); - } - console.log('Passed: Standard row 2 - All button text matched as expected'); - } - }, - - //Add Direct Alignment DIV Standard row 2 - All button -gray - { - description: 'Validate Add Direct Alignment DIV standard row 2 - All button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#addtr599773300873576079 > .align-middle:nth-child(15) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Standard row 2 - All button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Standard row 2 - All button color matched as expected'); - } - }, - - //Standard row 2 - Clear button text - { - description: 'Validate Add Direct Alignment DIV standard row 2 - Clear button text', - action: async () => { - const elementText = await driver.findElement(By.css('#addtr599773300873576079 > .align-middle:nth-child(16) > .btn')).getText(); - if (elementText !== 'Clear') { - throw new Error(`Expected: Standard row 2 - "Clear" text; Actual: "${elementText}"`); - } - console.log('Passed: Standard row 2 - Clear button text matched as expected'); - } - }, - - //Add Direct Alignment Standard row 2 - Clear button -gray - { - description: 'Validate Add Direct Alignment DIV standard row 2 - Clear button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#addtr599773300873576079 > .align-middle:nth-child(16) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(108, 117, 125, 1)') { - throw new Error(`Standard row 2 - Clear button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Standard row 2 - Clear button color matched as expected'); - } - }, - - //Add Direct Alignment DIV - Done button text - { - description: 'Validate Add Direct Alignment DIV - Done button text', - action: async () => { - const elementText = await driver.findElement(By.css('.modal-footer > .btn')).getText(); - if (elementText !== 'Done') { - throw new Error(`Expected: Add Direct Alignment "Done" button text did not match; Actual: "${elementText}"`); - } - console.log('Passed: Add Direct Alignment Done button text matched as expected'); - } - }, - - //Add Direct Alignment DIV - Done button -white - { - description: 'Validate Add Direct Alignment DIV - Done button color', - action: async () => { - const elementStyle = await driver.findElement(By.css('.modal-footer > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(0, 0, 0, 0)') { - throw new Error(`Add Direct Alignment "Done" button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Add Direct Alignment Done button color matched as expected'); - } - }, - - //NEXT ACTION - Click Done button - { description: 'Click Add Direct Alighment DIV - Done button', action: async () => await driver.findElement(By.css('.modal-footer > .btn')).click() }, - { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - - //LOG OUT - //NEXT ACTION - Log out - { description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() }, - { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, - { description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() }, - { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, - - //Wait for login screen to load - { - description: 'Wait for log out process to complete', - action: async () => { - return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false); - } - }, -]; - -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', 'alignStandardsPage'); - - 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', 'alignStandardsPage'); - if (fs.existsSync(screenshotDir)) { - fs.rmSync(screenshotDir, { recursive: true, force: true }); - } - fs.mkdirSync(screenshotDir, { recursive: true }); - - //Remove old Excel file - if (fs.existsSync('alignStandardsPageResults.xlsx')) { - fs.unlinkSync('alignStandardsPageResults.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, ''); - - let allStepsPassed = true; - - for (const step of steps) { - const stepIndex = steps.indexOf(step) + 1; - const timestamp = new Date().toISOString(); - - try { - //Screenshot of failed step - await step.action(); - - //Log a successful step with no screenshot - worksheet = logStep( - worksheet, - step.description, - 'Passed', - stepIndex, - timestamp, - null //No screenshot for passed steps - ); - - } catch (error) { - //Only take screenshot if the step fails - 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'; - allStepsPassed = false; - } - } - - //Check if log out was successful - const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); - - if (loginButton && allStepsPassed) { - console.log('PASSED: Align Standards Page(ExACT_alignStandardsPage); All test steps completed successfully'); - testStatus = 'Passed'; - } else { - console.log('FAILED: (ECS-2829) Align Standards Page(ExACT_alignStandardsPage); One or more test steps failed'); - 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, 'alignStandardsPageResults.xlsx'); -} finally { - await driver.quit(); -} -})(); -} - -export default ExACT_alignStandardsPage;