diff --git a/editItemAddConceptResults.xlsx b/editItemAddConceptResults.xlsx index 23cb80a..029be91 100644 Binary files a/editItemAddConceptResults.xlsx and b/editItemAddConceptResults.xlsx differ diff --git a/tests/ExACT_editItemAddConcept.js b/tests/ExACT_editItemAddConcept.js index 2614adf..d1ed869 100644 --- a/tests/ExACT_editItemAddConcept.js +++ b/tests/ExACT_editItemAddConcept.js @@ -329,7 +329,7 @@ const steps = [ } }, - //NEXT ACTION - Navigate to Align page + //NEXT ACTION - Click Bioloty QA link { description: 'Click Biology - QA link', action: async () => await driver.findElement(By.linkText('Biology - QA')).click() }, //Wait page to load @@ -405,11 +405,34 @@ const steps = [ { description: 'Validate Biology - QA count', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText(); - if (elementText !== 'Biology - QA (1046)') { - throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(1)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Biology - QA (1046)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].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 } - console.log('Passed: Biology - QA (1046) label matched as expected'); } }, @@ -617,30 +640,6 @@ const steps = [ } }, - //Subject: Mathematics checkbox - { - description: 'Verify Subject: Mathematics checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Subject: Mathematics checkbox icon not found'); - } - console.log('Passed: Subject Mathematics checkbox icon present'); - } - }, - - //Subject: Mathematics label - { - description: 'Validate Subject: Mathematics label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText(); - if (elementText !== 'Mathematics') { - throw new Error(`Expected: Subject: "Mathematics" label; Actual: "${elementText}"`); - } - console.log('Passed: Subject Mathematics label matched as expected'); - } - }, - //Subject: Language Arts checkbox { description: 'Verify Subject: Language Arts checkbox icon is present', @@ -657,7 +656,7 @@ const steps = [ { description: 'Validate Subject: Language Arts label', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText(); + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText(); if (elementText !== 'Language Arts') { throw new Error(`Expected: Subject: "Language Arts" label; Actual: "${elementText}"`); } @@ -665,6 +664,30 @@ const steps = [ } }, + //Subject: Mathematics checkbox + { + description: 'Verify Subject: Mathematics checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Mathematics checkbox icon not found'); + } + console.log('Passed: Subject Mathematics checkbox icon present'); + } + }, + + //Subject: Mathematics label + { + description: 'Validate Subject: Mathematics label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText(); + if (elementText !== 'Mathematics') { + throw new Error(`Expected: Subject: "Mathematics" label; Actual: "${elementText}"`); + } + console.log('Passed: Subject Mathematics label matched as expected'); + } + }, + //Subject: Social Studies checkbox { description: 'Verify Subject: Social Studies checkbox icon is present', @@ -1260,11 +1283,34 @@ const steps = [ { description: 'Validate Content 1 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText(); - if (elementText !== 'Yes, it should work! Perhaps') { - throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(1)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Biology - QA (1046)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Content 1 description "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Content 1 description "${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 } - console.log('Passed: Content 1 description text matched as expected'); } }, @@ -1440,11 +1486,34 @@ const steps = [ { description: 'Validate Content 2 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText(); - if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') { - throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Content 2 description text located in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Content 2 description text located 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 } - console.log('Passed: Content 2 description text matched as expected'); } }, @@ -1653,11 +1722,34 @@ const steps = [ { description: 'Validate Biology - QA count', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText(); - if (elementText !== 'Biology - QA (1046)') { - throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(1)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Biology - QA (4)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].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 } - console.log('Passed: Biology - QA (1046) label matched as expected'); } }, @@ -1701,11 +1793,34 @@ const steps = [ { description: 'Validate Grade: 9 label', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(3) > label:nth-child(4)')).getText(); - if (elementText !== '9') { - throw new Error(`Expected: Grade: "9" label; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(3)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = '9 (4)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].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 } - console.log('Passed: Grade 9 label matched as expected'); } }, @@ -1857,11 +1972,34 @@ const steps = [ { description: 'Validate Subject: Science label', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText(); - if (elementText !== 'Science') { - throw new Error(`Expected: Subject: "Science" label; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(6)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Science (4)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].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 } - console.log('Passed: Subject Science label matched as expected'); } }, @@ -1929,11 +2067,34 @@ const steps = [ { description: 'Validate Pending label', action: async () => { - const elementText = await driver.findElement(By.css('label:nth-child(6)')).getText(); - if (elementText !== 'Pending') { - throw new Error(`Expected: "Pending"; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(8)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Pending (4)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].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 } - console.log('Passed: Pending label matched as expected'); } }, @@ -2196,11 +2357,34 @@ const steps = [ { description: 'Validate Filtered Content 1 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(1) .lo-descr')).getText(); - if (elementText !== `This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.`) { - throw new Error(`Expected: Filtered Content 1 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(1) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Filtered Content 1 description text located in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Filtered Content 1 description text located 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 } - console.log('Passed: Filtered Content 1 description text matched as expected'); } }, @@ -2340,11 +2524,34 @@ const steps = [ { description: 'Validate Filtered Content 2 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(2) .lo-descr')).getText(); - if (elementText !== 'An exploration of physics. Calculating the acceleration of a Porsche. This video with commentary focuses on the study of mechanics.') { - throw new Error(`Expected: Filtered Content 2 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(2) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'An exploration of physics. Calculating the acceleration of a Porsche. This video with commentary focuses on the study of mechanics.'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Filtered Content 2 description text located in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Filtered Content 2 description text located 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 } - console.log('Passed: Filtered Content 2 description text matched as expected'); } }, @@ -2444,8 +2651,8 @@ const steps = [ } }, - //NEXT ACTION - Click Filtered content 2 Edit button - { description: 'Click filtered countent 2 Edit button', action: async () => await driver.findElement(By.css('.card:nth-child(1) .ml-3')).click() }, + //NEXT ACTION - Click Filtered content 1 Edit button (abrupt climate change) + { description: 'Click filtered countent 1 Edit button', action: async () => await driver.findElement(By.css('.card:nth-child(1) .ml-3')).click() }, //Wait for page to load - Edit Item { @@ -3238,11 +3445,34 @@ const steps = [ { description: 'Validate Tagged Concept 1 header text', action: async () => { - const elementText = await driver.findElement(By.css('#k749')).getText(); - if (elementText !== 'Science | Earth Science | Climate') { - throw new Error(`Expected: Tagged Concept 1 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#k786')); + + //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 } - console.log('Passed: Tagged Concept 1 header text matched as expected'); } }, @@ -3250,7 +3480,7 @@ const steps = [ { description: 'Validate Tagged concept 1 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color'); + 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}"`); } @@ -3262,7 +3492,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false); + { 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'); } @@ -3274,7 +3504,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k749 > .btn')).getText(); + 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}"`); } @@ -3286,7 +3516,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color'); + 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}"`); } @@ -3298,7 +3528,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title'); + 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}"`); } @@ -3310,7 +3540,7 @@ const steps = [ { description: 'Verify Tagged Concept 1 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false); + { 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'); } @@ -3322,11 +3552,34 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text', action: async () => { - const elementText = await driver.findElement(By.css('#k937')).getText(); - if (elementText !== `Science | Physical Science | Physics | Force and Motion | Newton's Laws`) { - throw new Error(`Expected: Tagged Concept 2 header text did not match; Actual: "${elementText}"`); + 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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 1 "${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 } - console.log('Passed: Tagged Concept 2 header text matched as expected'); } }, @@ -3334,7 +3587,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k933')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); } @@ -3346,7 +3599,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Remove" button icon not found'); } @@ -3358,7 +3611,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k937 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k933 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -3370,7 +3623,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k933 > .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}"`); } @@ -3382,7 +3635,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -3394,7 +3647,7 @@ const steps = [ { description: 'Verify Tagged Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); } @@ -3406,11 +3659,34 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785095')).getText(); - if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') { - throw new Error(`Expected: Tagged Concept 3 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#k26613360')); + + //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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 2 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 2 "${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 } - console.log('Passed: Tagged Concept 3 header text matched as expected'); } }, @@ -3418,7 +3694,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k26613360')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); } @@ -3430,7 +3706,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 3 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Remove" button icon not found'); } @@ -3442,7 +3718,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785095 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k26613360 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -3454,7 +3730,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k26613360 > .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}"`); } @@ -3466,7 +3742,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -3478,7 +3754,7 @@ const steps = [ { description: 'Verify Tagged Concept 3 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); } @@ -3490,11 +3766,34 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text', action: async () => { - const elementText = await driver.findElement(By.css('#k425604099')).getText(); - if (elementText !== 'Science | General') { - throw new Error(`Expected: Tagged Concept 4 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#k37785094')); + + //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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 3 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 3 "${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 } - console.log('Passed: Tagged Concept 4 header text matched as expected'); } }, @@ -3502,7 +3801,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k37785094')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`); } @@ -3514,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('#k425604099 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Remove" button icon not found'); } @@ -3526,7 +3825,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k37785094 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -3538,7 +3837,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k37785094 > .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}"`); } @@ -3550,7 +3849,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -3562,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('#k425604099 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Primary" toggle button icon not found'); } @@ -4015,7 +4314,7 @@ const steps = [ } }, - //NEXT ACTION - AutoAlign link + //NEXT ACTION - AutoAlign tab { description: 'Click AutoAlign tab link', action: async () => await driver.findElement(By.linkText('AutoAlign')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(5000) }, @@ -4151,17 +4450,40 @@ const steps = [ } }, - /*Base Suggestion On sub-title + //Base Suggestion On sub-title KRYS { description: 'Validate Base Suggestion On sub-title', action: async () => { - const elementText = await driver.findElement(By.xpath('//*[@id="suggest_form"]/*[1]')).getText(); - if (elementText !== 'Base Suggestion On:') { - throw new Error(`Expected: "Base Suggestion On:" sub-title text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggest_form')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Base Suggestion On:'; + 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 } - console.log('Passed: Base Suggestion On: sub-title text matched as expected'); } - },*/ + }, //Title checkbox { @@ -4619,17 +4941,40 @@ const steps = [ } }, - /*# of Concepts label + //# of Concepts label KRYS { description: 'Validate # of Concepts label', action: async () => { - const elementText = await driver.findElement(By.xpath('//*[@id="suggest_form"]/*[2]')).getText(); - if (elementText !== '# of Concepts') { - throw new Error(`Expected: "# of Concepts" label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggest_form')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = '# of Concepts'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[3].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 } - console.log('Passed: # of Concepts label matched as expected'); } - },*/ + }, //Subject Areas label { @@ -4643,17 +4988,40 @@ const steps = [ } }, - /*Subject Areas label + //Subject Areas label KRYS { description: 'Validate Subject Areas label', action: async () => { - const elementText = await driver.findElement(By.xpath('//*[@id="suggest_form"]/*[3]')).getText(); - if (elementText !== 'Subject Areas') { - throw new Error(`Expected: 33"Subject Areas" label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggest_form')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Subject Areas'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[3].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 } - console.log('Passed:44 Subject Areas label matched as expected'); } - },*/ + }, //Subject Area value -Language Arts { @@ -4800,11 +5168,34 @@ const steps = [ { description: 'Validate Suggested Concept 1 label', action: async () => { - const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(1)')).getText(); - if (elementText !== 'History / Technology / Social Perspectives | Advancement of Science') { - throw new Error(`Expected: Suggested Concept 1 label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(1)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Science | History / Technology / Social Perspectives | Advancement of Science'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Suggested Concept 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Suggested Concept 1 "${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 } - console.log('Passed: Suggested Concept 1 label matched as expected'); } }, @@ -4860,11 +5251,34 @@ const steps = [ { description: 'Validate Suggested Concept 2 label', action: async () => { - const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(2)')).getText(); - if (elementText !== 'History / Technology / Social Perspectives | Advancement of Science') { - throw new Error(`Expected: Suggested Concept 2 label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(2)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Science | History / Technology / Social Perspectives | Nature of Science'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Suggested Concept 2 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Suggested Concept 2 "${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 } - console.log('Passed: Suggested Concept 2 label matched as expected'); } }, @@ -4884,7 +5298,7 @@ const steps = [ { description: 'Validate Suggested Concept 3 Add button text', action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn')).getText(); + const elementText = await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn-success')).getText(); if (elementText !== 'Add') { throw new Error(`Expected: Suggested Concept 3 Add button text did not match; Actual: "${elementText}"`); } @@ -4908,7 +5322,7 @@ const steps = [ { description: 'Validate Suggested Concept 3 Add button color', action: async () => { - const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn')).getCssValue('background-color'); + const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(3) > .btn-success')).getCssValue('background-color'); if (elementValue !== 'rgba(40, 167, 69, 1)') { throw new Error(`Expected: Suggested Concept 3 Add button color did not match; Actual: "${elementValue}"`); } @@ -4920,11 +5334,34 @@ const steps = [ { description: 'Validate Suggested Concept 3 label', action: async () => { - const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(3)')).getText(); - if (elementText !== 'Science | History / Technology / Social Perspectives | Nature of Science') { - throw new Error(`Expected: Suggested Concept 3 label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(3)')); + + //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 | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Suggested Concept 3 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Suggested Concept 3 "${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 } - console.log('Passed: Suggested Concept 3 label matched as expected'); } }, @@ -4980,11 +5417,34 @@ const steps = [ { description: 'Validate Suggested Concept 4 label', action: async () => { - const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(4)')).getText(); - if (elementText !== `Science | Earth Science | Earth History | Earth's Evolution | Climate Changes Over Time / Past Climates`) { - throw new Error(`Expected: Suggested Concept 4 label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(4)')); + + //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 | Earth History | Earth's Evolution | Theories`; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Suggested Concept 4 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Suggested 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 } - console.log('Passed: Suggested Concept 4 label matched as expected'); } }, @@ -5004,7 +5464,7 @@ const steps = [ { description: 'Validate Suggested Concept 5 Add button text', action: async () => { - const elementText = await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).getText(); + const elementText = await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn-success')).getText(); if (elementText !== 'Add') { throw new Error(`Expected: Suggested Concept 5 Add button text did not match; Actual: "${elementText}"`); } @@ -5028,7 +5488,7 @@ const steps = [ { description: 'Validate Suggested Concept 5 Add button color', action: async () => { - const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).getCssValue('background-color'); + const elementValue = await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn-success')).getCssValue('background-color'); if (elementValue !== 'rgba(40, 167, 69, 1)') { throw new Error(`Expected: Suggested Concept 5 Add button color did not match; Actual: "${elementValue}"`); } @@ -5040,11 +5500,34 @@ const steps = [ { description: 'Validate Suggested Concept 5 label', action: async () => { - const elementText = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(5)')).getText(); - if (elementText !== 'Science | Life Science (Biology) | Environment | Human Factors | Global Warming') { - throw new Error(`Expected: Suggested Concept 5 label did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#suggested_concepts .list-group-item:nth-child(5)')); + + //Get different versions of the text for debugging + 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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Suggested Concept 5 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Suggested Concept 5 "${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 } - console.log('Passed: Suggested Concept 5 label matched as expected'); } }, @@ -5060,15 +5543,15 @@ const steps = [ } }, - //NEXT ACTION - Click concept 5 Primary toggle - { description: 'Click Concept 5 Primary toggle icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(5) label')).click() }, + //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() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, //Suggested Concept 5 Primary label { description: 'Validate Suggested Concept 5 Primary label', action: async () => { - const elementText = await driver.findElement(By.css('#suggested_concepts > ul > li:nth-child(5) > div > label > span')).getText(); + const elementText = await driver.findElement(By.css('.list-group-item:nth-child(2) .switch-primary')).getText(); if (elementText !== 'Primary') { throw new Error(`Expected: "Primary" toggle indicator; Actual: "${elementText}"`); } @@ -5076,8 +5559,8 @@ const steps = [ } }, - //NEXT ACTION - Click concept 5 Add button - { description: 'Click Concept 5 Add button', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(5) > .btn')).click() }, + //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() }, //Added suggested concept confirmation alert title { @@ -5120,8 +5603,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 | Life Science (Biology) | Environment | Human Factors | Global Warming') { - throw new Error(`Expected: "Science | Life Science (Biology) | Environment | Human Factors | Global Warming" Confirmation DIV description text did not match; Actual: "${elementText}"`); + 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}"`); } console.log('Passed: Confirmation DIV description text displayed as expected'); } @@ -5178,19 +5661,42 @@ const steps = [ { description: 'Validate Tagged Concept 1 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li')).getText(); - if (elementText !== 'Science | Earth Science | Climate') { - throw new Error(`Expected: Tagged Concept 1 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li')); + + //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: Tagged Concept 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 1 "${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 } - console.log('Passed: Tagged Concept 1 header text matched as expected'); } }, - + //Tagged concept 1 header text color -gray { description: 'Validate Tagged concept 1 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color'); + 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}"`); } @@ -5202,7 +5708,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false); + { 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'); } @@ -5214,7 +5720,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k749 > .btn')).getText(); + 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}"`); } @@ -5226,7 +5732,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color'); + 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}"`); } @@ -5238,7 +5744,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title'); + 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}"`); } @@ -5250,7 +5756,7 @@ const steps = [ { description: 'Verify Tagged Concept 1 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false); + { 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'); } @@ -5262,11 +5768,34 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[2]')).getText(); - if (elementText !== `Science | Physical Science | Physics | Force and Motion | Newton's Laws`) { - throw new Error(`Expected: Tagged Concept 2 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[2]')); + + //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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 2 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 2 "${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 } - console.log('Passed: Tagged Concept 2 header text matched as expected'); } }, @@ -5274,7 +5803,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k933')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); } @@ -5286,7 +5815,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Remove" button icon not found'); } @@ -5298,7 +5827,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k937 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k933 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -5310,7 +5839,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k933 > .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}"`); } @@ -5322,7 +5851,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -5334,7 +5863,7 @@ const steps = [ { description: 'Verify Tagged Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); } @@ -5346,11 +5875,34 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[3]')).getText(); - if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') { - throw new Error(`Expected: Tagged Concept 3 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[3]')); + + //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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 3 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 3 "${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 } - console.log('Passed: Tagged Concept 3 header text matched as expected'); } }, @@ -5358,7 +5910,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k26613360')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); } @@ -5370,7 +5922,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 3 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Remove" button icon not found'); } @@ -5382,7 +5934,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785095 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k26613360 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -5394,7 +5946,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k26613360 > .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}"`); } @@ -5406,7 +5958,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -5418,7 +5970,7 @@ const steps = [ { description: 'Verify Tagged Concept 3 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); } @@ -5430,11 +5982,34 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[4]')).getText(); - if (elementText !== 'Science | General') { - throw new Error(`Expected: Tagged Concept 4 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[4]')); + + //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 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 } - console.log('Passed: Tagged Concept 4 header text matched as expected'); } }, @@ -5442,7 +6017,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k37785094')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`); } @@ -5454,7 +6029,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 4 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Remove" button icon not found'); } @@ -5466,7 +6041,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k37785094 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -5478,7 +6053,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k37785094 > .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}"`); } @@ -5490,7 +6065,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -5502,7 +6077,7 @@ const steps = [ { description: 'Verify Tagged Concept 4 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Primary" toggle button icon not found'); } @@ -5514,11 +6089,34 @@ const steps = [ { description: 'Validate Tagged Concept 5 header text', action: async () => { - const elementText = await driver.findElement(By.css('#k11532278')).getText(); - if (elementText !== 'Science | Life Science (Biology) | Environment | Human Factors | Global Warming') { - throw new Error(`Expected: Tagged Concept 5 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[5]')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Science | History / Technology / Social Perspectives | Nature of Science'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged Concept 5 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged Concept 5 "${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 } - console.log('Passed: Tagged Concept 5 header text matched as expected'); } }, @@ -5526,7 +6124,7 @@ const steps = [ { description: 'Validate Tagged concept 5 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k11532278')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k806')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 51 header text color did not match; Actual: "${elementStyle}"`); } @@ -5586,7 +6184,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 primary toggle button text', action: async () => { - const elementText = await driver.findElement(By.css('#k11532278 > div > label > span')).getText(); + const elementText = await driver.findElement(By.css('#k806 > div > label > span')).getText(); if (elementText !== 'Primary') { throw new Error(`Expected: Tagged Concept 5 "Primary" toggle button text did not match; Actual: "${elementText}"`); } @@ -5598,7 +6196,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 active primary toggle button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k11532278 > div > label > span')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k806 > 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}"`); } @@ -5606,8 +6204,9 @@ const steps = [ } }, - //NEXT ACTION - Click concept 2 Add button {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-success')).click() }, + //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() }, + { description: 'Wait for page to redirect back', action: async () => await driver.sleep(2000) }, //Added suggested concept confirmation alert title { @@ -5670,8 +6269,8 @@ const steps = [ }, //NEXT ACTION - Click Save Changes button - { description: 'Wait for page to redirect back', action: async () => await driver.sleep(5000) }, { 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) }, //Wait for confirmation bannter to load { @@ -5839,11 +6438,34 @@ const steps = [ { description: 'Validate Data range text handle', action: async () => { - const elementText = await driver.findElement(By.css('#get_report')).getText(); //.form-group:nth-child(1) > .form-label - if (elementText !== 'Data range:') { - throw new Error(`Expected: "Data range: Start"; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#get_report')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Data range:'; + 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 } - console.log('Passed: Data range: Start text handle matched as expected'); } }, @@ -6322,11 +6944,34 @@ const steps = [ { description: 'Validate Biology - QA count', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(1)')).getText(); - if (elementText !== 'Biology - QA (1046)') { - throw new Error(`Expected: "Biology - QA (1046)"; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.form-group:nth-child(1)')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Biology - QA (1046)'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[1].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 } - console.log('Passed: Biology - QA (1046) label matched as expected'); } }, @@ -6534,30 +7179,6 @@ const steps = [ } }, - //Subject: Mathematics checkbox - { - description: 'Verify Subject: Mathematics checkbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Subject: Mathematics checkbox icon not found'); - } - console.log('Passed: Subject Mathematics checkbox icon present'); - } - }, - - //Subject: Mathematics label - { - description: 'Validate Subject: Mathematics label', - action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText(); - if (elementText !== 'Mathematics') { - throw new Error(`Expected: Subject: "Mathematics" label; Actual: "${elementText}"`); - } - console.log('Passed: Subject Mathematics label matched as expected'); - } - }, - //Subject: Language Arts checkbox { description: 'Verify Subject: Language Arts checkbox icon is present', @@ -6574,7 +7195,7 @@ const steps = [ { description: 'Validate Subject: Language Arts label', action: async () => { - const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText(); + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(7)')).getText(); if (elementText !== 'Language Arts') { throw new Error(`Expected: Subject: "Language Arts" label; Actual: "${elementText}"`); } @@ -6582,6 +7203,30 @@ const steps = [ } }, + //Subject: Mathematics checkbox + { + description: 'Verify Subject: Mathematics checkbox icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#metasubjectsMathematics')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Subject: Mathematics checkbox icon not found'); + } + console.log('Passed: Subject Mathematics checkbox icon present'); + } + }, + + //Subject: Mathematics label + { + description: 'Validate Subject: Mathematics label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label:nth-child(10)')).getText(); + if (elementText !== 'Mathematics') { + throw new Error(`Expected: Subject: "Mathematics" label; Actual: "${elementText}"`); + } + console.log('Passed: Subject Mathematics label matched as expected'); + } + }, + //Subject: Social Studies checkbox { description: 'Verify Subject: Social Studies checkbox icon is present', @@ -7177,11 +7822,34 @@ const steps = [ { description: 'Validate Content 1 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText(); - if (elementText !== 'Yes, it should work! Perhaps') { - throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Yes, it should work! Perhaps'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Content 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Content 1 "${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 } - console.log('Passed: Content 1 description text matched as expected'); } }, @@ -7357,11 +8025,34 @@ const steps = [ { description: 'Validate Content 2 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText(); - if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') { - throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Content 2 description text located in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Content 2 description text located 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 } - console.log('Passed: Content 2 description text matched as expected'); } }, @@ -7508,11 +8199,34 @@ const steps = [ { description: 'Validate Tagged Concept 1 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li')).getText(); - if (elementText !== 'Science | Earth Science | Climate') { - throw new Error(`Expected: Tagged Concept 1 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li')); + + //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: Tagged concept 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged concept 1 "${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 } - console.log('Passed: Tagged Concept 1 header text matched as expected'); } }, @@ -7520,7 +8234,7 @@ const steps = [ { description: 'Validate Tagged concept 1 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749')).getCssValue('color'); + 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}"`); } @@ -7532,7 +8246,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .glyphicon')), 5000).catch(() => false); + { 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'); } @@ -7544,7 +8258,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k749 > .btn')).getText(); + 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}"`); } @@ -7556,7 +8270,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getCssValue('background-color'); + 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}"`); } @@ -7568,7 +8282,7 @@ const steps = [ { description: 'Validate Tagged Concept 1 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k749 > .btn')).getAttribute('title'); + 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}"`); } @@ -7580,7 +8294,7 @@ const steps = [ { description: 'Verify Tagged Concept 1 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k749 .switch-primary')), 5000).catch(() => false); + { 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'); } @@ -7592,11 +8306,34 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[2]')).getText(); - if (elementText !== `Science | Physical Science | Physics | Force and Motion | Newton's Laws`) { - throw new Error(`Expected: Tagged Concept 2 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[2]')); + + //Get different versions of the text for debugging + 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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged concept 2 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged concept 2 "${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 } - console.log('Passed: Tagged Concept 2 header text matched as expected'); } }, @@ -7604,7 +8341,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k806')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 2 header text color did not match; Actual: "${elementStyle}"`); } @@ -7616,7 +8353,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k806 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Remove" button icon not found'); } @@ -7628,7 +8365,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k937 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k806 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 2 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -7640,7 +8377,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k806 > .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}"`); } @@ -7652,7 +8389,7 @@ const steps = [ { description: 'Validate Tagged Concept 2 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k937 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k806 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 2 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -7664,7 +8401,7 @@ const steps = [ { description: 'Verify Tagged Concept 2 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k937 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k806 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 2 "Primary" toggle button icon not found'); } @@ -7676,11 +8413,34 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[3]')).getText(); - if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') { - throw new Error(`Expected: Tagged Concept 3 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[3]')); + + //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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged concept 3 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged concept 3 "${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 } - console.log('Passed: Tagged Concept 3 header text matched as expected'); } }, @@ -7688,7 +8448,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k11532278')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k933')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 3 header text color did not match; Actual: "${elementStyle}"`); } @@ -7700,7 +8460,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 3 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k11532278 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Remove" button icon not found'); } @@ -7712,7 +8472,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k11532278 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k933 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 3 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -7724,7 +8484,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k11532278 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k933 > .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}"`); } @@ -7736,7 +8496,7 @@ const steps = [ { description: 'Validate Tagged Concept 3 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k11532278 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k933 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 3 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -7748,7 +8508,7 @@ const steps = [ { description: 'Verify Tagged Concept 3 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k11532278 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k933 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 3 "Primary" toggle button icon not found'); } @@ -7760,11 +8520,34 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[4]')).getText(); - if (elementText !== 'Science | Earth Science | Topography | Influence on Climate / Weather / etc.') { - throw new Error(`Expected: Tagged Concept 4 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[4]')); + + //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 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 } - console.log('Passed: Tagged Concept 4 header text matched as expected'); } }, @@ -7772,7 +8555,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k26613360')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 4 header text color did not match; Actual: "${elementStyle}"`); } @@ -7784,7 +8567,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 4 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Remove" button icon not found'); } @@ -7796,7 +8579,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k37785095 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k26613360 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 4 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -7808,7 +8591,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k26613360 > .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}"`); } @@ -7820,7 +8603,7 @@ const steps = [ { description: 'Validate Tagged Concept 4 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k37785095 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k26613360 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 4 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -7832,7 +8615,7 @@ const steps = [ { description: 'Verify Tagged Concept 4 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785095 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k26613360 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 4 "Primary" toggle button icon not found'); } @@ -7844,11 +8627,34 @@ const steps = [ { description: 'Validate Tagged Concept 5 header text', action: async () => { - const elementText = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[5]')).getText(); - if (elementText !== 'Science | General') { - throw new Error(`Expected: Tagged Concept 5 header text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath('//div[2]/div/div/ul/li[5]')); + + //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 trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Tagged concept 5 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Tagged concept 5 "${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 } - console.log('Passed: Tagged Concept 5 header text matched as expected'); } }, @@ -7856,7 +8662,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 header text color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099')).getCssValue('color'); + const elementStyle = await driver.findElement(By.css('#k37785094')).getCssValue('color'); if (elementStyle !== 'rgba(99, 99, 99, 1)') { throw new Error(`Expected: Tagged Concept 5 header text color did not match; Actual: "${elementStyle}"`); } @@ -7868,7 +8674,7 @@ const steps = [ { description: 'Verify Tagged Concept remove button 5 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 5 "Remove" button icon not found'); } @@ -7880,7 +8686,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 delete button text', action: async () => { - const elementText = await driver.findElement(By.css('#k425604099 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k37785094 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept 5 "Remove" button text did not match; Actual: "${elementText}"`); } @@ -7892,7 +8698,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 remove button label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k37785094 > .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}"`); } @@ -7904,7 +8710,7 @@ const steps = [ { description: 'Validate Tagged Concept 5 remove button tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604099 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k37785094 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept 5 "Remove Concept" button tooltip did not match; Actual: "${elementStyle}"`); } @@ -7916,7 +8722,7 @@ const steps = [ { description: 'Verify Tagged Concept 5 primary toggle button is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604099 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k37785094 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept 5 "Primary" toggle button icon not found'); } @@ -7932,7 +8738,7 @@ const steps = [ await driver.sleep(2000); const removeButton = await driver.wait( - until.elementLocated(By.css('#k11532278 > .btn')), + until.elementLocated(By.css('#k806 > .btn')), 5000 ); await removeButton.click(); @@ -8075,7 +8881,7 @@ const steps = [ action: async () => { const elementStyle = await driver.findElement(By.css('.breadcrumb-item:nth-child(2)')).getCssValue('color'); if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`"C"ontent" breadcrumb text color did not match; Actual: "${elementStyle}"`); + throw new Error(`"Content" breadcrumb text color did not match; Actual: "${elementStyle}"`); } console.log('Passed: Content breadcrumb text color matched as expected'); } @@ -8118,7 +8924,7 @@ const steps = [ } }, - //Edit View button color -green + //Edit View button color -clear { description: 'Validate Edit View button color', action: async () => { @@ -8460,11 +9266,34 @@ const steps = [ { description: 'Validate Content 1 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')).getText(); - if (elementText !== 'Yes, it should work! Perhaps') { - throw new Error(`Expected: Content 1 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(8) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Yes, it should work! Perhaps'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Content 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Content 1 "${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 } - console.log('Passed: Content 1 description text matched as expected'); } }, @@ -8640,11 +9469,34 @@ const steps = [ { description: 'Validate Content 2 description', action: async () => { - const elementText = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')).getText(); - if (elementText !== 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.') { - throw new Error(`Expected: Content 2 description text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('.card:nth-child(9) .lo-descr')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'This Science NetLinks lesson focuses on a current issue in science in order to help students understand the process by which scientific knowledge is developed and refined. In this lesson, students are introduced to some recent ideas about abrupt climate change. This gives them a glimpse into how scientific theories are formed and refined by new data.'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Content 2 description text located in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Content 2 description text located 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 } - console.log('Passed: Content 2 description text matched as expected'); } },