diff --git a/alignStandardsPageResults.xlsx b/alignStandardsPageResults.xlsx index 0a9d5b8..b5ca039 100644 Binary files a/alignStandardsPageResults.xlsx and b/alignStandardsPageResults.xlsx differ diff --git a/tests/ExACT_alignStandardsPage.js b/tests/ExACT_alignStandardsPage.js index aa2fcb4..ca275d0 100644 --- a/tests/ExACT_alignStandardsPage.js +++ b/tests/ExACT_alignStandardsPage.js @@ -706,7 +706,7 @@ const steps = [ try { if (alertText !== 'You must select a subject') { - throw new Error(`Expected: "You must select a subject (ecs-2829)"; Actual: "${alertText}"`); + throw new Error(`Expected: "You must select a subject (ECS-2829)"; Actual: "${alertText}"`); } console.log('Passed: "You must select a subject" Alert DIV text matched as expected'); console.log('Passed: "OK" button text matched as expected'); @@ -1568,11 +1568,34 @@ const steps = [ { description: 'Validate child standard 1 text', action: async () => { - const elementText = await driver.findElement(By.id('stdbox')).getText(); - if (elementText !== 'Make sense of problems and persevere in solving them.') { - throw new Error(`Expected: "Make sense of problems and persevere in solving them." text; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.xpath(`//div[@id='stdbox']`)); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Make sense of problems and persevere in solving them.'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: "${expectedText}" text within full text`); + } else { + throw new Error( + `Text validation failed.\nExpected: "${expectedText}"\n` + + `Full text: "${fullText}"\n` + + `First line: "${firstLine}"\n` + ); + } + + } catch (error) { + console.error('Detailed error during validation:', error); + throw error; //Re-throw after logging } - console.log('Passed: Make sense of problems and persevere in solving them. text matched as expected'); } }, @@ -1899,7 +1922,7 @@ const steps = [ { description: 'Click alignment 1 Deatils button', action: async () => await driver.findElement(By.css('#\\38 73598469')).click() }, { description: 'Browser sleep', action: async () => await driver.sleep(2000) }, - //3-variable linear system word problems description + //3-variable linear system word problems description 1 { description: 'Validate 3-variable linear system word problems description', action: async () => { @@ -1911,7 +1934,7 @@ const steps = [ } }, - //Alignment Pending warning icon + //Alignment Pending warning icon 1 { description: 'Verify Alignment Pending warning icon is present', action: async () => @@ -1923,7 +1946,7 @@ const steps = [ } }, - //Alignment Pending label + //Alignment Pending label 1 { description: 'Validate Alignment Pending label', action: async () => { @@ -1935,7 +1958,7 @@ const steps = [ } }, - //Alignment Pending checkbox icon + //Alignment Pending checkbox icon 1 { description: 'Verify Alignment Pending checkbox icon is present', action: async () => @@ -1947,7 +1970,7 @@ const steps = [ } }, - //A Lunch-In Affair link text + //A Lunch-In Affair link text 2 { description: 'Validate A Lunch-In Affair link text', action: async () => { @@ -1959,7 +1982,7 @@ const steps = [ } }, - //A Lunch-In Affair link text color -gray + //A Lunch-In Affair link text 2 color -gray { description: 'Validate A Lunch-In Affair link text color', action: async () => { @@ -1971,7 +1994,7 @@ const steps = [ } }, - //Alignment 2 Details button text + //Alignment 2 Details button text 2 { description: 'Validate Alignment 2 Details button text', action: async () => { @@ -1983,7 +2006,7 @@ const steps = [ } }, - //Alignment 2 Details button color -gray + //Alignment 2 Details button 2 color -gray { description: 'Validate Alignment 2 Details button color', action: async () => { @@ -1995,7 +2018,7 @@ const steps = [ } }, - //Not Aligned warning icon + //Not Aligned warning icon 2 { description: 'Verify Not Aligned warning icon is present', action: async () => @@ -2007,19 +2030,19 @@ const steps = [ } }, - //Not Aligned label + //ECS Aligned label 2 { description: 'Validate Not Aligned label', action: async () => { const elementText = await driver.findElement(By.css('#lsn-id-873598488 span')).getText(); - if (elementText !== 'Not Aligned') { - throw new Error(`Expected: "Not Aligned" label; Actual: "${elementText}"`); + if (elementText !== 'ECS Aligned') { + throw new Error(`Expected: "ECS Aligned" label; Actual: "${elementText}"`); } - console.log('Passed: Not Aligned label matched as expected'); + console.log('Passed: ECS Aligned label matched as expected'); } }, - //Not Aligned checkbox icon + //ECS Aligned checkbox icon 2 { description: 'Verify Not Aligned checkbox icon is present', action: async () => @@ -3056,11 +3079,34 @@ const steps = [ { description: 'Validate Concept List label', action: async () => { - const elementText = await driver.findElement(By.css('#tabsr-3')).getText(); - if (elementText !== '* Concept List') { - throw new Error(`Expected: "* Concept List" label; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#tabsr-3')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = '* Concept List'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: "${expectedText}" text within full text`); + } else { + throw new Error( + `Text validation failed.\nExpected: "${expectedText}"\n` + + `Full text: "${fullText}"\n` + + `First line: "${firstLine}"\n` + ); + } + + } catch (error) { + console.error('Detailed error during validation:', error); + throw error; //Re-throw after logging } - console.log('Passed: * Concept List label matched as expected'); } }, @@ -5448,7 +5494,7 @@ try { console.log('PASSED: Align Standards Page(ExACT_alignStandardsPage); All test steps completed successfully'); testStatus = 'Passed'; } else { - console.log('FAILED: Align Standards Page(ExACT_alignStandardsPage); One or more test steps failed'); + console.log('FAILED: (ECS-2829) Align Standards Page(ExACT_alignStandardsPage); One or more test steps failed'); testStatus = 'Failed'; }