import { Builder, By, Key, until } from 'selenium-webdriver'; import fs from 'fs'; import XLSX from 'xlsx'; import path from 'path'; const ExACT_contentPage = (req, res) => { res.send('

ExACT Automated Test Script - Content Page: Initiated

'); (async function example() { let driver = await new Builder().forBrowser('chrome').build(); let testStatus = 'Failed'; let workbook; let worksheet; const startTime = new Date().toISOString(); //Constants const createContentSetName = 'Automated - QA Content Set - To be deleted'; 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'); } }, //Dashboard title text color -dark blue { description: 'Validate dashboard title text color', action: async () => { const elementStyle = await driver.findElement(By.css('.e-heading')).getCssValue('color'); if (elementStyle !== 'rgba(40, 39, 90, 1)') { throw new Error(`Dashboard title text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Dashboard title text color matched as expected'); } }, //Dashboard title text font { description: 'Validate dashboard title text font size', action: async () => { const elementStyle = await driver.findElement(By.css('.e-heading')).getCssValue('font-size'); if (elementStyle !== '32px') { throw new Error(`Dashboard title text font-size did not match; Actual: "${elementStyle}"`); } console.log('Passed: Dashboard title text font-size matched as expected'); } }, //MY CONTENT WIDGET //Dashboard My Content Widget title { description: 'Validate dashboard My Content widget title', action: async () => { const elementText = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getText(); if (elementText !== 'My Content') { throw new Error(`Expected: "My Content"; Actual: "${elementText}"`); } console.log('Passed: Dashboard - My Content Widget title matched as expected'); } }, //Dashboard My Content Widget title text color -dark blue { description: 'Validate dashboard My Content widget title text color', action: async () => { const elementStyle = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getCssValue('color'); if (elementStyle !== 'rgba(40, 39, 90, 1)') { throw new Error(`Dashboard - My Content Widget title text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Dashboard - My Content Widget title text color matched as expected'); } }, //Dashboard My Content Widget title text font { description: 'Validate dashboard My Content widget title text font size', action: async () => { const elementStyle = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getCssValue('font-size'); if (elementStyle !== '18px') { throw new Error(`Dashboard - My Content Widget title text font-size did not match; Actual: "${elementStyle}"`); } console.log('Passed: Dashboard - My Content Widget title text font-size matched as expected'); } }, //Dashboard My Content Item Count { description: 'Validate Dashboard My Content Item Count', action: async () => { const elementText = await driver.findElement(By.css('#badge_content_total')).getText(); if (elementText !== '3527 items') { throw new Error(`Expected: "3527 items"; Actual: "${elementText}"`); } console.log('Passed: Dashboard - My Content Item Count matched as expected'); } }, //Dashboard My Content Item Count button color -dark blue { description: 'Validate Dashboard My Content Item Count button color', action: async () => { const elementStyle = await driver.findElement(By.css('#badge_content_total')).getCssValue('background-color'); if (elementStyle !== 'rgba(40, 39, 90, 1)') { throw new Error(`Dashboard - My Content Item Count button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Dashboard - My Content Item Count button color matched as expected'); } }, //Dashboard My Content Item Count text color -white { description: 'Validate Dashboard My Content Item Count font color', action: async () => { const elementStyle = await driver.findElement(By.css('#badge_content_total')).getCssValue('color'); if (elementStyle !== 'rgba(255, 255, 255, 1)') { throw new Error(`Dashboard - My Content Item Count font color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Dashboard - My Content Item Count font color matched as expected'); } }, //Ellipsis icon color -dark blue { description: 'Validate ellipsis icon color', action: async () => { const elementStyle = await driver.findElement(By.css('.fa-ellipsis-h')).getCssValue('color'); if (elementStyle !== 'rgba(40, 39, 90, 1)') { throw new Error(`Ellipsis icon color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Ellipsis icon color matched as expected'); } }, //Search icon color -dark blue { description: 'Validate search icon color', action: async () => { const elementStyle = await driver.findElement(By.css('.col-12 > .fa')).getCssValue('color'); if (elementStyle !== 'rgba(40, 39, 90, 1)') { throw new Error(`Search icon color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Search icon color matched as expected'); } }, //Filter textbox placeholder { description: 'Validate Filter placeholder text', action: async () => { const elementValue = await driver.findElement(By.css('#content-org-filter')).getAttribute('placeholder'); if (elementValue !== 'filter...') { throw new Error(`Expected: "filter..."; Actual: "${elementValue}"`); } console.log('Passed: Filter placeholder text matched as expected'); } }, //Sort label { description: 'Validate sort label', action: async () => { const elementText = await driver.findElement(By.css('.col-4')).getText(); if (elementText !== 'Sort:') { throw new Error(`Expected: "Sort:"; Actual: "${elementText}"`); } console.log('Passed: Sort label matched as expected'); } }, //Sort Dropdown [should be: "Count", option] { description: 'Validate sort dropdown option', action: async () => { const elementOption = await driver.findElement(By.css('#orgsort > option:nth-child(1)')).getAttribute('value'); if (elementOption !== 'count') { throw new Error(`Expected: "count"; Actual: "${elementOption}"`); } console.log('Passed: Sort dropdown option matched as expected'); } }, //Biology-QA { description: 'Validate Biology-QA title', action: async () => { const elementText = await driver.findElement(By.linkText('Biology - QA')).getText(); if (elementText !== 'Biology - QA') { throw new Error(`Expected: "Biology - QA"; Actual: "${elementText}"`); } console.log('Passed: Biology-QA link title matched as expected'); } }, //Biology-QA edit icon color { description: 'Validate Biology-QA edit icon color', action: async () => { const elementStyle = await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .fa')).getCssValue('color'); if (elementStyle !== 'rgba(73, 80, 87, 1)') { throw new Error(`Biology-QA edit icon color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Bioloby-QA edit icon color matched as expected'); } }, //Biology-QA Count { description: 'Validate Biology-QA Count', action: async () => { const elementText = await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .badge')).getText(); if (elementText !== '1046') { throw new Error(`Expected: "1046"; Actual: "${elementText}"`); } console.log('Passed: Biology-QA Count matched as expected'); } }, //NEXT ACTION - NAVIGATE TO CONTENT PAGE { description: 'Click Biology - QA link', action: async () => await driver.findElement(By.linkText('Biology - QA')).click() }, //Wait for Biology - QA Content page to load { description: 'Wait for Content page load to completely', action: async () => { return await driver.wait(until.elementLocated(By.css('.float-left:nth-child(5)')), 10000).catch(() => false); } }, //FILTERS //Filter Results title { description: 'Validate Filter Results title', action: async () => { const elementText = await driver.findElement(By.css('.well > b')).getText(); if (elementText !== 'Filter Results') { throw new Error(`Expected: "Filter Results"; Actual: "${elementText}"`); } console.log('Passed: Filter Results title matched as expected'); } }, //Filter Results title font size { description: 'Validate Filter Results title font size', action: async () => { const elementText = await driver.findElement(By.css('.well > b')).getCssValue('font-size'); if (elementText !== '13px') { throw new Error(`Expected: Filter Results title font size to be "13px"; Actual: "${elementText}"`); } console.log('Passed: Filter Results title font size matched as expected'); } }, //Content Set title { description: 'Validate Content Set title', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getText(); if (elementText !== 'Content Set') { throw new Error(`Expected: "Content Set" title; Actual: "${elementText}"`); } console.log('Passed: Content Set title matched as expected'); } }, //Content Set title font size { description: 'Validate Content Set title font size', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > b')).getCssValue('font-size'); if (elementText !== '13px') { throw new Error(`Expected: Content Set title font size to be "13px"; Actual: "${elementText}"`); } console.log('Passed: Content Set title font size matched as expected'); } }, //Biology - QA checkbox { description: 'Verify Biology - QA checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaorgobjectid873576067')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Biology - QA checkbox icon not found'); } console.log('Passed: Biology - QA checkbox icon present'); } }, /*Biology - QA label { description: 'Validate Biology - QA label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(1) > label')).getAttribute('label'); if (elementText !== 'Biology - QA') { throw new Error(`Expected: yup "Biology - QA"; Actual: "${elementText}"`); } console.log('Passed: Biology - QA label matched as expected'); } },*/ //Biology - QA count { description: 'Validate Biology - QA count', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText(); if (elementText !== 'Biology - QA (1046)') { throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`); } console.log('Passed: Biology - QA (1046) label matched as expected'); } }, //Grade title { description: 'Validate Grade title', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getText(); if (elementText !== 'Grade') { throw new Error(`Expected: "Grade" title; Actual: "${elementText}"`); } console.log('Passed: Grade title matched as expected'); } }, //Grade title font size { description: 'Validate Grade title font size', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > b')).getCssValue('font-size'); if (elementText !== '13px') { throw new Error(`Expected: Grade title font size to be "13px"; Actual: "${elementText}"`); } console.log('Passed: Grade title font size matched as expected'); } }, //9th grade checkbox { description: 'Verify 9th grade checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades49')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('9th grade checkbox icon not found'); } console.log('Passed: 9th grade checkbox icon present'); } }, //9th grade label { description: 'Validate 9th grade label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(4)')).getText(); if (elementText !== '9') { throw new Error(`Expected: "9"; Actual: "${elementText}"`); } console.log('Passed: 9th label matched as expected'); } }, //10th grade checkbox { description: 'Verify 10th grade checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades51')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('10th grade checkbox icon not found'); } console.log('Passed: 10th grade checkbox icon present'); } }, //10th grade label { description: 'Validate 10th grade label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(7)')).getText(); if (elementText !== '10') { throw new Error(`Expected: "10"; Actual: "${elementText}"`); } console.log('Passed: 10th label matched as expected'); } }, //11th grade checkbox { description: 'Verify 11th grade checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades52')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('11th grade checkbox icon not found'); } console.log('Passed: 11th grade checkbox icon present'); } }, //11th grade label { description: 'Validate 11th grade label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(10)')).getText(); if (elementText !== '11') { throw new Error(`Expected: "11"; Actual: "${elementText}"`); } console.log('Passed: 11th label matched as expected'); } }, //12th grade checkbox { description: 'Verify 12th grade checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades53')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('12th grade checkbox icon not found'); } console.log('Passed: 12th grade checkbox icon present'); } }, //12th grade label { description: 'Validate 12th grade label', action: async () => { const elementText = await driver.findElement(By.css('label:nth-child(13)')).getText(); if (elementText !== '12') { throw new Error(`Expected: "12"; Actual: "${elementText}"`); } console.log('Passed: 12th label matched as expected'); } }, //8th grade checkbox { description: 'Verify 8th grade checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metagrades48')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('8th grade checkbox icon not found'); } console.log('Passed: 8th grade checkbox icon present'); } }, //8th grade label { description: 'Validate 8th grade label', action: async () => { const elementText = await driver.findElement(By.css('label:nth-child(16)')).getText(); if (elementText !== '8') { throw new Error(`Expected: "8"; Actual: "${elementText}"`); } console.log('Passed: 8th label matched as expected'); } }, //More link { description: 'Validate More link', action: async () => { const elementText = await driver.findElement(By.linkText('More>>')).getText(); if (elementText !== 'More>>') { throw new Error(`Expected: "More>>"; Actual: "${elementText}"`); } console.log('Passed: More>> link matched as expected'); } }, //Subject title { description: 'Validate Subject title', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getText(); if (elementText !== 'Subject') { throw new Error(`Expected: "Subject" title; Actual: "${elementText}"`); } console.log('Passed: Subject title matched as expected'); } }, //Subject title font size { description: 'Validate Subject title font size', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > b')).getCssValue('font-size'); if (elementText !== '13px') { throw new Error(`Expected: Subject title font size to be "13px"; Actual: "${elementText}"`); } console.log('Passed: Subject title font size matched as expected'); } }, //Science checkbox { description: 'Verify Science checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsScience')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Science checkbox icon not found'); } console.log('Passed: Science checkbox icon present'); } }, //Science label { description: 'Validate Science label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(4)')).getText(); if (elementText !== 'Science') { throw new Error(`Expected: "Science"; Actual: "${elementText}"`); } console.log('Passed: Science label matched as expected'); } }, //Mathematics checkbox { description: 'Verify Mathematics checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Mathematics checkbox icon not found'); } console.log('Passed: Mathematics checkbox icon present'); } }, //Mathematics label { description: 'Validate Mathematics label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText(); if (elementText !== 'Mathematics') { throw new Error(`Expected: "Mathematics"; Actual: "${elementText}"`); } console.log('Passed: Mathematics label matched as expected'); } }, //Social and Emotional Learning checkbox { description: 'Verify Social and Emotional Learning checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.id('metasubjectsSocial and Emotional Learning')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Social and Emotional Learning checkbox icon not found'); } console.log('Passed: Social and Emotional Learning checkbox icon present'); } }, //Social and Emotional Learning label { description: 'Validate Social and Emotional Learning label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText(); if (elementText !== 'Social and Emotional Learning') { throw new Error(`Expected: "Social and Emotional Learning"; Actual: "${elementText}"`); } console.log('Passed: Social and Emotional Learning label matched as expected'); } }, //Alignment Status title { description: 'Validate Alignment Status title', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getText(); if (elementText !== 'Alignment Status') { throw new Error(`Expected: "Alignment Status" title; Actual: "${elementText}"`); } console.log('Passed: Alignment Status title matched as expected'); } }, //Alignment Status title font size { description: 'Validate Alignment Status title font size', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > b')).getCssValue('font-size'); if (elementText !== '13px') { throw new Error(`Expected: Alignment Status title font size to be "13px"; Actual: "${elementText}"`); } console.log('Passed: Alignment Status title font size matched as expected'); } }, //Not Aligned checkbox { description: 'Verify Not Aligned checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusNot\\ Aligned')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Not Aligned checkbox icon not found'); } console.log('Passed: Not Aligned checkbox icon present'); } }, //Not Aligned label { description: 'Validate Not Aligned label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(4)')).getText(); if (elementText !== 'Not Aligned') { throw new Error(`Expected: "Not Aligned"; Actual: "${elementText}"`); } console.log('Passed: Not Aligned label matched as expected'); } }, //ECS Alignment checkbox { description: 'Verify ECS Alignment checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusECS\\ Alignment')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('ECS Alignment checkbox icon not found'); } console.log('Passed: ECS Alignment checkbox icon present'); } }, //ECS Alignment label { description: 'Validate ECS Alignment label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(7)')).getText(); if (elementText !== 'ECS Alignment') { throw new Error(`Expected: "ECS Alignment"; Actual: "${elementText}"`); } console.log('Passed: ECS Alignment label matched as expected'); } }, //Pending checkbox { description: 'Verify Pending checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusPending')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Pending checkbox icon not found'); } console.log('Passed: Pending checkbox icon present'); } }, //Pending label { description: 'Validate Pending label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(10)')).getText(); if (elementText !== 'Pending') { throw new Error(`Expected: "Pending"; Actual: "${elementText}"`); } console.log('Passed: Pending label matched as expected'); } }, //Aligned checkbox { description: 'Verify Aligned checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metaAlignmentStatusAligned')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Aligned checkbox icon not found'); } console.log('Passed: Aligned checkbox icon present'); } }, //Aligned label { description: 'Validate Aligned label', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(8) > label:nth-child(13)')).getText(); if (elementText !== 'Aligned') { throw new Error(`Expected: "Aligned"; Actual: "${elementText}"`); } console.log('Passed: Aligned label matched as expected'); } }, //Reset All link { description: 'Validate Reset All link', action: async () => { const elementText = await driver.findElement(By.linkText('Reset All')).getText(); if (elementText !== 'Reset All') { throw new Error(`Expected: "Reset All"; Actual: "${elementText}"`); } console.log('Passed: Reset All link matched as expected'); } }, //CONTENT RESULTS - PAGINATION ROW //Home link { description: 'Validate Home link', action: async () => { const elementText = await driver.findElement(By.linkText('Home')).getText(); if (elementText !== 'Home') { throw new Error(`Expected: "Home"; Actual: "${elementText}"`); } console.log('Passed: Home link matched as expected'); } }, //Content breadcrumb { description: 'Validate Content breadcrumb', action: async () => { const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText(); if (elementText !== 'Content') { throw new Error(`Expected: "Content"; Actual: "${elementText}"`); } console.log('Passed: Content link matched as expected'); } }, //Detail View button { description: 'Validate Detail View button text', action: async () => { const elementText = await driver.findElement(By.linkText('Detail View')).getText(); if (elementText !== 'Detail View') { throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`); } console.log('Passed: Detail View button text matched as expected'); } }, //Detail View button color -green { description: 'Validate Detail View button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Detail View button color matched as expected'); } }, //Edit View button { description: 'Validate Edit View button text', action: async () => { const elementText = await driver.findElement(By.linkText('Edit View')).getText(); if (elementText !== 'Edit View') { throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`); } console.log('Passed: Edit View button text matched as expected'); } }, //Edit View button color -green { description: 'Validate Edit View button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color'); if (elementStyle !== 'rgba(248, 249, 250, 1)') { throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Edit View button 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 > div.col-xs-12.col-sm-9 > 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'); } }, //Results 1-25 of 1046 label { description: 'Validate Results 1-25 of 1046 label', action: async () => { const elementText = await driver.findElement(By.css('.float-left:nth-child(5)')).getText(); if (elementText !== 'Results 1 - 25 of 1046') { throw new Error(`Expected: "Results 1 - 25 of 1046" label; Actual: "${elementText}"`); } console.log('Passed: Results 1 - 25 of 1046 label matched as expected'); } }, //PAGINATION BUTTONS //Show button text { description: 'Validate Show button text', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) #contentlimit')).getText(); if (elementText !== 'Show') { throw new Error(`Expected: "Show" button text; Actual: "${elementText}"`); } console.log('Passed: Show button text matched as expected'); } }, //Show dropdown [should be: "25", option] { description: 'Validate Show dropdown option', action: async () => { const elementOption = await driver.findElement(By.css('.form-group:nth-child(6) #inputlimit')).getAttribute('value'); if (elementOption !== '25') { throw new Error(`Expected: "25"; Actual: "${elementOption}"`); } console.log('Passed: Show dropdown option matched as expected'); } }, //Pagination 1 button text { description: 'Validate pagination 1 button text', action: async () => { const elementText = await driver.findElement(By.linkText('1')).getText(); if (elementText !== '1') { throw new Error(`Expected: Pagination "1" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 1 button text matched as expected'); } }, //Pagination 1 background color -green { description: 'Validate pagination 1 button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('1')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 1 button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 1 button color matched as expected'); } }, //Pagination 2 button text { description: 'Validate pagination 2 button text', action: async () => { const elementText = await driver.findElement(By.linkText('2')).getText(); if (elementText !== '2') { throw new Error(`Expected: Pagination "2" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 2 button text matched as expected'); } }, //Pagination 2 text color -green { description: 'Validate pagination 2 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('2')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 2 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 2 text color matched as expected'); } }, //Pagination 3 button text { description: 'Validate pagination 3 button text', action: async () => { const elementText = await driver.findElement(By.linkText('3')).getText(); if (elementText !== '3') { throw new Error(`Expected: Pagination "3" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 3 button text matched as expected'); } }, //Pagination 3 text color -green { description: 'Validate pagination 3 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('3')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 3 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 3 text color matched as expected'); } }, //Pagination 4 button text { description: 'Validate pagination 4 button text', action: async () => { const elementText = await driver.findElement(By.linkText('4')).getText(); if (elementText !== '4') { throw new Error(`Expected: Pagination "4" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 4 button text matched as expected'); } }, //Pagination 4 text color -green { description: 'Validate pagination 4 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('4')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 4 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 4 text color matched as expected'); } }, //Pagination 5 button text { description: 'Validate pagination 5 button text', action: async () => { const elementText = await driver.findElement(By.linkText('5')).getText(); if (elementText !== '5') { throw new Error(`Expected: Pagination "5" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 5 button text matched as expected'); } }, //Pagination 5 text color -green { description: 'Validate pagination 5 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('5')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 5 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 5 text color matched as expected'); } }, //Pagination separator icon { description: 'Verify Pagination separator icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.linkText('...')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Pagination separator icon not found'); } console.log('Passed: Pagination separator icon present'); } }, //Pagination 42 button text { description: 'Validate pagination 42 button text', action: async () => { const elementText = await driver.findElement(By.linkText('42')).getText(); if (elementText !== '42') { throw new Error(`Expected: Pagination "42" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 42 button text matched as expected'); } }, //Pagination 42 text color -green { description: 'Validate pagination 42 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('42')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 42 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 42 text color matched as expected'); } }, //Pagination Show All button text { description: 'Validate pagination Show All button text', action: async () => { const elementText = await driver.findElement(By.linkText('Show All')).getText(); if (elementText !== 'Show All') { throw new Error(`Expected: Pagination "Show All" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination Show All button text matched as expected'); } }, //Pagination Show All text color -green { description: 'Validate pagination Show All text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Show All')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination Show All text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination Show All text color matched as expected'); } }, //CONTENT RESULTS - CONTENT ITEMS //Content 1 Title { description: 'Validate Content 1 title', action: async () => { const elementText = await driver.findElement(By.linkText('AAA My Test III')).getText(); if (elementText !== 'AAA My Test III') { throw new Error(`Expected: Content 1 item "AAA My Test III" title; Actual: "${elementText}"`); } console.log('Passed: Content 1 item AAA My Test III tittle matched as expected'); } }, //Content 1 edit icon { description: 'Verify Content 1 edit icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .lo-title .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 1 edit icon not found'); } console.log('Passed: Content 1 edit icon present'); } }, //Content 1 edit button text { description: 'Validate Content 1 edit button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getText(); if (elementText !== 'Edit') { throw new Error(`Expected: Content 1 "Edit" button text; Actual: "${elementText}"`); } console.log('Passed: Content 1 Edit button text matched as expected'); } }, //Content 1 edit button color -green { description: 'Validate Content 1 Edit button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 1 Edit button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 1 Edit button color matched as expected'); } }, //Content 1 description { description: 'Validate Content 1 description', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText(); if (elementText !== 'Yes, it should work! Perhaps') { throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 description text matched as expected'); } }, //Content 1 content set label { description: 'Validate Content 1 content set label', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) small')).getText(); if (elementText !== 'Content Set: Biology - QA') { throw new Error(`Expected: Content 1 content set label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 content set label matched as expected'); } }, //Content 1 alignment label { description: 'Validate Content 1 ECS Alignement label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink874454004 > .display-alignment')).getText(); if (elementText !== 'Aligned (reset)') { throw new Error(`Expected: Content 1 ECS Alignement label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 ECS Alignement label matched as expected'); } }, //Content 1 alignment reset label { description: 'Validate Content 1 ECS Alignement reset label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink874454004 b')).getText(); if (elementText !== 'reset') { throw new Error(`Expected: Content 1 ECS Alignement reset label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 ECS Alignement reset label matched as expected'); } }, //Content 1 view standards button icon { description: 'Verify Content 1 View Standards button icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .well .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 1 View Standards button icon not found'); } console.log('Passed: Content 1 View Standards button icon present'); } }, //Content 1 view standards button text { description: 'Validate Content 1 View Standards button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getText(); if (elementText !== 'View Standards') { throw new Error(`Expected: Content 1 View Standards button text did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 View Standards button text matched as expected'); } }, //Content 1 view standards button color -green { description: 'Validate Content 1 view standards button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 1 View Standards button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 1 View Standards button color matched as expected'); } }, //Content 2 Title { description: 'Validate Content 2 title', action: async () => { const elementText = await driver.findElement(By.linkText('Abrupt Climate Change')).getText(); if (elementText !== 'Abrupt Climate Change') { throw new Error(`Expected: Content 1 item "Abrupt Climate Change" title; Actual: "${elementText}"`); } console.log('Passed: Content 1 item Abrupt Climate Change tittle matched as expected'); } }, //Content 2 edit icon { description: 'Verify Content 2 edit icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .lo-title .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 2 edit icon not found'); } console.log('Passed: Content 2 edit icon present'); } }, //Content 2 edit button text { description: 'Validate pagination Show All button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getText(); if (elementText !== 'Edit') { throw new Error(`Expected: Content 2 "Edit" button text; Actual: "${elementText}"`); } console.log('Passed: Content 2 Edit button text matched as expected'); } }, //Content 2 edit button color -green { description: 'Validate Content 2 Edit button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 2 Edit button color matched as expected'); } }, //Content 2 description { description: 'Validate Content 2 description', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText(); if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') { throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`); } console.log('Passed: Content 2 description text matched as expected'); } }, //Content 2 content set label { description: 'Validate Content 2 content set label', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(9) small')).getText(); if (elementText !== 'Content Set: Biology - QA') { throw new Error(`Expected: Content 2 content set label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 2 content set label matched as expected'); } }, //Content 2 alignment label { description: 'Validate Content 2 ECS Alignement label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578650 > .display-alignment')).getText(); if (elementText !== 'Alignment Pending (reset)') { throw new Error(`Expected: Content 2 Alignement Pending label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 2 Alignement Pending label matched as expected'); } }, //Content 2 alignment reset label { description: 'Validate Content 2 Alignement Pending reset label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578650 b')).getText(); if (elementText !== 'reset') { throw new Error(`Expected: Content 2 Alignement Pending reset label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 2 Alignement Pending reset label matched as expected'); } }, //Content 2 view standards button icon { description: 'Verify Content 2 View Standards button icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .well .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 2 View Standards button icon not found'); } console.log('Passed: Content 2 View Standards button icon present'); } }, //Content 2 view standards button text { description: 'Validate Content 2 View Standards button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getText(); if (elementText !== 'View Standards') { throw new Error(`Expected: Content 2 View Standards button text did not match; Actual: "${elementText}"`); } console.log('Passed: Content 2 View Standards button text matched as expected'); } }, //Content 2 view standards button color -green { description: 'Validate Content 2 view standards button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 2 View Standards button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 2 View Standards button color matched as expected'); } }, //NEXT ACTION - APPLY FILTERS { description: 'Apply 8th grade filter', action: async () => await driver.findElement(By.css('#metagrades48')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(5000) }, //Clear link { description: 'Validate Clear link text', action: async () => { const elementText = await driver.findElement(By.css('small > a')).getText(); if (elementText !== 'Clear') { throw new Error(`Expected: "Clear" text did not match; Actual: "${elementText}"`); } console.log('Passed: Clear text matched as expected'); } }, //Home link { description: 'Validate Home link', action: async () => { const elementText = await driver.findElement(By.linkText('Home')).getText(); if (elementText !== 'Home') { throw new Error(`Expected: "Home"; Actual: "${elementText}"`); } console.log('Passed: Home link matched as expected'); } }, //Content breadcrumb { description: 'Validate Content breadcrumb', action: async () => { const elementText = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getText(); if (elementText !== 'Content') { throw new Error(`Expected: "Content"; Actual: "${elementText}"`); } console.log('Passed: Content link matched as expected'); } }, //Detail View button { description: 'Validate Detail View button text', action: async () => { const elementText = await driver.findElement(By.linkText('Detail View')).getText(); if (elementText !== 'Detail View') { throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`); } console.log('Passed: Detail View button text matched as expected'); } }, //Detail View button color -green { description: 'Validate Detail View button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Detail View button color matched as expected'); } }, //Edit View button { description: 'Validate Edit View button text', action: async () => { const elementText = await driver.findElement(By.linkText('Edit View')).getText(); if (elementText !== 'Edit View') { throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`); } console.log('Passed: Edit View button text matched as expected'); } }, //Edit View button color -green { description: 'Validate Edit View button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color'); if (elementStyle !== 'rgba(248, 249, 250, 1)') { throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Edit View button 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 > div.col-xs-12.col-sm-9 > 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'); } }, //APPLIED FILTER //Grade8 filter button { description: 'Validate Grade 8 filter button text', action: async () => { const elementText = await driver.findElement(By.css('.badge')).getText(); if (elementText !== 'Grade: 8') { throw new Error(`Expected: "Grade: 8" text did not match; Actual: "${elementText}"`); } console.log('Passed: Grade 8 text matched as expected'); } }, //Grade8 filter button color -dark gray { description: 'Verify grade 8 filter buttion close icon color', action: async () => { const elementStyle = await driver.findElement(By.css('.badge')).getCssValue('background-color'); if (elementStyle !== 'rgba(108, 117, 125, 1)') { throw new Error(`Expected: Grade 8 button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Grade 8 button color matched as expected'); } }, //Grade8 filter button close icon color -red { description: 'Verify grade 8 filter buttion close icon color', action: async () => { const elementStyle = await driver.findElement(By.css('.glyphicon')).getCssValue('color'); if (elementStyle !== 'rgba(255, 0, 0, 1)') { throw new Error(`Expected: Grade 8 button close icon color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Grade 8 button close icon color matched as expected'); } }, //Filtered esults 1-25 of 667 label { description: 'Validate Filtered Results 1-25 of 6676 label', action: async () => { const elementText = await driver.findElement(By.css('.float-left:nth-child(6)')).getText(); if (elementText !== 'Results 1 - 25 of 667') { throw new Error(`Expected: Filtered "Results 1 - 25 of 667" label; Actual: "${elementText}"`); } console.log('Passed: Filtered Results 1 - 25 of 667 label matched as expected'); } }, //PAGINATION BUTTONS //Show button text { description: 'Validate Show button text', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(7) #contentlimit')).getText(); if (elementText !== 'Show') { throw new Error(`Expected: "Show" button text; Actual: "${elementText}"`); } console.log('Passed: Show button text matched as expected'); } }, //Show dropdown [should be: "25", option] { description: 'Validate Show dropdown option', action: async () => { const elementOption = await driver.findElement(By.css('.form-group:nth-child(7) #inputlimit')).getAttribute('value'); if (elementOption !== '25') { throw new Error(`Expected: "25"; Actual: "${elementOption}"`); } console.log('Passed: Show dropdown option matched as expected'); } }, //Pagination 1 button text { description: 'Validate pagination 1 button text', action: async () => { const elementText = await driver.findElement(By.linkText('1')).getText(); if (elementText !== '1') { throw new Error(`Expected: Pagination "1" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 1 button text matched as expected'); } }, //Pagination 1 background color -green { description: 'Validate pagination 1 button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('1')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 1 button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 1 button color matched as expected'); } }, //Pagination 2 button text { description: 'Validate pagination 2 button text', action: async () => { const elementText = await driver.findElement(By.linkText('2')).getText(); if (elementText !== '2') { throw new Error(`Expected: Pagination "2" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 2 button text matched as expected'); } }, //Pagination 2 text color -green { description: 'Validate pagination 2 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('2')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 2 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 2 text color matched as expected'); } }, //Pagination 3 button text { description: 'Validate pagination 3 button text', action: async () => { const elementText = await driver.findElement(By.linkText('3')).getText(); if (elementText !== '3') { throw new Error(`Expected: Pagination "3" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 3 button text matched as expected'); } }, //Pagination 3 text color -green { description: 'Validate pagination 3 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('3')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 3 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 3 text color matched as expected'); } }, //Pagination 4 button text { description: 'Validate pagination 4 button text', action: async () => { const elementText = await driver.findElement(By.linkText('4')).getText(); if (elementText !== '4') { throw new Error(`Expected: Pagination "4" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 4 button text matched as expected'); } }, //Pagination 4 text color -green { description: 'Validate pagination 4 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('4')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 4 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 4 text color matched as expected'); } }, //Pagination 5 button text { description: 'Validate pagination 5 button text', action: async () => { const elementText = await driver.findElement(By.linkText('5')).getText(); if (elementText !== '5') { throw new Error(`Expected: Pagination "5" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination 5 button text matched as expected'); } }, //Pagination 5 text color -green { description: 'Validate pagination 5 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('5')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination 5 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination 5 text color matched as expected'); } }, //Pagination separator icon { description: 'Verify Pagination separator icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.linkText('...')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Pagination separator icon not found'); } console.log('Passed: Pagination separator icon present'); } }, //Filtered pagination 27 button text { description: 'Validate Filtered pagination 27 button text', action: async () => { const elementText = await driver.findElement(By.linkText('27')).getText(); if (elementText !== '27') { throw new Error(`Expected: Filtered pagination "27" button text; Actual: "${elementText}"`); } console.log('Passed: FilteredpPagination 27 button text matched as expected'); } }, //Filtered pagination 27 text color -green { description: 'Validate pagination 27 text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('27')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Filtered pagination 27 text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Filtered pagination 27 text color matched as expected'); } }, //Pagination Show All button text { description: 'Validate pagination Show All button text', action: async () => { const elementText = await driver.findElement(By.linkText('Show All')).getText(); if (elementText !== 'Show All') { throw new Error(`Expected: Pagination "Show All" button text; Actual: "${elementText}"`); } console.log('Passed: Pagination Show All button text matched as expected'); } }, //Pagination Show All text color -green { description: 'Validate pagination Show All text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Show All')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Pagination Show All text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Pagination Show All text color matched as expected'); } }, //CONTENT RESULTS - CONTENT ITEMS //Filtered Content 1 Title { description: 'Validate Content 1 title', action: async () => { const elementText = await driver.findElement(By.linkText('All Species Inventory')).getText(); if (elementText !== 'All Species Inventory') { throw new Error(`Expected: Filtered Content 1 item "All Species Inventory" title; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 1 item All Species Inventory tittle matched as expected'); } }, //Filtered Content 1 edit icon { description: 'Verify Filtered Content 1 edit icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .lo-title .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Filtered Content 1 edit icon not found'); } console.log('Passed: Filtered Content 1 edit icon present'); } }, //Filtered Content 1 edit button text { description: 'Validate Filtered Content 1 edit button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getText(); if (elementText !== 'Edit') { throw new Error(`Expected: Filtered Content 1 "Edit" button text; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 1 Edit button text matched as expected'); } }, //Filtered Content 1 edit button color -green { description: 'Validate Filtered Content 1 Edit button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .ml-3')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Filtered Content 1 Edit button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Filtered Content 1 Edit button color matched as expected'); } }, //Filtered Content 1 description { description: 'Validate Filtered Content 1 description', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText(); if (elementText !== `In this Science Update, from Science NetLinks, you'll hear an interview with Kevin Kelly, co-founder and board chairman of the All Species Foundation in San Francisco. Kelly discusses his mission to discover, identify, and document every species on Earth within the next 25 years. Students then read more information about the project, and conclude by answering some related questions. Science Updates are audio interviews with scientists and are accompanied by a set of questions as well as links to related Science NetLinks lessons and other related resources.`) { throw new Error(`Expected: Filtered Content 1 description tIn this Science Update, from Science NetLinks, you'll hear an interview with Kevin Kelly, co-founder and board chairman of the All Species Foundation in San Francisco. Kelly discusses his mission to discover, identify, and document every species on Earth within the next 25 years. Students then read more information about the project, and conclude by answering some related questions. Science Updates are audio interviews with scientists and are accompanied by a set of questions as well as links to related Science NetLinks lessons and other related resources.ext did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 1 description text matched as expected'); } }, //Filtered Content 1 content set label { description: 'Validate Filtered Content 1 content set label', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) small')).getText(); if (elementText !== 'Content Set: Biology - QA') { throw new Error(`Expected: Filtered Content 1 content set label did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 1 content set label matched as expected'); } }, //Filtered Content 1 alignment label { description: 'Validate Filtered Content 1 Alignment Pending label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578654 > .display-alignment')).getText(); if (elementText !== 'Alignment Pending (reset)') { throw new Error(`Expected: Filtered Content 1 Alignment Pending label did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 1 Alignment Pending label matched as expected'); } }, //Filtered Content 1 alignment reset label { description: 'Validate Filtered Content 1 Alignment Pending reset label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578654 b')).getText(); if (elementText !== 'reset') { throw new Error(`Expected: Filtered Content 1 Alignment Pending reset label did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 1 Alignment Pending reset label matched as expected'); } }, //Filtered Content 1 view standards button icon { description: 'Verify Content 1 View Standards button icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(8) .well .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 1 View Standards button icon not found'); } console.log('Passed: Content 1 View Standards button icon present'); } }, //Filtered Content 1 view standards button text { description: 'Validate Content 1 View Standards button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getText(); if (elementText !== 'View Standards') { throw new Error(`Expected: Content 1 View Standards button text did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 View Standards button text matched as expected'); } }, //Filtered Content 1 view standards button color -green { description: 'Validate Content 1 view standards button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(8) .well > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 1 View Standards button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 1 View Standards button color matched as expected'); } }, //Filtered Content 2 Title { description: 'Validate Filtered Content 2 title', action: async () => { const elementText = await driver.findElement(By.linkText('Altered Elephant Behavior')).getText(); if (elementText !== 'Altered Elephant Behavior') { throw new Error(`Expected: Filtered Content 2 item "Altered Elephant Behavior" title; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 2 item Altered Elephant Behavior tittle matched as expected'); } }, //Filtered Content 2 edit icon { description: 'Verify Content 2 edit icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .lo-title .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 2 edit icon not found'); } console.log('Passed: Content 2 edit icon present'); } }, //Filtered Content 2 edit button text { description: 'Validate pagination Show All button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getText(); if (elementText !== 'Edit') { throw new Error(`Expected: Content 2 "Edit" button text; Actual: "${elementText}"`); } console.log('Passed: Content 2 Edit button text matched as expected'); } }, //Filtered Content 2 edit button color -green { description: 'Validate Content 2 Edit button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .ml-3')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 2 Edit button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 2 Edit button color matched as expected'); } }, //Filtered Content 2 description { description: 'Validate Filtered Content 2 description', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(2) .lo-descr')).getText(); if (elementText !== 'Poaching is causing alarming changes in the behavior of African elephants.') { throw new Error(`Expected: Filtered Content 2 description text did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 2 description text matched as expected'); } }, //Filtered Content 2 content set label { description: 'Validate Filtered Content 2 content set label', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(2) small')).getText(); if (elementText !== 'Content Set: Biology - QA') { throw new Error(`Expected: Filtered Content 2 content set label did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 2 content set label matched as expected'); } }, //Filtered Content 2 alignment label { description: 'Validate Filtered Content 2 Not Aligned label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578655 > .display-alignment')).getText(); if (elementText !== 'Not Aligned') { throw new Error(`Expected: Filtered Content 2 Not Aligned label did not match; Actual: "${elementText}"`); } console.log('Passed: Filtered Content 2 Not Aligned label matched as expected'); } }, //Filtered Content 2 view standards button icon { description: 'Verify Content 2 View Standards button icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.card:nth-child(9) .well .fa')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Content 2 View Standards button icon not found'); } console.log('Passed: Content 2 View Standards button icon present'); } }, //Filtered Content 2 view standards button text { description: 'Validate Content 2 View Standards button text', action: async () => { const elementText = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getText(); if (elementText !== 'View Standards') { throw new Error(`Expected: Content 2 View Standards button text did not match; Actual: "${elementText}"`); } console.log('Passed: Content 2 View Standards button text matched as expected'); } }, //Filtered Content 2 view standards button color -green { description: 'Validate Content 2 view standards button color', action: async () => { const elementStyle = await driver.findElement(By.css('.card:nth-child(9) .well > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Expected: Content 2 View Standards button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content 2 View Standards button color matched as expected'); } }, //NEXT ACTION - VIEW EDIT MODE { description: 'Click Edit View button', action: async () => await driver.findElement(By.linkText('Edit View')).click() }, //Wait for dashboard to load - Correlation Coverages View Details button { description: 'Wait for Actions button to load', action: async () => { return await driver.wait(until.elementLocated(By.linkText('Actions')), 10000).catch(() => false); } }, //Detail View button { description: 'Validate Detail View button text', action: async () => { const elementText = await driver.findElement(By.linkText('Detail View')).getText(); if (elementText !== 'Detail View') { throw new Error(`Expected: "Detail View" button text; Actual: "${elementText}"`); } console.log('Passed: Detail View button text matched as expected'); } }, //Detail View button color -green { description: 'Validate Detail View button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Detail View')).getCssValue('background-color'); if (elementStyle !== 'rgba(248, 249, 250, 1)') { throw new Error(`Detail View button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Detail View button color matched as expected'); } }, //Edit View button { description: 'Validate Edit View button text', action: async () => { const elementText = await driver.findElement(By.linkText('Edit View')).getText(); if (elementText !== 'Edit View') { throw new Error(`Expected: "Edit View" button text; Actual: "${elementText}"`); } console.log('Passed: Edit View button text matched as expected'); } }, //Edit View button color -dark blue { description: 'Validate Edit View button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Edit View')).getCssValue('background-color'); if (elementStyle !== 'rgba(40, 39, 90, 1)') { throw new Error(`Edit View button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Edit View button color matched as expected'); } }, //Select All checkbox { description: 'Verify Select All checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#selectToggle')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Select All checkbox icon not found'); } console.log('Passed: Select All checkbox icon present'); } }, //Select All label { description: 'Validate Select All label', action: async () => { const elementText = await driver.findElement(By.css('.btn-default')).getText(); if (elementText !== 'Select All / None') { throw new Error(`Expected: "Select All / None" label; Actual: "${elementText}"`); } console.log('Passed: Select All / None label matched as expected'); } }, //Actions button { description: 'Validate Actions button text', action: async () => { const elementText = await driver.findElement(By.linkText('Actions')).getText(); if (elementText !== 'Actions') { throw new Error(`Expected: "Actions" button text; Actual: "${elementText}"`); } console.log('Passed: Actions button text matched as expected'); } }, //Actions button color -green { description: 'Validate Actions button color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Actions')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Actions button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Actions button color matched as expected'); } }, //First content item checkbox (All Species Inventory) { description: 'Verify All Species Inventory alignment checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#cu873578654')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('All Species Inventory alignment checkbox icon not found'); } console.log('Passed: All Species Inventory alignment checkbox icon present'); } }, //First content link { description: 'Validate All Species Inventory link text', action: async () => { const elementText = await driver.findElement(By.linkText('All Species Inventory')).getText(); if (elementText !== 'All Species Inventory') { throw new Error(`Expected: "All Species Inventory" link text; Actual: "${elementText}"`); } console.log('Passed: All Species Inventory link text matched as expected'); } }, //First content item edit button { description: 'Validate All Species Inventory Edit button text', action: async () => { const elementText = await driver.findElement(By.css('#\\38 73578654 .ml-3')).getText(); if (elementText !== 'Edit') { throw new Error(`Expected: All Species Inventory alignment "Edit" button text; Actual: "${elementText}"`); } console.log('Passed: All Species Inventory alignment "Edit" button text matched as expected'); } }, //First content item edit button color -green { description: 'Validate All Species Inventory Edit button color', action: async () => { const elementStyle = await driver.findElement(By.css('#\\38 73578654 .ml-3')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`All Species Inventory "Edit" button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: All Species Inventory alignment "Edit" button color matched as expected'); } }, //First content item alignment pending text { description: 'Validate All Species Inventory alignment pending text', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578654 > .display-alignment')).getText(); if (elementText !== 'Alignment Pending (reset)') { throw new Error(`Expected: All Species Inventory alignment "Alignment Pending" text; Actual: "${elementText}"`); } console.log('Passed: All Species Inventory alignment "Alignment Pending" text matched as expected'); } }, //First content item alignment pending text (reset) { description: 'Validate All Species Inventory alignment reset text', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578654 > div > a > b')).getText(); if (elementText !== 'reset') { throw new Error(`Expected: All Species Inventory alignment "(reset)" text; Actual: "${elementText}"`); } console.log('Passed: All Species Inventory alignment "(reset)" text matched as expected'); } }, //Second content item checkbox (Altered Elephant Behavior) { description: 'Verify Altered Elephant Behavior checkbox icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('#cu873578655')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Altered Elephant Behavior checkbox icon not found'); } console.log('Passed: Altered Elephant Behavior checkbox icon present'); } }, //Second content link { description: 'Validate Altered Elephant Behavior link text', action: async () => { const elementText = await driver.findElement(By.linkText('Altered Elephant Behavior')).getText(); if (elementText !== 'Altered Elephant Behavior') { throw new Error(`Expected: "Altered Elephant Behavior" link text; Actual: "${elementText}"`); } console.log('Passed: Altered Elephant Behavior link text matched as expected'); } }, //Second content item edit button { description: 'Validate Altered Elephant Behavior Edit button text', action: async () => { const elementText = await driver.findElement(By.css('#\\38 73578655 .ml-3')).getText(); if (elementText !== 'Edit') { throw new Error(`Expected: Altered Elephant Behavior "Edit" button text; Actual: "${elementText}"`); } console.log('Passed: Altered Elephant Behavior "Edit" button text matched as expected'); } }, //Second content item edit button color -green { description: 'Validate Altered Elephant Behavior Edit button color', action: async () => { const elementStyle = await driver.findElement(By.css('#\\38 73578655 .ml-3')).getCssValue('background-color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { throw new Error(`Altered Elephant Behavior Edit button color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Altered Elephant Behavior "Edit" button color matched as expected'); } }, //Second content item alignment pending text { description: 'Validate Altered Elephant Behavior alignment pending text', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink873578655 > .display-alignment')).getText(); if (elementText !== 'Not Aligned') { throw new Error(`Expected: Altered Elephant Behavior "Not Aligned" text; Actual: "${elementText}"`); } console.log('Passed: Altered Elephant Behavior "Not Aligned" text matched as expected'); } }, //NEXT ACTION - VIEW ACTION ITEMS { description: 'Click Actions button', action: async () => await driver.findElement(By.linkText('Actions')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, //Move link { description: 'Validate Move link text', action: async () => { const elementText = await driver.findElement(By.linkText('Move')).getText(); if (elementText !== 'Move') { throw new Error(`Expected: "Move" button text; Actual: "${elementText}"`); } console.log('Passed: Move button text matched as expected'); } }, //Copy link { description: 'Validate Copy link text', action: async () => { const elementText = await driver.findElement(By.linkText('Copy')).getText(); if (elementText !== 'Copy') { throw new Error(`Expected: "Copy" button text; Actual: "${elementText}"`); } console.log('Passed: Copy button text matched as expected'); } }, //Edit Metadata link { description: 'Validate Edit Metadata link text', action: async () => { const elementText = await driver.findElement(By.linkText('Edit Metadata')).getText(); if (elementText !== 'Edit Metadata') { throw new Error(`Expected: "Edit Metadata" button text; Actual: "${elementText}"`); } console.log('Passed: Edit Metadata button text matched as expected'); } }, //Tag Concepts link { description: 'Validate Tag Concepts link text', action: async () => { const elementText = await driver.findElement(By.linkText('Tag Concepts')).getText(); if (elementText !== 'Tag Concepts') { throw new Error(`Expected: "Tag Concepts" button text; Actual: "${elementText}"`); } console.log('Passed: Tag Concepts button text matched as expected'); } }, //AutoAlign link { description: 'Validate AutoAlign link text', action: async () => { const elementText = await driver.findElement(By.linkText('AutoAlign')).getText(); if (elementText !== 'AutoAlign') { throw new Error(`Expected: "AutoAlign" button text; Actual: "${elementText}"`); } console.log('Passed: AutoAlign button text matched as expected'); } }, //Delete link { description: 'Validate Delete link text', action: async () => { const elementText = await driver.findElement(By.linkText('Delete')).getText(); if (elementText !== 'Delete') { throw new Error(`Expected: "Delete" button text; Actual: "${elementText}"`); } console.log('Passed: Delete button text matched as expected'); } }, //Delete text color -red { description: 'Validate Delte text color', action: async () => { const elementStyle = await driver.findElement(By.linkText('Delete')).getCssValue('color'); if (elementStyle !== 'rgba(220, 53, 69, 1)') { throw new Error(`Actions Delete text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Delete text color matched as expected'); } }, ]; const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => { const json_data = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); json_data.push([stepIndex, stepDescription, status, timestamp, screenshotPath]); return XLSX.utils.aoa_to_sheet(json_data); }; const takeScreenshot = async (driver, stepIndex, stepDescription) => { const screenshot = await driver.takeScreenshot(); const dir = path.join('screenshots', 'contentPage'); 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', 'contentPage'); if (fs.existsSync(screenshotDir)) { fs.rmSync(screenshotDir, { recursive: true, force: true }); } fs.mkdirSync(screenshotDir, { recursive: true }); // Remove old Excel file if (fs.existsSync('contentPageResults.xlsx')) { fs.unlinkSync('contentPageResults.xlsx'); } }; try { // Initialize workbook and worksheet clearOldResults(); // Initialize workbook and worksheet workbook = XLSX.utils.book_new(); worksheet = XLSX.utils.aoa_to_sheet([ ['Step Number', 'Step Description', 'Status', 'Timestamp', 'Screenshot'] ]); XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1'); // Log test start time worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, ''); for (const step of steps) { const stepIndex = steps.indexOf(step) + 1; const timestamp = new Date().toISOString(); try { await step.action(); const screenshotPath = await takeScreenshot(driver, stepIndex, step.description); worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath); } catch (error) { const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`); worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath); console.error(`Step ${stepIndex} FAILED: ${error.message}`); testStatus = 'Failed'; } } //Check if login was successful const usernameValidation = await driver.wait(until.elementLocated(By.css('#navbarDropdown > span')), 5000).catch(() => false); if (usernameValidation) { console.log('PASSED: System logged in as expected'); testStatus = 'Passed'; } else { console.log('FAILED: Unable to log in'); testStatus = 'Failed'; } // Log test end time const endTime = new Date().toISOString(); worksheet = logStep(worksheet, 'Test End', testStatus, '', endTime, ''); // Write the updated worksheet back to the workbook and save it workbook.Sheets['Sheet1'] = worksheet; XLSX.writeFile(workbook, 'contentPageResults.xlsx'); } finally { await driver.quit(); } })(); } export default ExACT_contentPage;