From d3f0d6a2c9ed9075e81f032ce0f926f5e606370d Mon Sep 17 00:00:00 2001 From: jhuerta Date: Tue, 20 May 2025 13:42:30 -0700 Subject: [PATCH] Added split row validation fix --- editItemResults.xlsx | Bin 76641 -> 83218 bytes tests/ExACT_editItem.js | 254 ++++++++++++++++++++++++++++++++++------ 2 files changed, 221 insertions(+), 33 deletions(-) diff --git a/editItemResults.xlsx b/editItemResults.xlsx index 62f9ccef4ce38ab6cf3f37347391af8541776e6f..2fc41c5c44e82ee737468e4ab00ae6836d692803 100644 GIT binary patch delta 11083 zcmai4d3+T`*0mFsge40v2}^{8gg_EV(_Os-c>x3-I^e)K$fz?u14N7>VF`@$=`c7m z&Y}V%2W$l)gk5GvV4ldTtRky|h=?cxf ztNOU!)aUCjo05|-{OP9(W8#H7oc~(fVQcNSdnbf`>Z zh8D>an|S$ZOjHdua(Cy3K0St{M}|p_g=V$qNIoW(ZwX+U{6oOgrHGP+9!mpwi&cBw z6p>-z`~W^wE_?WCim1vu4y)IB9}Shq15@>DUKdT2m=;MiT5!ZQkx5FVs~IPF*=Yn5 zx!-E+o<>MZ?CKo!f zG|7!m#B;<9kufuJctnHR2gdcG!K$C+_p2f5DvLBNi}!J%&7U{Qb6(uBEM1B89o>j? zF-4h0O2+UmCgmPE^4GDAILdVRbvZJ(+^U!3V~L6y8T2$i9Y-pQq!7ISC%+zx z67$)KT#qb?vLZzq{n@XF={j=%Qh^KI<64Bq6b~!Ov@(Z2Rx>T@UJ`bl!&dl~bNH6CJTV=>#Gn5bY+D;!mi)nE{yvEZH)V!-f1l&b`xdy&gFpTcue1_xi!^)l zKMK9*GLOD|N;-P}lS7wD5)2&s=NvpT{Wdz|(U&~Wq01su7-C=G(3wB_pI`7nS9A&4 zFV-%QWZD|W3TAgJ3WBnncA)Fm5Yrt@5Y50Y3TTxH`mFeiI$FWul)+g zX0^q)uNC6P%ueVx%g0bBDlg9pVcly6>dn3j`m8iOHe0V%LR0Ka(QvEv&9l4Fn3>40 z2tu0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G@Wb4isLw^?};IqHY30)<2aQ~s>g}! zpSMvakt*xu&d){u5XGC9#qWt`Tcf+iOdv zP_?DcYtxpxWYS*=@mwquu~nIz!k&%ioX4Yzbo2`QHl8*ztRdH)DG4<9{(3Ee-PVXJ zWFIAXF(g@KyA!xDD{aKJWt|d?BNtQ z#s2=GvhgWIS=gLwfXCZqvCPyPr!yy))7fjOUMyLV*!QV)Is=>0^}efa)fx?$zd4uA zO6q!16k6z5-KvEQpD55&+dDWYlykR4^Udbwjo2G@172FdHDK!loZh_pct)Qo>9P0m zHia*Q+Z6V`L2XY|Ci2`<^uc=3=R8-MR_AYDv{}!#+#_-E>1 { - 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 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'); } }, @@ -190,7 +213,7 @@ const steps = [ description: 'Validate Content 1 ECS Alignement label', action: async () => { const elementText = await driver.findElement(By.css('#alignstatuslink874454004 > .display-alignment')).getText(); - if (elementText !== 'Aligned (reset)') { + if (elementText !== 'Alignment Pending (reset)') { throw new Error(`Expected: Content 1 "ECS Alignement" label did not match; Actual: "${elementText}"`); } console.log('Passed: Content 1 ECS Alignement label matched as expected'); @@ -489,7 +512,7 @@ const steps = [ //Edit item Save button -green { - description: 'Validate required label', + description: 'Validate Save button color', action: async () => { const elementStyle = await driver.findElement(By.css('.submit-content-button')).getCssValue('color'); if (elementStyle !== 'rgba(255, 255, 255, 1)') { @@ -1079,6 +1102,18 @@ const steps = [ } }, + //Edit item Save button icon + { + description: 'Verify Save button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.glyphicon-save')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Save button icon not found'); + } + console.log('Passed: Save button icon present'); + } + }, + //Edit item Save button { description: 'Validate Save button text', @@ -1091,9 +1126,9 @@ const steps = [ } }, - //Edit item Save button -green + //Edit item Save button color -green { - description: 'Validate required label', + description: 'Validate Save button color', action: async () => { const elementStyle = await driver.findElement(By.css('.submit-content-button')).getCssValue('color'); if (elementStyle !== 'rgba(255, 255, 255, 1)') { @@ -1215,7 +1250,7 @@ const steps = [ { description: 'Validate Alignment title', action: async () => { - const elementText = await driver.findElement(By.css('#me51861f7f132f814cec419806f86545e > td:nth-child(1)')).getText(); + const elementText = await driver.findElement(By.css('#m7bc870b69c573f14118976177fc3fee7 > td:nth-child(1)')).getText(); if (elementText !== 'Alignment Status') { throw new Error(`Expected: "Alignment Status" title did not match; Actual: "${elementText}"`); } @@ -1228,10 +1263,10 @@ const steps = [ description: 'Validate textbox value', action: async () => { const elementValue = await driver.findElement(By.css('td > .form-control')).getAttribute('value'); - if (elementValue !== 'Aligned') { - throw new Error(`Expected: Alignment Status value "Aligned"; Actual: "${elementValue}"`); + if (elementValue !== 'Pending') { + throw new Error(`Expected: Alignment Status value "Pending"; Actual: "${elementValue}"`); } - console.log('Passed: Alignment Status value Aligned text matched as expected'); + console.log('Passed: Alignment Status value Pending text matched as expected'); } }, @@ -1248,7 +1283,7 @@ const steps = [ },*/ //NEXT ACTION - CONCEPTS/CORRELTATE - { description: 'Click Metadata tab link', action: async () => await driver.findElement(By.linkText('Concepts/Correlate')).click() }, + { description: 'Click Concepts Correlate tab link', action: async () => await driver.findElement(By.linkText('Concepts/Correlate')).click() }, { description: 'Wait for action to complete', action: async () => await driver.sleep(5000) }, //Page title @@ -1359,6 +1394,18 @@ const steps = [ } }, + //Edit item Save button icon + { + description: 'Verify Save button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.glyphicon-save')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Save button icon not found'); + } + console.log('Passed: Save button icon present'); + } + }, + //Edit item Save button { description: 'Validate Save button text', @@ -1371,9 +1418,9 @@ const steps = [ } }, - //Edit item Save button -green + //Edit item Save button color -green { - description: 'Validate required label', + description: 'Validate Save button color', action: async () => { const elementStyle = await driver.findElement(By.css('.submit-content-button')).getCssValue('color'); if (elementStyle !== 'rgba(255, 255, 255, 1)') { @@ -1399,11 +1446,34 @@ const steps = [ { description: 'Validate Tagged Concepts breadcrumb 1 text', action: async () => { - const elementText = await driver.findElement(By.css('#k252821892')).getText(); - if (elementText !== 'Mathematics | Number Operations | Exponents/Powers | Fractional - Note: includes negative fractional; relates to radicals Remove') { - throw new Error(`Expected: Tagged Concepts breadcrumb 1 text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#k11532326')); + + //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 | Chemistry | Scientists | General'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].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: Tagged Concepts breadcrumb 1 text matched as expected'); } }, @@ -1411,7 +1481,7 @@ const steps = [ { description: 'Verify remove button 1 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k252821892 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k11532326 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept "Remove" button 1 icon not found'); } @@ -1423,7 +1493,7 @@ const steps = [ { description: 'Validate Tagged Concepts delete button 1 text', action: async () => { - const elementText = await driver.findElement(By.css('#k252821892 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k11532326 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept "Remove" button 1 text did not match; Actual: "${elementText}"`); } @@ -1435,7 +1505,7 @@ const steps = [ { description: 'Validate remove button 1 label color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k252821892 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k11532326 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept "Remove" button 1 color did not match; Actual: "${elementStyle}"`); } @@ -1447,7 +1517,7 @@ const steps = [ { description: 'Validate Tagged Concepts remove button 1 tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k252821892 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k11532326 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept "Remove Concept" button 1 tooltip did not match; Actual: "${elementStyle}"`); } @@ -1459,7 +1529,7 @@ const steps = [ { description: 'Verify primary toggle button 1 is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k252821892 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k11532326 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept "Primary" toggle button 1 icon not found'); } @@ -1471,11 +1541,34 @@ const steps = [ { description: 'Validate Tagged Concepts breadcrumb 2 text', action: async () => { - const elementText = await driver.findElement(By.css('#k425604098')).getText(); - if (elementText !== 'Mathematics | General Remove checkbox Toggle') { - throw new Error(`Expected: Tagged Concepts breadcrumb 2 text did not match; Actual: "${elementText}"`); + try { + const element = await driver.findElement(By.css('#k425604097')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Language Arts | General'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].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: Tagged Concepts breadcrumb 2 text matched as expected'); } }, @@ -1483,7 +1576,7 @@ const steps = [ { description: 'Verify remove button 2 icon is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604098 .glyphicon')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604097 .glyphicon')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept "Remove" button 2 icon not found'); } @@ -1495,7 +1588,7 @@ const steps = [ { description: 'Validate Tagged Concepts delete button 2 text', action: async () => { - const elementText = await driver.findElement(By.css('#k425604098 > .btn')).getText(); + const elementText = await driver.findElement(By.css('#k425604097 > .btn')).getText(); if (elementText !== 'Remove') { throw new Error(`Expected: Tagged Concept "Remove" button 2 text did not match; Actual: "${elementText}"`); } @@ -1507,7 +1600,7 @@ const steps = [ { description: 'Validate remove button 2 color', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604098 > .btn')).getCssValue('background-color'); + const elementStyle = await driver.findElement(By.css('#k425604097 > .btn')).getCssValue('background-color'); if (elementStyle !== 'rgba(246, 60, 40, 1)') { throw new Error(`Expected: Tagged Concept "Remove" button 2 text color did not match; Actual: "${elementStyle}"`); } @@ -1519,7 +1612,7 @@ const steps = [ { description: 'Validate Tagged Concepts remove button 2 tooltip', action: async () => { - const elementStyle = await driver.findElement(By.css('#k425604098 > .btn')).getAttribute('title'); + const elementStyle = await driver.findElement(By.css('#k425604097 > .btn')).getAttribute('title'); if (elementStyle !== 'Remove Concept') { throw new Error(`Expected: Tagged Concept "Remove Concept" button 2 tooltip did not match; Actual: "${elementStyle}"`); } @@ -1531,7 +1624,7 @@ const steps = [ { description: 'Verify primary toggle button 2 is present', action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604098 .switch-primary')), 5000).catch(() => false); + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604097 .switch-primary')), 5000).catch(() => false); if (!expectedIcon) { throw new Error('Tagged Concept "Primary" toggle button 2 icon not found'); } @@ -1539,6 +1632,101 @@ const steps = [ } }, + //Tagged Concepts breadcrumb 3 text + { + description: 'Validate Tagged Concepts breadcrumb 3 text', + action: async () => { + try { + const element = await driver.findElement(By.css('#k425604100')); + + //Get different versions of the text for debugging + const fullText = await element.getText(); + + //Check for the expected text in different ways + const expectedText = 'Social Studies | General'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].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 + } + } + }, + + //Tagged Concepts remove button 3 icon + { + description: 'Verify remove button 3 icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604100 .glyphicon')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Tagged Concept "Remove" button 3 icon not found'); + } + console.log('Passed: Remove button 3 icon present'); + } + }, + + //Tagged Concepts remove button 3 text + { + description: 'Validate Tagged Concepts delete button 3 text', + action: async () => { + const elementText = await driver.findElement(By.css('#k425604100 > .btn')).getText(); + if (elementText !== 'Remove') { + throw new Error(`Expected: Tagged Concept "Remove" button 3 text did not match; Actual: "${elementText}"`); + } + console.log('Passed: Tagged Concept Remove button 3 text matched as expected'); + } + }, + + //Tagged Concepts remove button 3 color -red + { + description: 'Validate remove button 3 color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#k425604100 > .btn')).getCssValue('background-color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`Expected: Tagged Concept "Remove" button 3 text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Tagged Concept Remove button 3 text color matched as expected'); + } + }, + + //Tagged Concepts remove button 3 -tooltip + { + description: 'Validate Tagged Concepts remove button 3 tooltip', + action: async () => { + const elementStyle = await driver.findElement(By.css('#k425604100 > .btn')).getAttribute('title'); + if (elementStyle !== 'Remove Concept') { + throw new Error(`Expected: Tagged Concept "Remove Concept" button 3 tooltip did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Tagged Concept Remove Concept button 3 tooltip matched as expected'); + } + }, + + //Tagged Concepts primary toggle button 3 + { + description: 'Verify primary toggle button 3 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#k425604100 .switch-primary')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Tagged Concept "Primary" toggle button 3 icon not found'); + } + console.log('Passed: Tagged Concept Primary toggle button 3 icon present'); + } + }, + //Find Concepts title text { description: 'Validate Find Concepts title text',