From 87e99cb78a9f45c9a60ab7e83850f367fc8e299e Mon Sep 17 00:00:00 2001 From: jhuerta Date: Thu, 2 Oct 2025 16:03:01 -0700 Subject: [PATCH] Added and Completed Framework Settings DIV script --- frameworkFrameworkSettingsDIVResults.xlsx | Bin 0 -> 61869 bytes index.js | 5 +- tests/ExACT_frameworkFrameworkSettingsDIV.js | 1826 ++++++++++++++++++ 3 files changed, 1830 insertions(+), 1 deletion(-) create mode 100644 frameworkFrameworkSettingsDIVResults.xlsx create mode 100644 tests/ExACT_frameworkFrameworkSettingsDIV.js diff --git a/frameworkFrameworkSettingsDIVResults.xlsx b/frameworkFrameworkSettingsDIVResults.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..003a5931163ab4b14e2591345059685af6333041 GIT binary patch literal 61869 zcmeI5-)}5Qme)Ny4T46aW;Ba5TCq~9BzRffs>=FZ#`fsizPG!l`}SDZ?mNB1q9R?D zwyT|0S(};mwP!(^?OmZ3Bam1I1P>$eFw(AsfRT1bjL`6JEDuNvVt%Y(S@p}lAo0M7 zh|G*QCr)N%_+Ej4>6Wk4Q4uF1J{c!6z7dfXC+~g!jbGd;{`=nNe*1?%_=TMv@$*X% zco%hMNf@P_mvM4^9>>@1yH(T{A$wneEAKW;(q+8fZ~5(R%L~`@c(Ghx?zcWXd-`b7 z^3p6=FM=puhx@JjFl~M1;0tf=JrAQGgGA}oa+7*sWu5M~uCi>i+v%k9t8f*h?RXQe z;ggFvSp^yVnOt@@!TdV73_HDUchrFrXdA5qWYc?hvENGGUHC2U?0y3|Z?_#^TrB6| zaXi0Sh3kyTLe@XM3d0PH2FYcZ?Y9IH8I*S9FJG`}b@;;cUT0x4fE4P2$Ui&s-`X^_1!TGCK|*C80Z*6hW-cot^CBFF+=id7y`l%soqI`HO4|b(3)xLLwCarLh1TVpRR*`Cet6;fqdFx;WP55iFfqG~1#vknE#-Bvc z4%S&J0_IV2Dx4=oDZn*?-Nm&pex>*6QIvSMK?H4gxn9IC&%!%s&ry(O@WFn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AVguwQMFm;BUR! zt&lbz_;i`8ay$|w(gNaL3Xhd-mDQ1*$Q zBR+-a43q9$D2K{)x9dfFl|BmZV8qpyF5iX(L2}<-1)wONsP~cJ53s`9zpX8ou#Y9q zBh`gM|0YK{ZAgEd1TUfEs>ndemD(EA=dgltQuHg*3}1!w)rKIFFUNL7IG(lE$`sJM+@gv3~`oBK~%V38# zVrt;SKYQal-*^K?mhkfhof@wGrzZ{QMoE*t^~q=7`|b~RcErz@QPSW1Ycgr+XsO}I z)C!%`)P~Ofqcy`x6VtgBo%k>Qr?LpeObbm+X9{%UyZ?;l4QN8D_H@EO{V%rmqp9gw tUZ;NcQzLaTvZu-E2vjHk!=JI^(UbT7+@BYb-h}^u0~*C&{Y?DzzW^5!V_X0L literal 0 HcmV?d00001 diff --git a/index.js b/index.js index 99ad9d4..c029807 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ import ExACT_frameworkManagementPage from './tests/ExACT_frameworkManagementPage import ExACT_frameworkPublishingPage from './tests/ExACT_frameworkPublishingPage.js'; import ExACT_frameworkPublishFrameworkDIV from './tests/ExACT_frameworkPublishFrameworkDIV.js'; import ExACT_frameworkFrameworkGroupsDIV from './tests/ExACT_frameworkFrameworkGroupsDIV.js'; +import ExACT_frameworkFrameworkSettingsDIV from './tests/ExACT_frameworkFrameworkSettingsDIV.js'; const app = express(); @@ -52,6 +53,7 @@ app.get('/', (req, res) => {


+

`); @@ -78,6 +80,7 @@ app.get('/ExACT_contentPage', ExACT_contentPage); app.get('/ExACT_frameworkPublishingPage', ExACT_frameworkPublishingPage); app.get('/ExACT_frameworkPublishFrameworkDIV', ExACT_frameworkPublishFrameworkDIV); app.get('/ExACT_frameworkFrameworkGroupsDIV', ExACT_frameworkFrameworkGroupsDIV); + app.get('/ExACT_frameworkFrameworkSettingsDIV', ExACT_frameworkFrameworkSettingsDIV); app.listen(8000, () => { - console.log('Server is running on port 8000'); + console.log('Server is up and running on port 8000'); }); \ No newline at end of file diff --git a/tests/ExACT_frameworkFrameworkSettingsDIV.js b/tests/ExACT_frameworkFrameworkSettingsDIV.js new file mode 100644 index 0000000..5951df1 --- /dev/null +++ b/tests/ExACT_frameworkFrameworkSettingsDIV.js @@ -0,0 +1,1826 @@ +import { Builder, By, Key, until } from 'selenium-webdriver'; +import fs from 'fs'; +import XLSX from 'xlsx'; +import path from 'path'; + +const ExACT_frameworkFrameworkSettingsDIV = (req, res) => { + res.send('

ExACT Automated Test Script: Publish Framework DIV(ExACT_frameworkFrameworkSettingsDIV); Initiated

'); + (async function example() { + let driver = await new Builder().forBrowser('chrome').build(); + let testStatus = 'Failed'; + let workbook; + let worksheet; + const startTime = new Date().toISOString(); + +const steps = [ + { description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php + { description: 'Expand browser', action: async () => await driver.manage().window().maximize() }, + + //LOGIN + { description: 'Enter username', action: async () => await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan') }, + { description: 'Enter password', action: async () => await driver.findElement(By.css('.passfield')).sendKeys('Edgate1!') }, + { description: 'Click Login button', action: async () => await driver.findElement(By.css('.login')).click() }, + { description: 'Wait for login process to complete', action: async () => await driver.sleep(10000) }, + + //Wait for dashboard to load - Correlation Coverages View Details button + { + description: 'Wait for dashboard load to completely', + action: async () => { + return await driver.wait(until.elementLocated(By.linkText('View Details')), 10000).catch(() => false); + } + }, + + //Dashboard title + { + description: 'Validate dashboard title', + action: async () => { + const elementText = await driver.findElement(By.css('.e-heading')).getText(); + if (elementText === 'Correlation Dashboard') { + console.log(`Passed: "${elementText}" title matched as expected`); + } else { + throw new Error(`Expected: "Correlation Dashboard"; Actual: "${elementText}"`); + } + } + }, + + //Align icon color -gray + { + description: 'Validate Align icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.fb-align')).getCssValue('color'); + if (elementStyle === 'rgba(99, 99, 99, 1)') { + console.log('Passed: Align icon color matched as expected'); + } else { + throw new Error(`Align icon color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //NEXT ACTION - Navigate to Framework Management page + { description: 'Click Frameworks navigation link', action: async () => await driver.findElement(By.linkText('Frameworks')).click() }, + + //Wait for page to load - Correlation Coverages View Details button + { + description: 'Wait for page to load', + action: async () => { + return await driver.wait(until.elementLocated(By.css('h2')), 10000).catch(() => false); + } + }, + + //Framework Management page title + { + description: 'Validate Framework Management page title', + action: async () => { + const elementText = await driver.findElement(By.css('h2')).getText(); + if (elementText === 'Framework Management') { + console.log('Passed: Framework Management page title matched as expected'); + } else { + throw new Error(`Expected: "Framework Management" page title; Actual: "${elementText}"`); + } + + } + }, + + //Framework Management page title text color -dark blue + { + description: 'Validate Framework Management page title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('h2')).getCssValue('color'); + if (elementStyle === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Align icon color matched as expected'); + } else { + throw new Error(`Align icon color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Framework Management page title text font + { + description: 'Validate Framework Management page title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('h2')).getCssValue('font-size'); + if (elementStyle === '32px') { + console.log('Passed: Framework Management page title text font-size matched as expected'); + } else { + throw new Error(`Framework Management page title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Publishing button icon + { + description: 'Verify Publishing buttion icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.btn > .fa-cloud-upload')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publishing button icon not found'); + } + console.log('Passed: Publishing button icon present'); + } + }, + + //Publishing button text + { + description: 'Validate Publishing button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Publishing')).getText(); + if (elementText === 'Publishing') { + console.log('Passed: Publishing button text matched as expected'); + } else { + throw new Error(`Expected: "Publishing" button text; Actual: "${elementText}"`); + } + } + }, + + //Publishing button color -green + { + description: 'Validate Publishing button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Publishing')).getCssValue('background-color'); + if (elementStyle === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Align icon color matched as expected'); + } else { + throw new Error(`Align icon color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //NEXT ACTION - Click Publishing button + { description: 'Click Publishing button', action: async () => await driver.findElement(By.linkText('Publishing')).click() }, + + //Publishing Page + { + description: 'Wait for Publishing page to load', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('h2')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publishing page did not load'); + } + console.log('Passed: Publishing page loaded'); + } + }, + + //Framework Publishing page title + { + description: 'Validate Framework Publishing page title', + action: async () => { + const elementText = await driver.findElement(By.css('h2')).getText(); + if (elementText === 'Framework Publishing') { + console.log('Passed: Framework Publishing page title text matched as expected'); + } else { + throw new Error(`Expected: "Framework Publishing" page title text; Actual: "${elementText}"`); + } + } + }, + + //Framework Publishing page title text color -dark blue + { + description: 'Validate Framework Publishing page title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('h2')).getCssValue('color'); + if (elementStyle === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Framework Publishing page title text color matched as expected'); + } else { + throw new Error(`Framework Publishing page title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Framework Publishing page title text font + { + description: 'Validate Framework Publishing page title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('h2')).getCssValue('font-size'); + if (elementStyle === '32px') { + console.log('Passed: Framework Publishing page title text font-size matched as expected'); + } else { + throw new Error(`Framework Publishing page title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Publish Framework button icon + { + description: 'Verify Publish Framework buttion icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-cloud-upload')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publish Framework button icon not found'); + } + console.log('Passed: Publish Framework button icon present'); + } + }, + + //Publish Framework button text + { + description: 'Validate Publish Framework button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Publish Framework')).getText(); + if (elementText === 'Publish Framework') { + console.log('Passed: Publish Framework button text matched as expected'); + } else { + throw new Error(`Expected: "Publish Framework" button text; Actual: "${elementText}"`); + } + } + }, + + //Publish Framework button color -green + { + description: 'Validate Publish Framework button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Publish Framework')).getCssValue('background-color'); + if (elementStyle === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Publish Framework button color matched as expected'); + } else { + throw new Error(`Publish Framework button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Groups button icon + { + description: 'Verify Groups buttion icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-th-list')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Groups button icon not found'); + } + console.log('Passed: Groups button icon present'); + } + }, + + //Groups button text + { + description: 'Validate Groups button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Groups')).getText(); + if (elementText === 'Groups') { + console.log('Passed: Groups button text matched as expected'); + } else { + throw new Error(`Expected: "Groups" button text; Actual: "${elementText}"`); + } + } + }, + + //Groups button color -navy blue + { + description: 'Validate Groups button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Groups')).getCssValue('background-color'); + if (elementStyle === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Groups button color matched as expected'); + } else { + throw new Error(`Groups button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Settings button icon + { + description: 'Verify Settings buttion icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-cog')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Settings button icon not found'); + } + console.log('Passed: Settings button icon present'); + } + }, + + //Settings button text + { + description: 'Validate Settings button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Settings')).getText(); + if (elementText === 'Settings') { + console.log('Passed: Settings button text matched as expected'); + } else { + throw new Error(`Expected: "Settings" button text; Actual: "${elementText}"`); + } + } + }, + + //Settings button color -green + { + description: 'Validate Settings button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Settings')).getCssValue('background-color'); + if (elementStyle === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Settings button color matched as expected'); + } else { + throw new Error(`Settings button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Publishing History sub title + { + description: 'Validate Publishing History sub title', + action: async () => { + const elementText = await driver.findElement(By.css('h4')).getText(); + if (elementText === 'Publishing History http://qaclient.esp.edgate.com') { + console.log('Passed: Publishing History sub title text matched as expected'); + } else { + throw new Error(`Expected: "Publishing History" sub title text; Actual: "${elementText}"`); + } + } + }, + + //Publishing History sub title text color -navy blue + { + description: 'Validate Publishing History sub title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('h4')).getCssValue('color'); + if (elementStyle === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Publishing History sub title text color matched as expected'); + } else { + throw new Error(`Publishing History sub title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Publishing History Sub title text font + { + description: 'Validate Publishing History sub title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('h4')).getCssValue('font-size'); + if (elementStyle === '24px') { + console.log('Passed: Publishing History sub title text font-size matched as expected'); + } else { + throw new Error(`Publishing History sub title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Publishing History button text + { + description: 'Validate Publish History button text', + action: async () => { + const elementText = await driver.findElement(By.css('body > div.container.body > div > div.right_col > div > h4 > a')).getText(); + if (elementText === 'http://qaclient.esp.edgate.com') { + console.log('Passed: http://qaclient.esp.edgate.com button text matched as expected'); + } else { + throw new Error(`Expected: "http://qaclient.esp.edgate.com" button text; Actual: "${elementText}"`); + } + } + }, + + //Publishing History button color -green + { + description: 'Validate Publishing History button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.btn-sm')).getCssValue('background-color'); + if (elementStyle === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Publishing History button color matched as expected'); + } else { + throw new Error(`Publishing History button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Publishing History button icon + { + description: 'Verify Publishing History buttion icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.btn-sm > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publishing History button icon not found'); + } + console.log('Passed: Publishing History button icon present'); + } + }, + + //Framework column title + { + description: 'Validate Framework column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(1)')).getText(); + if (elementText === 'Framework') { + console.log('Passed: Framework column title text matched as expected'); + } else { + throw new Error(`Expected: "Framework" column title text; Actual: "${elementText}"`); + } + } + }, + + //Framework column title text color -dark blue + { + description: 'Validate Framework column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(1)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Framework column title text color matched as expected'); + } else { + throw new Error(`Framework column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Framework column title text font + { + description: 'Validate Framework column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(1)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Framework column title text font-size matched as expected'); + } else { + throw new Error(`Framework column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Version column title + { + description: 'Validate Version column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(2)')).getText(); + if (elementText === 'Version') { + console.log('Passed: Version column title text matched as expected'); + } else { + throw new Error(`Expected: "Version" column title text; Actual: "${elementText}"`); + } + } + }, + + //Version column title text color -dark blue + { + description: 'Validate Version column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(2)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Version column title text color matched as expected'); + } else { + throw new Error(`Version column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Version column title text font + { + description: 'Validate Version column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(2)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Version column title text font-size matched as expected'); + } else { + throw new Error(`Version column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Revision column title + { + description: 'Validate Revision column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(3)')).getText(); + if (elementText === 'Revision') { + console.log('Passed: Revision column title text matched as expected'); + } else { + throw new Error(`Expected: "Revision" column title text; Actual: "${elementText}"`); + } + } + }, + + //Revision column title text color -dark blue + { + description: 'Validate Revision column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(3)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Revision column title text color matched as expected'); + } else { + throw new Error(`Revision column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Revision column title text font + { + description: 'Validate Revision column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(3)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Revision column title text font-size matched as expected'); + } else { + throw new Error(`Revision column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Status column title + { + description: 'Validate Status column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(4)')).getText(); + if (elementText === 'Status') { + console.log('Passed: Status column title text matched as expected'); + } else { + throw new Error(`Expected: "Status" column title text; Actual: "${elementText}"`); + } + } + }, + + //Status column title text color -dark blue + { + description: 'Validate Status column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(4)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Status column title text color matched as expected'); + } else { + throw new Error(`Status column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Status column title text font + { + description: 'Validate Status column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(4)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Status column title text font-size matched as expected'); + } else { + throw new Error(`Status column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Visibility column title + { + description: 'Validate Visibility column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(5)')).getText(); + if (elementText === 'Visibility') { + console.log('Passed: Visibility column title text matched as expected'); + } else { + throw new Error(`Expected: "Visibility" column title text; Actual: "${elementText}"`); + } + } + }, + + //Visibility column title text color -dark blue + { + description: 'Validate Visibility column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(5)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Visibility column title text color matched as expected'); + } else { + throw new Error(`Visibility column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Visibility column title text font + { + description: 'Validate Visibility column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(5)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Visibility column title text font-size matched as expected'); + } else { + throw new Error(`Visibility column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Group column title + { + description: 'Validate Group column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(6)')).getText(); + if (elementText === 'Group') { + console.log('Passed: Group column title text matched as expected'); + } else { + throw new Error(`Expected: "Group" column title text; Actual: "${elementText}"`); + } + } + }, + + //Group column title text color -dark blue + { + description: 'Validate Group column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(6)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Group column title text color matched as expected'); + } else { + throw new Error(`Group column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Group column title text font + { + description: 'Validate Group column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(6)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Group column title text font-size matched as expected'); + } else { + throw new Error(`Group column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Published At column title + { + description: 'Validate Published At column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(7)')).getText(); + if (elementText === 'Published At') { + console.log('Passed: Published At column title text matched as expected'); + } else { + throw new Error(`Expected: "Published At" column title text; Actual: "${elementText}"`); + } + } + }, + + //Published At column title text color -dark blue + { + description: 'Validate Published At column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(7)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Published At column title text color matched as expected'); + } else { + throw new Error(`Published At column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Published At column title text font + { + description: 'Validate Published At column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(7)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Published At column title text font-size matched as expected'); + } else { + throw new Error(`Published At column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //By column title + { + description: 'Validate By column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(8)')).getText(); + if (elementText === 'By') { + console.log('Passed: By column title text matched as expected'); + } else { + throw new Error(`Expected: "By" column title text; Actual: "${elementText}"`); + } + } + }, + + //By column title text color -dark blue + { + description: 'Validate By column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(8)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: By column title text color matched as expected'); + } else { + throw new Error(`By column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //By column title text font + { + description: 'Validate By column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(8)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: By column title text font-size matched as expected'); + } else { + throw new Error(`By column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Comments column title + { + description: 'Validate Comments column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(9)')).getText(); + if (elementText === 'Comments') { + console.log('Passed: Comments column title text matched as expected'); + } else { + throw new Error(`Expected: "Comments" column title text; Actual: "${elementText}"`); + } + } + }, + + //Comments column title text color -dark blue + { + description: 'Validate Comments column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(9)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Comments column title text color matched as expected'); + } else { + throw new Error(`Comments column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Comments column title text font + { + description: 'Validate Comments column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(9)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Comments column title text font-size matched as expected'); + } else { + throw new Error(`Comments column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Action column title + { + description: 'Validate Action column title', + action: async () => { + const elementText = await driver.findElement(By.css('th:nth-child(10)')).getText(); + if (elementText === 'Action') { + console.log('Passed: Action column title text matched as expected'); + } else { + throw new Error(`Expected: "Action" column title text; Actual: "${elementText}"`); + } + } + }, + + //Action column title text color -dark blue + { + description: 'Validate Action column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(10)')).getCssValue('color'); + if (elementStyle === 'rgba(33, 37, 41, 1)') { + console.log('Passed: Action column title text color matched as expected'); + } else { + throw new Error(`Action column title text color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Action column title text font + { + description: 'Validate Action column title text font size', + action: async () => { + const elementStyle = await driver.findElement(By.css('th:nth-child(10)')).getCssValue('font-size'); + if (elementStyle === '14.3px') { + console.log('Passed: Action column title text font-size matched as expected'); + } else { + throw new Error(`Action column title text font-size did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Published Framework 1 display title + { + description: 'Validate Published Framework 1 display title', + action: async () => { + try { + const element = await driver.findElement(By.css('tr:nth-child(2) > td: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 = 'Painting Done Today'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Framework title row 1 "${expectedText}" text in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Framework title row 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 + } + } + }, + + //Published Framework 1 Notes icon + { + description: 'Verify Published Framework 1 notes icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-sticky-note-o')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Published Framework 1 Notes icon not found'); + } + console.log('Passed: Published Framework 1 Notes icon present'); + } + }, + + //Published Framework 1 title + { + description: 'Validate Published Framework 1 title', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) em')).getText(); + if (elementText === 'Juan Testing Again & Again') { + console.log('Passed: Juan Testing Again & Again row 1 title text matched as expected'); + } else { + throw new Error(`Expected: "Juan Testing Again & Again" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Version + { + description: 'Validate Published Framework 1 version', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td:nth-child(2)')).getText(); + if (elementText === '1.1') { + console.log('Passed: Version 1.1 row 1 title text matched as expected'); + } else { + throw new Error(`Expected: Version "1.1" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Revision + { + description: 'Validate Published Framework 1 revision', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td:nth-child(3)')).getText(); + if (elementText === '5') { + console.log('Passed: Revision 5 row 1 title text matched as expected'); + } else { + throw new Error(`Expected: Revision "5" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Status button text + { + description: 'Validate Published Framework 1 status button text', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td > .badge')).getText(); + if (elementText === 'Implemented') { + console.log('Passed: Implemented row 1 title text matched as expected'); + } else { + throw new Error(`Expected: "Implemented" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Status button color -green + { + description: 'Validate Action column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('tr:nth-child(2) > td > .badge')).getCssValue('background-color'); + if (elementStyle === 'rgba(40, 167, 69, 1)') { + console.log('Passed: Published Framework row 1 Status button color matched as expected'); + } else { + throw new Error(`Published Framework row 1 Status button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Published Framework 1 Visibility + { + description: 'Validate Published Framework 1 visibility', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td:nth-child(5)')).getText(); + if (elementText === 'Public') { + console.log('Passed: Public row 1 title text matched as expected'); + } else { + throw new Error(`Expected: "Public" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Group + { + description: 'Validate Published Framework 1 group', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td:nth-child(6)')).getText(); + if (elementText === 'Initial Framework Group for Testing') { + console.log('Passed: Initial Framework Group for Testing row 1 title text matched as expected'); + } else { + throw new Error(`Expected: "Initial Framework Group for Testing" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Published At + { + description: 'Validate Published Framework 1 published at', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td:nth-child(7) > small')).getText(); + if (elementText === 'Apr 15, 2025 10:29pm PDT') { + console.log('Passed: Apr 15, 2025 10:29pm PDT row 1 title text matched as expected'); + } else { + throw new Error(`Expected: "Apr 15, 2025 10:29pm PDT" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 By + { + description: 'Validate Published Framework 1 by', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) > td:nth-child(8)')).getText(); + if (elementText === 'exact_juan') { + console.log('Passed: exact_juan row 1 title text matched as expected'); + } else { + throw new Error(`Expected: "exact_juan" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 Comments icon + { + description: 'Verify Published Framework 1 comments icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('tr:nth-child(2) .fa-check-circle')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Published Framework row 1 comments icon not found'); + } + console.log('Passed: Published Framework row 1 comments icon present'); + } + }, + + //Published Framework 1 Comments Count icon + { + description: 'Validate Published Framework 1 comments count icon', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(2) a > .badge')).getText(); + if (elementText === '3') { + console.log('Passed: Comments count 3 row 1 title text matched as expected'); + } else { + throw new Error(`Expected: Comments count "3" row 1 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 1 ellipsis icon + { + description: 'Verify Published Framework 1 ellipsis icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#dropdownMenu17 > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Published Framework row 1 ellipsis icon not found'); + } + console.log('Passed: Published Framework row 1 ellipsis icon present'); + } + }, + + //Published Framework 2 display title + { + description: 'Validate Published Framework 2 display title', + action: async () => { + try { + const element = await driver.findElement(By.css('tr:nth-child(3) > td: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 = 'KathleenTest DontBringBack Comments'; + const trimmedFullText = fullText.trim(); + const firstLine = trimmedFullText.split('\n')[0].trim(); + + //Try multiple matching strategies + if (firstLine.includes(expectedText)) { + console.log(`Passed: Framework title row 2 "${expectedText}" text found in first line`); + } else if (trimmedFullText.includes(expectedText)) { + console.log(`Passed: Framework title row 2 "${expectedText}" text found 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 + } + } + }, + + //Published Framework 2 title + { + description: 'Validate Published Framework 2 title', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) em')).getText(); + if (elementText === 'Kathleen Test') { + console.log('Passed: Kathleen Test row 2 title text matched as expected'); + } else { + throw new Error(`Expected: "Kathleen Test" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Version + { + description: 'Validate Published Framework 2 version', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td:nth-child(2)')).getText(); + if (elementText === '10.1') { + console.log('Passed: Version 10.1 row 2 title text matched as expected'); + } else { + throw new Error(`Expected: Version "10.1" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Revision + { + description: 'Validate Published Framework 2 revision', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td:nth-child(3)')).getText(); + if (elementText === '2') { + console.log('Passed: Revision 2 row 2 title text matched as expected'); + } else { + throw new Error(`Expected: Revision "2" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Status button text + { + description: 'Validate Published Framework 2 status button text', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td > .badge')).getText(); + if (elementText === 'Adopted') { + console.log('Passed: Adopted row 2 title text matched as expected'); + } else { + throw new Error(`Expected: "Adopted" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Status button color -teal + { + description: 'Validate Action column title text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('tr:nth-child(3) > td > .badge')).getCssValue('background-color'); + if (elementStyle === 'rgba(23, 162, 184, 1)') { + console.log('Passed: Published Framework row 2 Status button color matched as expected'); + } else { + throw new Error(`Published Framework row 2 Status button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //Published Framework 2 Visibility + { + description: 'Validate Published Framework 2 visibility', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td:nth-child(5)')).getText(); + if (elementText === 'Hidden') { + console.log('Passed: Hidden row 2 title text matched as expected'); + } else { + throw new Error(`Expected: "Hidden" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Group + { + description: 'Validate Published Framework 2 group', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td:nth-child(6)')).getText(); + if (elementText === 'Another Group To Use') { + console.log('Passed: Another Group To Use row 2 title text matched as expected'); + } else { + throw new Error(`Expected: "Another Group To Use" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Published At + { + description: 'Validate Published Framework 2 published at', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td:nth-child(7) > small')).getText(); + if (elementText === 'Mar 01, 2025 09:56pm PST') { + console.log('Passed: Apr 15, 2025 10:29pm PDT row 2 title text matched as expected'); + } else { + throw new Error(`Expected: "Apr 15, 2025 10:29pm PDT" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 By + { + description: 'Validate Published Framework 2 by', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) > td:nth-child(8)')).getText(); + if (elementText === 'exact_juan') { + console.log('Passed: exact_juan row 2 title text matched as expected'); + } else { + throw new Error(`Expected: "exact_juan" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 Comments icon + { + description: 'Verify Published Framework 2 comments icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('tr:nth-child(3) > td > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Published Framework row 2 comments icon not found'); + } + console.log('Passed: Published Framework row 2 comments icon present'); + } + }, + + //Published Framework 2 Comments Count icon + { + description: 'Validate Published Framework 2 comments count icon', + action: async () => { + const elementText = await driver.findElement(By.css('tr:nth-child(3) a > .badge')).getText(); + if (elementText === '4') { + console.log('Passed: Comments count 4 row 2 title text matched as expected'); + } else { + throw new Error(`Expected: Comments count "4" row 2 title text; Actual: "${elementText}"`); + } + } + }, + + //Published Framework 2 ellipsis icon + { + description: 'Verify Published Framework 2 ellipsis icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#dropdownMenu14 > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Published Framework row 2 ellipsis icon not found'); + } + console.log('Passed: Published Framework row 2 ellipsis icon present'); + } + }, + + //NEXT ACTION - Click Settings button + { description: 'Click Settings button', action: async () => await driver.findElement(By.linkText('Settings')).click() }, + + //Wait for DIV to open + { + description: 'Wait for DIV to open', + action: async () => { + return await driver.wait(until.elementLocated(By.css('.modal-title')), 10000).catch(() => false); + } + }, + + //DIV title text + { + description: 'Validate DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-title')).getText(); + if (elementText === 'Framework Publishing Settings') { + console.log('Passed: Framework Publishing Settings DIV title text matched as expected'); + } else { + throw new Error(`Expected: "Framework Publishing Settings" DIV title text; Actual: "${elementText}"`); + } + } + }, + + //DIV X icon color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.close > span')).getCssValue('color'); + if (elementStyle === 'rgba(246, 60, 40, 1)') { + console.log('Passed: Align icon color matched as expected'); + } else { + throw new Error(`Align icon color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //DIV Site Name label + { + description: 'Validate Site Name label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText === 'Site Name') { + console.log('Passed: Site Name label matched as expected'); + } else { + throw new Error(`Expected: "Site Name" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Site Name info icon + { + description: 'Verify Site Name info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divtype .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Site Name info icon not found'); + } + console.log('Passed: Site Name info icon present'); + } + }, + + //DIV Site Name textbox value + { + description: 'Validate Site Name textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#page_title')).getAttribute('value'); + if (elementValue === 'QA Test Client Curriculum Frameworks') { + console.log('Passed: QA Test Client Curriculum Frameworks value text, matched as expected'); + } else { + throw new Error(`Expected: "QA Test Client Curriculum Frameworks" value text; Actual: "${elementValue}"`); + } + } + }, + + //DIV Client Display Name label + { + description: 'Validate Client Display Name label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .form-label')).getText(); + if (elementText === 'Client Display Name') { + console.log('Passed: Client Display Name label matched as expected'); + } else { + throw new Error(`Expected: "Client Display Name" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Client Display Name info icon + { + description: 'Verify Client Display Name info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divname .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Client Display Name info icon not found'); + } + console.log('Passed: Client Display Name info icon present'); + } + }, + + //DIV Client Display Name textbox value + { + description: 'Validate Client Display Name textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#client_display_name')).getAttribute('value'); + if (elementValue === 'QA Test Client') { + console.log('Passed: QA Test Client value text, matched as expected'); + } else { + throw new Error(`Expected: "QA Test Client" value text; Actual: "${elementValue}"`); + } + } + }, + + //DIV Logo label + { + description: 'Validate Logo label', + action: async () => { + const elementText = await driver.findElement(By.css('#divsource > .form-label')).getText(); + if (elementText === 'Logo') { + console.log('Passed: Logo label matched as expected'); + } else { + throw new Error(`Expected: "Logo" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Logo info icon + { + description: 'Verify Logo info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divsource .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Logo info icon not found'); + } + console.log('Passed: Logo info icon present'); + } + }, + + //DIV Logo thumbnail image + { + description: 'Verify Logo thumbnail image is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.col-md-2 > img')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Logo thumbnail image not found'); + } + console.log('Passed: Logo thumbnail image present'); + } + }, + + //DIV Default Group label + { + description: 'Validate Default Group label', + action: async () => { + const elementText = await driver.findElement(By.css('#divparent > .form-label')).getText(); + if (elementText === 'Default Group') { + console.log('Passed: Default Group label matched as expected'); + } else { + throw new Error(`Expected: "Default Group" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Default Group info icon + { + description: 'Verify Default Group info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divparent .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Default Group info icon not found'); + } + console.log('Passed: Default Group info icon present'); + } + }, + + //DIV Default Group textbox value + { + description: 'Validate Default Group textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#group')).getAttribute('value'); + if (elementValue === '7') { + console.log('Passed: Initial Framework Group for Testing value text, matched as expected'); + } else { + throw new Error(`Expected: "Initial Framework Group for Testing" value text; Actual: "${elementValue}"`); + } + } + }, + + //DIV Default Download Formats label + { + description: 'Validate Default Download Formats label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-label')).getText(); + if (elementText === 'Default Download Formats') { + console.log('Passed: Default Download Formats label matched as expected'); + } else { + throw new Error(`Expected: "Default Download Formats" label; Actual: "${elementText}"`); + } + } + }, + + //DIV CSV checkbox -active + { + description: 'Validate CSV checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#formatcsv')).getAttribute('checked'); + if (elementStyle === 'true') { + console.log('Passed: CSV checkbox marked as checked as expected'); + } else { + throw new Error(`CSV checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + } + }, + + //DIV CSV label + { + description: 'Validate CSV label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-check:nth-child(3) > .form-check-label')).getText(); + if (elementText === 'CSV') { + console.log('Passed: CSV label matched as expected'); + } else { + throw new Error(`Expected: "CSV" label; Actual: "${elementText}"`); + } + } + }, + + //DIV PDF checkbox -active + { + description: 'Validate PDF checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#formatpdf')).getAttribute('checked'); + if (elementStyle === 'true') { + console.log('Passed: PDF checkbox marked as checked as expected'); + } else { + throw new Error(`PDF checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + } + }, + + //DIV PDF label + { + description: 'Validate PDF label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-check:nth-child(4) > .form-check-label')).getText(); + if (elementText === 'PDF') { + console.log('Passed: PDF label matched as expected'); + } else { + throw new Error(`Expected: "PDF" label; Actual: "${elementText}"`); + } + } + }, + + //DIV CASE checkbox -active + { + description: 'Validate CASE checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#formatcase')).getAttribute('checked'); + if (elementStyle === 'true') { + console.log('Passed: CASE checkbox marked as checked as expected'); + } else { + throw new Error(`CASE checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + } + }, + + /*DIV CASE JSON/API label {asterisk seens to break script} + { + description: 'Validate CASE JSON/API label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-check:nth-child(5) > .form-check-label')).getText(); + if (elementText === 'CASE JSON/API') { + console.log('Passed: CASE JSON/API label matched as expected'); + } else { + throw new Error(`Expected: "CASE JSON/API" label; Actual: "${elementText}"`); + } + } + },*/ + + //DIV This option also allows access to this framework via CASE compliant API label + { + description: 'Validate CASE label', + action: async () => { + const elementText = await driver.findElement(By.css('em > small')).getText(); + if (elementText === 'This option also allows access to this framework via CASE compliant API') { + console.log('Passed: This option also allows access to this framework via CASE compliant API label matched as expected'); + } else { + throw new Error(`Expected: "This option also allows access to this framework via CASE compliant API" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Default Display Status label + { + description: 'Validate Default Display Status label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(5) > #divpublisher > .form-label')).getText(); + if (elementText === 'Default Display Status') { + console.log('Passed: Default Display Status label matched as expected'); + } else { + throw new Error(`Expected: "Default Display Status" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Default Display Status info icon + { + description: 'Verify Default Display Status info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.form-row:nth-child(5) > #divpublisher .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Default Display Status info icon not found'); + } + console.log('Passed: Default Display Status info icon present'); + } + }, + + //DIV Default Display Status textbox value + { + description: 'Validate Default Display Status textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#status')).getAttribute('value'); + if (elementValue === 'Implemented') { + console.log('Passed: Implemented value text, matched as expected'); + } else { + throw new Error(`Expected: "Implemented" value text; Actual: "${elementValue}"`); + } + } + }, + + //DIV Default Comment Settings label + { + description: 'Validate Default Comment Settings label', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus > .form-label')).getText(); + if (elementText === 'Default Comment Settings') { + console.log('Passed: Default Comment Settings label matched as expected'); + } else { + throw new Error(`Expected: "Default Comment Settings" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Allow Comments checkbox -active + { + description: 'Validate Allow Comments checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#comments')).getAttribute('checked'); + if (elementStyle === 'true') { + console.log('Passed: Allow Comments checkbox marked as checked as expected'); + } else { + throw new Error(`Allow Comments checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + } + }, + + //DIV Allow Comments label + { + description: 'Validate Allow Comments label', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus > .form-check:nth-child(3) > .form-check-label')).getText(); + if (elementText === 'Allow Comments') { + console.log('Passed: Allow Comments label matched as expected'); + } else { + throw new Error(`Expected: "Allow Comments" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Comments are private checkbox is present + { + description: 'Verify Comments are private checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#private')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Comments are private checkbox not found'); + } + console.log('Passed: Comments are private checkbox present'); + } + }, + + //DIV Comments are private label + { + description: 'Validate Comments are private label', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus > .form-check:nth-child(4) > .form-check-label')).getText(); + if (elementText === 'Comments are private') { + console.log('Passed: Comments are private label matched as expected'); + } else { + throw new Error(`Expected: "Comments are private" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Default Visibility label + { + description: 'Validate Default Visibility label', + action: async () => { + const elementText = await driver.findElement(By.xpath(`(//div[@id='divpublisher']/label)[2]`)).getText(); + if (elementText === 'Default Visibility') { + console.log('Passed: Default Visibility label matched as expected'); + } else { + throw new Error(`Expected: "Default Visibility" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Default Visibility info icon + { + description: 'Verify Default Visibility info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.xpath(`(//div[@id='divpublisher']/a/i)[2]`)), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Default Visibility info icon not found'); + } + console.log('Passed: Default Visibility info icon present'); + } + }, + + //DIV Default Visibility textbox value + { + description: 'Validate Default Visibility textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#visible')).getAttribute('value'); + if (elementValue === 'Public') { + console.log('Passed: Public value text, matched as expected'); + } else { + throw new Error(`Expected: "Public" value text; Actual: "${elementValue}"`); + } + } + }, + + //DIV Ungrouped label + { + description: 'Validate Ungrouped label', + action: async () => { + const elementText = await driver.findElement(By.xpath(`(//div[@id='divpublisher']/label)[3]`)).getText(); + if (elementText === 'Ungrouped') { + console.log('Passed: Ungrouped label matched as expected'); + } else { + throw new Error(`Expected: "Ungrouped" label; Actual: "${elementText}"`); + } + } + }, + + //DIV Ungrouped info icon + { + description: 'Verify Ungrouped info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.xpath(`(//div[@id='divpublisher']/a/i)[3]`)), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Ungrouped info icon not found'); + } + console.log('Passed: Ungrouped info icon present'); + } + }, + + //DIV Ungrouped textbox value + { + description: 'Validate Ungrouped textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#position')).getAttribute('value'); + if (elementValue === 'Above') { + console.log('Passed: Above value text, matched as expected'); + } else { + throw new Error(`Expected: "Above" value text; Actual: "${elementValue}"`); + } + } + }, + + //DIV Save button text + { + description: 'Validate Save button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalop')).getAttribute('value'); + if (elementText === 'Save') { + console.log('Passed: Save button text matched as expected'); + } else { + throw new Error(`Expected: "Save" button text; Actual: "${elementText}"`); + } + } + }, + + //DIV Save button color -green + { + description: 'Validate Save button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#modalop')).getCssValue('background-color'); + if (elementStyle === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Save button color matched as expected'); + } else { + throw new Error(`Save button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //DIV Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText === 'Close') { + console.log('Passed: Close button text matched as expected'); + } else { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + } + }, + + //DIV Close button color -white + { + description: 'Validate Close button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#modalclose')).getCssValue('background-color'); + if (elementStyle === 'rgba(0, 0, 0, 0)') { + console.log('Passed: Close button color matched as expected'); + } else { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + } + }, + + //NEXT ACTION - Click Close button + { description: 'Click Close button', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + + //LOG OUT + //NEXT ACTION - Log out + { description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Log Out icon + { + description: 'Verify Log Out icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-sign-out')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Log Out icon not found'); + } + console.log('Passed: Log Out icon present'); + } + }, + + { description: 'Click Log Out link', action: async () => await driver.findElement(By.linkText('Log Out')).click() }, + + //Wait for login screen to load + { + description: 'Wait for log out process to complete', + action: async () => { + return await driver.wait(until.elementLocated(By.css('.login')), 10000).catch(() => false); + } + }, + + //Log Out button + { + description: 'Verify Log Out button is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Log Out button not found'); + } + console.log('Passed: Log Out button present; Script completed'); + } + }, +]; + +const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => { + const json_data = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); + json_data.push([stepIndex, stepDescription, status, timestamp, screenshotPath]); + return XLSX.utils.aoa_to_sheet(json_data); +}; + +const takeScreenshot = async (driver, stepIndex, stepDescription) => { + const screenshot = await driver.takeScreenshot(); + + const dir = path.join('screenshots', 'frameworkFrameworkSettingsDIV'); + + const screenshotFileName = `step_${stepIndex}_${stepDescription.replace(/\s+/g, '_')}.png`; + const screenshotPath = path.join(dir, screenshotFileName); + fs.writeFileSync(screenshotPath, screenshot, 'base64'); + return screenshotPath; +}; + +const clearOldResults = () => { + // Remove old screenshots + const screenshotDir = path.join('screenshots', 'frameworkFrameworkSettingsDIV'); + if (fs.existsSync(screenshotDir)) { + fs.rmSync(screenshotDir, { recursive: true, force: true }); + } + fs.mkdirSync(screenshotDir, { recursive: true }); + + // Remove old Excel file + if (fs.existsSync('frameworkFrameworkSettingsDIVResults.xlsx')) { + fs.unlinkSync('frameworkFrameworkSettingsDIVResults.xlsx'); + } +}; + +try { + // Initialize workbook and worksheet + clearOldResults(); + + // Initialize workbook and worksheet + workbook = XLSX.utils.book_new(); + worksheet = XLSX.utils.aoa_to_sheet([ + ['Step Number', 'Step Description', 'Status', 'Timestamp', 'Screenshot'] + ]); + XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1'); + + // Log test start time + worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, ''); + + let allStepsPassed = true; + + for (const step of steps) { + const stepIndex = steps.indexOf(step) + 1; + const timestamp = new Date().toISOString(); + + try { + await step.action(); + const screenshotPath = await takeScreenshot(driver, stepIndex, step.description); + worksheet = logStep(worksheet, step.description, 'Passed', stepIndex, timestamp, screenshotPath); + } catch (error) { + const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`); + worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath); + console.error(`Step ${stepIndex} FAILED: ${error.message}`); + testStatus = 'Failed'; + allStepsPassed = false; + } + } + + //Check if log out was successful + const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); + + if (loginButton && allStepsPassed) { + console.log('PASSED: Framework Settings DIV(ExACT_frameworkFrameworkSettingsDIV); All test steps completed successfully'); + testStatus = 'Passed'; + } else { + console.log('FAILED: Framework Settings DIV(ExACT_frameworkFrameworkSettingsDIV); One or more test steps failed'); + testStatus = 'Failed'; + } + + // Log test end time + const endTime = new Date().toISOString(); + worksheet = logStep(worksheet, 'Test End', testStatus, '', endTime, ''); + + // Write the updated worksheet back to the workbook and save it + workbook.Sheets['Sheet1'] = worksheet; + XLSX.writeFile(workbook, 'frameworkFrameworkSettingsDIVResults.xlsx'); +} finally { + await driver.quit(); +} +})(); +} + +export default ExACT_frameworkFrameworkSettingsDIV;