From dda060d5d2e410f7ad936c62381c4b46d968e536 Mon Sep 17 00:00:00 2001 From: jhuerta Date: Mon, 13 Jan 2025 14:55:59 -0800 Subject: [PATCH] Completed AlignContent --- tests/ExACT_alignContentPage.js | 609 +++++++++++++++++++++++++++++++- 1 file changed, 606 insertions(+), 3 deletions(-) diff --git a/tests/ExACT_alignContentPage.js b/tests/ExACT_alignContentPage.js index e8795f2..d47113b 100644 --- a/tests/ExACT_alignContentPage.js +++ b/tests/ExACT_alignContentPage.js @@ -1200,10 +1200,613 @@ const steps = [ description: 'Validate Subject: Science count', action: async () => { const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText(); - if (elementText !== 'Science (2)') { - throw new Error(`Expected: "Subject: Science (2)"; Actual: "${elementText}"`); + if (elementText !== 'Science') { + throw new Error(`Expected: Subject: "Science"; Actual: "${elementText}"`); } - console.log('Passed: Subject: Science (2) label matched as expected'); + console.log('Passed: Subject: Science 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'); + } + }, + + //APPLIED FILTERS + //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'); + } + }, + + //SubjectScience filter button + { + description: 'Validate Subject Science filter button text', + action: async () => { + const elementText = await driver.findElement(By.css('.badge:nth-child(4)')).getText(); + if (elementText !== 'Subject: Science') { + throw new Error(`Expected: "Subject: Science" text did not match; Actual: "${elementText}"`); + } + console.log('Passed: Subject: Science text matched as expected'); + } + }, + + //SubjectScience filter button color -dark gray + { + description: 'Verify Subject Science filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(4)')).getCssValue('background-color'); + if (elementStyle !== 'rgba(108, 117, 125, 1)') { + throw new Error(`Expected: Subject: Science button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Subject: Science button color matched as expected'); + } + }, + + //SubjectScience button close icon color -red + { + description: 'Verify Subject Science filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(4) .glyphicon')).getCssValue('color'); + if (elementStyle !== 'rgba(255, 0, 0, 1)') { + throw new Error(`Expected: Subject: Science button close icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Subject: Science button close icon color matched as expected'); + } + }, + + //SubjectSocialStudies filter button + { + description: 'Validate Subject Social Studies filter button text', + action: async () => { + const elementText = await driver.findElement(By.css('.badge:nth-child(5)')).getText(); + if (elementText !== 'Subject: Social Studies') { + throw new Error(`Expected: "Subject: Social Studies" text did not match; Actual: "${elementText}"`); + } + console.log('Passed: Subject: Social Studies text matched as expected'); + } + }, + + //SubjectSocialStudies filter button color -dark gray + { + description: 'Verify Subject Social Studies filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(5)')).getCssValue('background-color'); + if (elementStyle !== 'rgba(108, 117, 125, 1)') { + throw new Error(`Expected: Subject: Social Studies button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Subject: Social Studies button color matched as expected'); + } + }, + + //SubjectSocialStudies button close icon color -red + { + description: 'Verify Subject Social Studies filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(5) .glyphicon')).getCssValue('color'); + if (elementStyle !== 'rgba(255, 0, 0, 1)') { + throw new Error(`Expected: Subject: Social Studies button close icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Subject: Social Studies button close icon color matched as expected'); + } + }, + + //AlignmentStatusPending filter button + { + description: 'Validate Alignment Status Pending filter button text', + action: async () => { + const elementText = await driver.findElement(By.css('.badge:nth-child(6)')).getText(); + if (elementText !== 'Alignment Status: Pending') { + throw new Error(`Expected: "Alignment Status: Pending" text did not match; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status: Pending text matched as expected'); + } + }, + + //AlignmentStatusPending filter button color -dark gray + { + description: 'Verify Alignment Status Pending filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(6)')).getCssValue('background-color'); + if (elementStyle !== 'rgba(108, 117, 125, 1)') { + throw new Error(`Expected: Alignment Status: Pending button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Alignment Status: Pending button color matched as expected'); + } + }, + + //AlignmentStatusPending button close icon color -red + { + description: 'Verify Alignment Status Pending filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(6) .glyphicon')).getCssValue('color'); + if (elementStyle !== 'rgba(255, 0, 0, 1)') { + throw new Error(`Expected: Alignment Status: Pending button close icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Alignment Status: Pending button close icon color matched as expected'); + } + }, + + //AlignmentStatusAligned filter button + { + description: 'Validate Alignment Status Aligned filter button text', + action: async () => { + const elementText = await driver.findElement(By.css('.badge:nth-child(7)')).getText(); + if (elementText !== 'Alignment Status: Aligned') { + throw new Error(`Expected: "Alignment Status: Aligned" text did not match; Actual: "${elementText}"`); + } + console.log('Passed: Alignment Status: Aligned text matched as expected'); + } + }, + + //AlignmentStatusAligned filter button color -dark gray + { + description: 'Verify Alignment Status Aligned filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(7)')).getCssValue('background-color'); + if (elementStyle !== 'rgba(108, 117, 125, 1)') { + throw new Error(`Expected: Alignment Status: Aligned button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Alignment Status: Aligned button color matched as expected'); + } + }, + + //AlignmentStatusAligned button close icon color -red + { + description: 'Verify Alignment Status Aligned filter buttion close icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge:nth-child(7) .glyphicon')).getCssValue('color'); + if (elementStyle !== 'rgba(255, 0, 0, 1)') { + throw new Error(`Expected: Alignment Status: Aligned button close icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Alignment Status: Aligned button close icon color matched as expected'); + } + }, + + //Filtered Results 2-2 of 2 label (top) + { + description: 'Validate Filtered Results 1-2 of 2 label', + action: async () => { + const elementText = await driver.findElement(By.css('.float-left:nth-child(10)')).getText(); + if (elementText !== 'Results 1 - 2 of 2') { + throw new Error(`Expected: Filtered "Results 1 - 2 of 2" label; Actual: "${elementText}"`); + } + console.log('Passed: Filtered Results 1 - 2 of 2 label 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(12) .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(12) .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(12) .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(12) .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(12) 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') { + 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(12) .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(12) .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(12) .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('Andrew Skurka: Trekking the Wild North')).getText(); + if (elementText !== 'Andrew Skurka: Trekking the Wild North') { + throw new Error(`Expected: Filtered Content 2 item "Andrew Skurka: Trekking the Wild North" title; Actual: "${elementText}"`); + } + console.log('Passed: Filtered Content 2 item Andrew Skurka: Trekking the Wild North 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(13) .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(13) .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(13) .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(13) .lo-descr')).getText(); + if (elementText !== 'Video. From the Best of NG Live Collection: Get the inside story of the gear and the grit needed by National Geographic grantee Andrew Skurka for his six-month, 4,700-mile expedition through Alaska and the Yukon.') { + 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(13) 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 Alignment Pending label', + action: async () => { + const elementText = await driver.findElement(By.css('#alignstatuslink873578658 > .display-alignment')).getText(); + if (elementText !== 'Alignment Pending') { + throw new Error(`Expected: Filtered Content 2 Alignment Pending label did not match; Actual: "${elementText}"`); + } + console.log('Passed: Filtered Content 2 Alignment Pending label matched as expected'); + } + }, + + //Filtered Content 2 alignment reset label + { + description: 'Validate Filtered Content 2 Alignment Pending reset label', + action: async () => { + const elementText = await driver.findElement(By.css('#alignstatuslink873578658 b')).getText(); + if (elementText !== 'reset') { + throw new Error(`Expected: Filtered Content 2 Alignment Pending reset label did not match; Actual: "${elementText}"`); + } + console.log('Passed: Filtered Content 2 Alignment Pending reset 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(13) .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(13) .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(13) .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'); + } + }, + + //Filtered Results 2-2 of 2 label (bottom) + { + description: 'Validate Filtered Results 1-2 of 2 label', + action: async () => { + const elementText = await driver.findElement(By.css('.float-left:nth-child(15)')).getText(); + if (elementText !== 'Results 1 - 2 of 2') { + throw new Error(`Expected: Filtered "Results 1 - 2 of 2" label; Actual: "${elementText}"`); + } + console.log('Passed: Filtered Results 1 - 2 of 2 label matched as expected'); } },