diff --git a/tests/ExACT_editItemAddConcept.js b/tests/ExACT_editItemAddConcept.js index d1ed869..4d9fa65 100644 --- a/tests/ExACT_editItemAddConcept.js +++ b/tests/ExACT_editItemAddConcept.js @@ -329,7 +329,7 @@ const steps = [ } }, - //NEXT ACTION - Click Bioloty QA link + //NEXT ACTION - Click Biology QA link { description: 'Click Biology - QA link', action: async () => await driver.findElement(By.linkText('Biology - QA')).click() }, //Wait page to load @@ -3446,120 +3446,13 @@ const steps = [ description: 'Validate Tagged Concept 1 header text', action: async () => { try { - const element = await driver.findElement(By.css('#k786')); + const element = await driver.findElement(By.css('#k722')); //Get different versions of the text for debugging const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Habits of the Mind | Curiosity'; - const trimmedFullText = fullText.trim(); - const firstLine = trimmedFullText.split('\n')[0].trim(); - - //Try multiple matching strategies - if (firstLine.includes(expectedText)) { - console.log(`Passed: "${expectedText}" text in first line`); - } else if (trimmedFullText.includes(expectedText)) { - console.log(`Passed: "${expectedText}" text within full text`); - } else { - throw new Error( - `Text validation failed.\nExpected: "${expectedText}"\n` + - `Full text: "${fullText}"\n` + - `First line: "${firstLine}"\n` - ); - } - - } catch (error) { - console.error('Detailed error during validation:', error); - throw error; //Re-throw after logging - } - } - }, - - //Tagged concept 1 header text color -gray - { - description: 'Validate Tagged concept 1 header text color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#k786')).getCssValue('color'); - if (elementStyle !== 'rgba(99, 99, 99, 1)') { - throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Tagged Concept 1 header text color matched as expected'); - } - }, - - //Tagged Concept 1 remove button icon - { - description: 'Verify Tagged Concept remove button 1 icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k786 .glyphicon')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Tagged Concept 1 "Remove" button icon not found'); - } - console.log('Passed: Tagged Concept 1 Remove button icon present'); - } - }, - - //Tagged Concept 1 remove button text - { - description: 'Validate Tagged Concept 1 delete button text', - action: async () => { - const elementText = await driver.findElement(By.css('#k786 > .btn')).getText(); - if (elementText !== 'Remove') { - throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`); - } - console.log('Passed: Tagged Concept 1 Remove button text matched as expected'); - } - }, - - //Tagged Concept 1 remove button color -red - { - description: 'Validate Tagged Concept 1 remove button label color', - action: async () => { - const elementStyle = await driver.findElement(By.css('#k786 > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(246, 60, 40, 1)') { - throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Tagged Concept 1 Remove button color matched as expected'); - } - }, - - //Tagged Concept 1 remove button -tooltip - { - description: 'Validate Tagged Concept 1 remove button tooltip', - action: async () => { - const elementStyle = await driver.findElement(By.css('#k786 > .btn')).getAttribute('title'); - if (elementStyle !== 'Remove Concept') { - throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Tagged Concept 1 Remove Concept button tooltip matched as expected'); - } - }, - - //Tagged Concept 1 primary toggle button - { - description: 'Verify Tagged Concept 1 primary toggle button is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k786 .switch-primary')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Tagged Concept 1 "Primary" toggle button icon not found'); - } - console.log('Passed: Tagged Concept 1 Primary toggle button icon present'); - } - }, - - //Tagged Concept 2 header text - { - description: 'Validate Tagged Concept 2 header text', - action: async () => { - try { - const element = await driver.findElement(By.css('#k933')); - - //Get different versions of the text for debugging - const fullText = await element.getText(); - - //Check for the expected text in different ways - const expectedText = 'Science | Physical Science | Physics | General'; + const expectedText = 'Science | Concepts and Processes | Theories | General'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -3583,90 +3476,90 @@ const steps = [ } }, - //Tagged Concept 2 header text color -gray + //Tagged concept 1 header text color -gray { - description: 'Validate Tagged Concept 2 header text color', + description: 'Validate Tagged concept 1 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k722')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { - throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Tagged Concept 2 header text color matched as expected'); + console.log('Passed: Tagged Concept 1 header text color matched as expected'); } }, - //Tagged Concept 2 remove button icon + //Tagged Concept 1 remove button icon { - description: 'Verify Tagged Concept remove button 2 icon is present', + description: 'Verify Tagged Concept remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k722 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { - throw new Error('Tagged Concept 2 "Remove" button icon not found'); + throw new Error('Tagged Concept 1 "Remove" button icon not found'); } - console.log('Passed: Tagged Concept 2 Remove button icon present'); + console.log('Passed: Tagged Concept 1 Remove button icon present'); } }, - //Tagged Concept 2 remove button text + //Tagged Concept 1 remove button text { - description: 'Validate Tagged Concept 2 delete button text', + description: 'Validate Tagged Concept 1 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k933 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k722 > .btn')).getText(); if (elementText !== 'Remove') { - throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); + throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`); } - console.log('Passed: Tagged Concept 2 Remove button text matched as expected'); + console.log('Passed: Tagged Concept 1 Remove button text matched as expected'); } }, - //Tagged Concept 2 remove button color -red + //Tagged Concept 1 remove button color -red { - description: 'Validate Tagged Concept 2 remove button label color', + description: 'Validate Tagged Concept 1 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k722 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { - throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Tagged Concept 2 Remove button color matched as expected'); + console.log('Passed: Tagged Concept 1 Remove button color matched as expected'); } }, - //Tagged Concept 2 remove button -tooltip + //Tagged Concept 1 remove button -tooltip { - description: 'Validate Tagged Concept 2 remove button tooltip', + description: 'Validate Tagged Concept 1 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k722 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { - throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Tagged Concept 2 Remove Concept button tooltip matched as expected'); + console.log('Passed: Tagged Concept 1 Remove Concept button tooltip matched as expected'); } }, - //Tagged Concept 2 primary toggle button + //Tagged Concept 1 primary toggle button { - description: 'Verify Tagged Concept 2 primary toggle button is present', + description: 'Verify Tagged Concept 1 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k722 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { - throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); + throw new Error('Tagged Concept 1 "Primary" toggle button icon not found'); } - console.log('Passed: Tagged Concept 2 Primary toggle button icon present'); + console.log('Passed: Tagged Concept 1 Primary toggle button icon present'); } }, - //Tagged Concept 3 header text + //Tagged Concept 2 header text { - description: 'Validate Tagged Concept 3 header text', + description: 'Validate Tagged Concept 2 header text', action: async () => { try { - const element = await driver.findElement(By.css('#k26613360')); + const element = await driver.findElement(By.css('#k757')); //Get different versions of the text for debugging const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Habits of the Mind | General'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Theories`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -3690,90 +3583,90 @@ const steps = [ } }, - //Tagged Concept 3 header text color -gray + //Tagged Concept 2 header text color -gray { - description: 'Validate Tagged Concept 3 header text color', + description: 'Validate Tagged Concept 2 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k757')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { - throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Tagged Concept 3 header text color matched as expected'); + console.log('Passed: Tagged Concept 2 header text color matched as expected'); } }, - //Tagged Concept 3 remove button icon + //Tagged Concept 2 remove button icon { - description: 'Verify Tagged Concept remove button 3 icon is present', + description: 'Verify Tagged Concept remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k757 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { - throw new Error('Tagged Concept 3 "Remove" button icon not found'); + throw new Error('Tagged Concept 2 "Remove" button icon not found'); } - console.log('Passed: Tagged Concept 3 Remove button icon present'); + console.log('Passed: Tagged Concept 2 Remove button icon present'); } }, - //Tagged Concept 3 remove button text + //Tagged Concept 2 remove button text { - description: 'Validate Tagged Concept 3 delete button text', + description: 'Validate Tagged Concept 2 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k26613360 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k757 > .btn')).getText(); if (elementText !== 'Remove') { - throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); + throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); } - console.log('Passed: Tagged Concept 3 Remove button text matched as expected'); + console.log('Passed: Tagged Concept 2 Remove button text matched as expected'); } }, - //Tagged Concept 3 remove button color -red + //Tagged Concept 2 remove button color -red { - description: 'Validate Tagged Concept 3 remove button label color', + description: 'Validate Tagged Concept 2 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k757 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { - throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Tagged Concept 3 Remove button color matched as expected'); + console.log('Passed: Tagged Concept 2 Remove button color matched as expected'); } }, - //Tagged Concept 3 remove button -tooltip + //Tagged Concept 2 remove button -tooltip { - description: 'Validate Tagged Concept 3 remove button tooltip', + description: 'Validate Tagged Concept 2 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k757 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { - throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Tagged Concept 3 Remove Concept button tooltip matched as expected'); + console.log('Passed: Tagged Concept 2 Remove Concept button tooltip matched as expected'); } }, - //Tagged Concept 3 primary toggle button + //Tagged Concept 2 primary toggle button { - description: 'Verify Tagged Concept 3 primary toggle button is present', + description: 'Verify Tagged Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k757 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { - throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); + throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); } - console.log('Passed: Tagged Concept 3 Primary toggle button icon present'); + console.log('Passed: Tagged Concept 2 Primary toggle button icon present'); } }, - //Tagged Concept 4 header text + //Tagged Concept 3 header text { - description: 'Validate Tagged Concept 4 header text', + description: 'Validate Tagged Concept 3 header text', action: async () => { try { - const element = await driver.findElement(By.css('#k37785094')); + const element = await driver.findElement(By.css('#k195335436')); //Get different versions of the text for debugging const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Earth Science | Topography | General'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -3797,11 +3690,118 @@ const steps = [ } }, + //Tagged Concept 3 header text color -gray + { + description: 'Validate Tagged Concept 3 header text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#k195335436')).getCssValue('color'); + if (elementStyle !== 'rgba(99, 99, 99, 1)') { + throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Tagged Concept 3 header text color matched as expected'); + } + }, + + //Tagged Concept 3 remove button icon + { + description: 'Verify Tagged Concept remove button 3 icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k195335436 .glyphicon')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Tagged Concept 3 "Remove" button icon not found'); + } + console.log('Passed: Tagged Concept 3 Remove button icon present'); + } + }, + + //Tagged Concept 3 remove button text + { + description: 'Validate Tagged Concept 3 delete button text', + action: async () => { + const elementText = await driver.findElement(By.css('#k195335436 > .btn')).getText(); + if (elementText !== 'Remove') { + throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); + } + console.log('Passed: Tagged Concept 3 Remove button text matched as expected'); + } + }, + + //Tagged Concept 3 remove button color -red + { + description: 'Validate Tagged Concept 3 remove button label color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#k195335436 > .btn')).getCssValue('background-color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Tagged Concept 3 Remove button color matched as expected'); + } + }, + + //Tagged Concept 3 remove button -tooltip + { + description: 'Validate Tagged Concept 3 remove button tooltip', + action: async () => { + const elementStyle = await driver.findElement(By.css('#k195335436 > .btn')).getAttribute('title'); + if (elementStyle !== 'Remove Concept') { + throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Tagged Concept 3 Remove Concept button tooltip matched as expected'); + } + }, + + //Tagged Concept 3 primary toggle button + { + description: 'Verify Tagged Concept 3 primary toggle button is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k195335436 .switch-primary')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); + } + console.log('Passed: Tagged Concept 3 Primary toggle button icon present'); + } + }, + + //Tagged Concept 4 header text + { + description: 'Validate Tagged Concept 4 header text', + action: async () => { + try { + const element = await driver.findElement(By.css('#k425604099')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Science | General'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 4 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 4 "${expectedText}" text within full text`); + } else { + throw new Error( + `Text validation failed.\nExpected: "${expectedText}"\n` + + `Full text: "${fullText}"\n` + + `First line: "${firstLine}"\n` + ); + } + + } catch (error) { + console.error('Detailed error during validation:', error); + throw error; //Re-throw after logging + } + } + }, + //Tagged Concept 4 header text color -gray { description: 'Validate Tagged Concept 4 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`); } @@ -3813,7 +3813,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 4 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Remove" button icon not found'); } @@ -3825,7 +3825,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785094 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -3837,7 +3837,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 4 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -3849,7 +3849,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -3861,7 +3861,7 @@ const steps = [ { description: 'Verify Tagged Concept 4 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Primary" toggle button icon not found'); } @@ -4485,7 +4485,7 @@ const steps = [ } }, - //Title checkbox + //Title checkbox {ECS-2920} { description: 'Verify Title checkbox is present', action: async () => @@ -5107,13 +5107,13 @@ const steps = [ } }, - //NEXT ACTION + //NEXT ACTION - Select description { description: 'Select Description checkbox', action: async () => await driver.findElement(By.css('#inlineCheckbox2')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, - //NEXT ACTION + //NEXT ACTION - Select science { description: 'Select Subject Area - Science', action: async () => await driver.findElement(By.css('#concept_subjects > option:nth-child(3)')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, - //NEXT ACTION + //NEXT ACTION - Click Suggest Concepts button { description: 'Click Suggest Concepts button', action: async () => await driver.findElement(By.css('.btn:nth-child(9)')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, @@ -5121,10 +5121,8 @@ const steps = [ { description: 'Scroll to Find Concepts widget title', action: async () => { - const location = await driver.findElement(By.css('p')); - await driver.actions() - .scroll(0, 0, 0, 0, location) - .perform() + const location = await driver.findElement(By.css('p')); + await driver.executeScript("arguments[0].scrollIntoView({block: 'center'});", location); } }, @@ -5286,7 +5284,7 @@ const steps = [ { description: 'Verify Suggested Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#suggested_concepts .list-group-item:nth-child(2) .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Suggested Concept 2 "Primary" toggle button icon not found'); } @@ -5341,7 +5339,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`; + const expectedText = `Science | Earth Science | Climate`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -5507,7 +5505,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Life Science (Biology) | Environment | Human Factors | Global Warming'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -5543,24 +5541,25 @@ const steps = [ } }, - //NEXT ACTION - Click concept 2 Primary toggle - { description: 'Click Concept 2 Primary toggle icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) label')).click() }, + //NEXT ACTION - Click concept 3 Primary toggle (Science | Earth Science | Climate) + { description: 'Click Concept 3 Primary toggle icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(3) label')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, - //Suggested Concept 5 Primary label + //Suggested Concept 3 Primary label { - description: 'Validate Suggested Concept 5 Primary label', + description: 'Validate Suggested Concept 3 Primary label', action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) .switch-primary')).getText(); + const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) .switch-primary')).getText(); if (elementText !== 'Primary') { throw new Error(`Expected: "Primary" toggle indicator; Actual: "${elementText}"`); } console.log('Passed: Primary toggle indicator displayed as expected'); } }, - - //NEXT ACTION - Click concept 2 Add button - { description: 'Click Concept 2 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .btn')).click() }, + + //NEXT ACTION - Click concept 3 Add button (Science | Earth Science | Climate) + { description: 'Click Concept 3 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, //Added suggested concept confirmation alert title { @@ -5588,7 +5587,7 @@ const steps = [ //Added suggested concept confirmation X icon { - description: 'Verify Added suggested concept confirmation Xicon is present', + description: 'Verify Added suggested concept confirmation X icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.ml-2 > span')), 5000).catch(() => false); if (!expectedIcon) { @@ -5603,8 +5602,8 @@ const steps = [ description: 'Validate Added suggested concept confirmation alert DIV description', action: async () => { const elementText = await driver.findElement(By.css('.toast-body')).getText(); - if (elementText !== 'Science | History / Technology / Social Perspectives | Nature of Science') { - throw new Error(`Expected: "Science | History / Technology / Social Perspectives | Nature of Science" Confirmation DIV description text did not match; Actual: "${elementText}"`); + if (elementText !== 'Science | Earth Science | Climate') { + throw new Error(`Expected: "Science | Earth Science | Climate" Confirmation DIV description text did not match; Actual: "${elementText}"`); } console.log('Passed: Confirmation DIV description text displayed as expected'); } @@ -5626,10 +5625,8 @@ const steps = [ { description: 'Scrolled to page title', action: async () => { - const location = await driver.findElement(By.css('#myModalLabel')); - await driver.actions() - .scroll(0, 0, 0, 0, location) - .perform() + const location = await driver.findElement(By.css('#myModalLabel')); + await driver.executeScript("arguments[0].scrollIntoView({block: 'center'});", location); } }, @@ -5668,7 +5665,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Habits of the Mind | Curiosity'; + const expectedText = 'Science | Concepts and Processes | Theories | General'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -5696,7 +5693,7 @@ const steps = [ { description: 'Validate Tagged concept 1 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k786')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k722')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`); } @@ -5708,7 +5705,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k786 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k722 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 1 "Remove" button icon not found'); } @@ -5720,7 +5717,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k786 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k722 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -5732,7 +5729,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k786 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k722 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -5744,7 +5741,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k786 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k722 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -5756,7 +5753,7 @@ const steps = [ { description: 'Verify Tagged Concept 1 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k786 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k722 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 1 "Primary" toggle button icon not found'); } @@ -5775,7 +5772,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Physical Science | Physics | General'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Theories`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -5803,7 +5800,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k757')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); } @@ -5815,7 +5812,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k757 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Remove" button icon not found'); } @@ -5827,7 +5824,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k933 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k757 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -5839,7 +5836,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k757 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -5851,7 +5848,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k757 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -5863,7 +5860,7 @@ const steps = [ { description: 'Verify Tagged Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k757 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); } @@ -5882,7 +5879,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Habits of the Mind | General'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -5910,7 +5907,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k195335436')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); } @@ -5922,7 +5919,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 3 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k195335436 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Remove" button icon not found'); } @@ -5934,7 +5931,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k26613360 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k195335436 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -5946,7 +5943,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k195335436 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -5958,7 +5955,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k195335436 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -5970,7 +5967,7 @@ const steps = [ { description: 'Verify Tagged Concept 3 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k195335436 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); } @@ -5989,7 +5986,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Earth Science | Topography | General'; + const expectedText = 'Science | General'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -6017,7 +6014,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`); } @@ -6029,7 +6026,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 4 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Remove" button icon not found'); } @@ -6041,7 +6038,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785094 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -6053,7 +6050,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 4 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -6065,7 +6062,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -6077,7 +6074,7 @@ const steps = [ { description: 'Verify Tagged Concept 4 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Primary" toggle button icon not found'); } @@ -6096,7 +6093,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | History / Technology / Social Perspectives | Nature of Science'; + const expectedText = 'Science | Earth Science | Climate'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -6124,9 +6121,9 @@ const steps = [ { description: 'Validate Tagged concept 5 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k806')).getCssValue('color'); + const elementStyle = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[5]')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { - throw new Error(`Expected: Tagged Concept 51 header text color did not match; Actual: "${elementStyle}"`); + throw new Error(`Expected: Tagged Concept 5 header text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Tagged Concept 5 header text color matched as expected'); } @@ -6184,7 +6181,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 primary toggle button text', action: async () => { - const elementText = await driver.findElement(By.css('#k806 > div > label > span')).getText(); + const elementText = await driver.findElement(By.xpath('//li[5]/div/label/span')).getText(); if (elementText !== 'Primary') { throw new Error(`Expected: Tagged Concept 5 "Primary" toggle button text did not match; Actual: "${elementText}"`); } @@ -6196,7 +6193,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 active primary toggle button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k806 > div > label > span')).getCssValue('color'); + const elementStyle = await driver.findElement(By.xpath('//li[5]/div/label/span')).getCssValue('color'); if (elementStyle !== 'rgba(255, 255, 255, 1)') { throw new Error(`Expected: Tagged Concept 5 active "Primary" toggle button color did not match; Actual: "${elementStyle}"`); } @@ -6204,8 +6201,8 @@ const steps = [ } }, - //NEXT ACTION - Click concept 2 Add button (second time){ECS-2852 Update the "Add" icon after selecting item} - { description: 'Click Concept 2 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .btn')).click() }, + //NEXT ACTION - Click concept 5 Add button (second time) {ECS-2852 Update the "Add" icon after selecting item} + { description: 'Click Concept 5 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).click() }, { description: 'Wait for page to redirect back', action: async () => await driver.sleep(2000) }, //Added suggested concept confirmation alert title @@ -6234,7 +6231,7 @@ const steps = [ //Added suggested concept confirmation X icon { - description: 'Verify Added suggested concept confirmation Xicon is present', + description: 'Verify Added suggested concept confirmation X icon is present', action: async () => { const expectedIcon = await driver.wait(until.elementLocated(By.css('.ml-2 > span')), 5000).catch(() => false); if (!expectedIcon) { @@ -6242,7 +6239,7 @@ const steps = [ } console.log('Passed: Added suggested concept confirmation X icon present'); } -}, + }, //Added suggested concept confirmation alert description { @@ -6250,9 +6247,9 @@ const steps = [ action: async () => { const elementText = await driver.findElement(By.css('.toast-body')).getText(); if (elementText !== 'Concept added already') { - throw new Error(`Expected: "Concept added already" Confirmation DIV description text did not match; Actual: "${elementText}"`); + throw new Error(`Expected: "Concept added already" Confirmation DIV description duplicate text did not match; Actual: "${elementText}"`); } - console.log('Passed: Confirmation DIV description text displayed as expected'); + console.log('Passed: Confirmation DIV description duplicate text displayed as expected'); } }, @@ -6268,6 +6265,15 @@ const steps = [ } }, + //Scroll to page title - Edit Item + { + description: 'Scrolled to page title', + action: async () => { + const location = await driver.findElement(By.css('#myModalLabel')); + await driver.executeScript("arguments[0].scrollIntoView({block: 'center'});", location); + } + }, + //NEXT ACTION - Click Save Changes button { description: 'Click Save Changes button', action: async () => await driver.findElement(By.css('.submit-content-button')).click() }, { description: 'Wait for page to redirect', action: async () => await driver.sleep(2000) }, @@ -6340,8 +6346,42 @@ const steps = [ } }, - //Driver sleep - { description: 'Wait for action to complete', action: async () => await driver.sleep(5000) }, + //Wait for alert confirmation to clear + { + description: 'Verify alert confirmation to clear', + action: async () => { + const elementText = await driver.findElement(By.css('.toast-body')).catch(() => false); + if (elementText) { + await driver.wait(until.stalenessOf(elementText), 5000).catch(() => { + throw new Error('1Alert banner did not disappear'); + }); + } + console.log('Passed: 1Alert banner disappeared as expected'); + } + }, + + //Wait until alert confirmation is hidden via CSS + { + description: 'Verify alert confirmation is hidden', + action: async () => { + const elementText = await driver.findElement(By.css('.toast-body')).catch(() => false); + if (!elementText) { + console.log('Passed: 2Alert DIV did disappear'); + return; + } + await driver.wait(async () => { + const display = await elementText.getCssValue('display'); + return display === 'none'; + }, 5000).catch(() => { + throw new Error('2Alert DIV did not hide in time'); + }); + console.log('Passed: 2Alert DIV hidden'); + } + }, + + + + //Wait for confirmation bannter to load { @@ -8206,7 +8246,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Habits of the Mind | Curiosity'; + const expectedText = 'Science | Concepts and Processes | Theories | General'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -8234,7 +8274,7 @@ const steps = [ { description: 'Validate Tagged concept 1 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k786')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k722')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 1 header text color did not match; Actual: "${elementStyle}"`); } @@ -8246,7 +8286,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k786 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k722 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 1 "Remove" button icon not found'); } @@ -8258,7 +8298,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k786 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k722 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 1 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -8270,7 +8310,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k786 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k722 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 1 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -8282,7 +8322,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k786 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k722 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 1 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -8294,7 +8334,7 @@ const steps = [ { description: 'Verify Tagged Concept 1 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k786 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k722 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 1 "Primary" toggle button icon not found'); } @@ -8313,7 +8353,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | History / Technology / Social Perspectives | Nature of Science | General'; + const expectedText = 'Science | Earth Science | Climate'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -8341,7 +8381,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k806')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); } @@ -8353,7 +8393,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k806 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Remove" button icon not found'); } @@ -8365,7 +8405,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k806 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k749 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -8377,7 +8417,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k806 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 2 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -8389,7 +8429,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k806 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -8401,7 +8441,7 @@ const steps = [ { description: 'Verify Tagged Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k806 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); } @@ -8420,7 +8460,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Physical Science | Physics | General'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Theories`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -8448,7 +8488,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k757')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); } @@ -8460,7 +8500,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 3 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k757 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Remove" button icon not found'); } @@ -8472,7 +8512,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k933 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k757 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -8484,7 +8524,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k757 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 3 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -8496,7 +8536,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k757 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -8508,7 +8548,7 @@ const steps = [ { description: 'Verify Tagged Concept 3 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k757 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); } @@ -8527,7 +8567,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Habits of the Mind | General'; + const expectedText = `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -8555,7 +8595,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k195335436')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`); } @@ -8567,7 +8607,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 4 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k195335436 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Remove" button icon not found'); } @@ -8579,7 +8619,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k26613360 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k195335436 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -8591,7 +8631,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k195335436 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 4 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -8603,7 +8643,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k195335436 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -8615,7 +8655,7 @@ const steps = [ { description: 'Verify Tagged Concept 4 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k195335436 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Primary" toggle button icon not found'); } @@ -8634,7 +8674,7 @@ const steps = [ const fullText = await element.getText(); //Check for the expected text in different ways - const expectedText = 'Science | Earth Science | Topography | General'; + const expectedText = 'Science | General'; const trimmedFullText = fullText.trim(); const firstLine = trimmedFullText.split('\n')[0].trim(); @@ -8662,7 +8702,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 5 header text color did not match; Actual: "${elementStyle}"`); } @@ -8674,7 +8714,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 5 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 5 "Remove" button icon not found'); } @@ -8686,7 +8726,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785094 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 5 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -8698,7 +8738,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept 5 "Remove" button color did not match; Actual: "${elementStyle}"`); } @@ -8710,7 +8750,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 5 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -8722,7 +8762,7 @@ const steps = [ { description: 'Verify Tagged Concept 5 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 5 "Primary" toggle button icon not found'); } @@ -8738,7 +8778,7 @@ const steps = [ await driver.sleep(2000); const removeButton = await driver.wait( - until.elementLocated(By.css('#k806 > .btn')), + until.elementLocated(By.css('#k749 > .btn')), 5000 ); await removeButton.click(); @@ -8840,8 +8880,42 @@ const steps = [ } }, - //Driver sleep - { description: 'Wait for action to complete', action: async () => await driver.sleep(5000) }, + //Wait for alert confirmation to clear + { + description: 'Verify alert confirmation to clear', + action: async () => { + const elementText = await driver.findElement(By.css('.toast-body')).catch(() => false); + if (elementText) { + await driver.wait(until.stalenessOf(elementText), 5000).catch(() => { + throw new Error('Alert banner did not disappear'); + }); + } + console.log('Passed: Alert banner disappeared as expected'); + } + }, + + + //Wait until alert confirmation is hidden via CSS + { + description: 'Verify alert confirmation is hidden', + action: async () => { + const elementText = await driver.findElement(By.css('.toast-body')).catch(() => false); + if (!elementText) { + console.log('Passed: Alert DIV did not disappear'); + return; + } + await driver.wait(async () => { + const display = await elementText.getCssValue('display'); + return display === 'none'; + }, 5000).catch(() => { + throw new Error('cAlert DIV did not hide in time'); + }); + console.log('Passed: cAlert DIV hidden'); + } + }, + + + //Wait for confirmation bannter to load { @@ -9716,10 +9790,10 @@ try { const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); if (loginButton && allStepsPassed) { - console.log('PASSED: Align - Edit Content and Align Concept(ExACT_editItemAddConcepts); All test steps completed successfully'); + console.log('PASSED: ECS-2852, ECS-2889 & ECS-2920 | Align - Edit Content and Align Concept(ExACT_editItemAddConcepts); All test steps completed successfully'); testStatus = 'Passed'; } else { - console.log('FAILED: Align - Edit Content and Align Concept(ExACT_editItemAddConcepts); One or more test steps failed'); + console.log('FAILED: ECS-2852, ECS-2889 & ECS-2920 | Align - Edit Content and Align Concept(ExACT_editItemAddConcepts); One or more test steps failed'); testStatus = 'Failed'; }