diff --git a/frameworkManagementPageResults.xlsx b/frameworkManagementPageResults.xlsx index 0396832..b019b79 100644 Binary files a/frameworkManagementPageResults.xlsx and b/frameworkManagementPageResults.xlsx differ diff --git a/index.js b/index.js index 04d38ea..6a2ee76 100644 --- a/index.js +++ b/index.js @@ -24,27 +24,27 @@ app.get('/', (req, res) => {

ExACT Automated Regression Scripts

(Click the corresponding link to execute the desired script)
-
ExACT Landing page
+
ExACT Landing Page

Login

DASHBOARD

-
My Content widget
+
My Content Widget

CONTENT

-
Content page
+
Content Page

Edit Item

ALIGN

-
Align Content
+
Align Content Page
+
Align - Edit Content and Align Concept
-
Align Standards
-
Align - Add Concepts/Correlate
+
Align Standards Page
-
Align Concepts
+
Align Concepts Page

FRAMEWORKS

Framework Management Page
diff --git a/tests/ExACT_frameworkManagementPage.js b/tests/ExACT_frameworkManagementPage.js index ea13f67..a07bd40 100644 --- a/tests/ExACT_frameworkManagementPage.js +++ b/tests/ExACT_frameworkManagementPage.js @@ -4,7 +4,7 @@ import XLSX from 'xlsx'; import path from 'path'; const ExACT_frameworkManagementPage = (req, res) => { - res.send('

ExACT Automated Test Script - Framework Management Page: Initiated

'); + res.send('

ExACT Automated Test Script: Framework Management Page(ExACT_frameworkManagementPage); Initiated

'); (async function example() { let driver = await new Builder().forBrowser('chrome').build(); let testStatus = 'Failed'; @@ -71,7 +71,7 @@ const steps = [ action: async () => { const elementText = await driver.findElement(By.css('h2')).getText(); if (elementText !== 'Framework Management') { - throw new Error(`Expected: "Framework Management"; Actual: "${elementText}"`); + throw new Error(`Expected: "Framework Management" page title; Actual: "${elementText}"`); } console.log('Passed: Framework Management page title matched as expected'); } @@ -121,7 +121,7 @@ const steps = [ if (elementText !== 'Publishing') { throw new Error(`Expected: "Publishing" button text; Actual: "${elementText}"`); } - console.log('Passed: Publsining button text matched as expected'); + console.log('Passed: Publishging button text matched as expected'); } }, @@ -137,6 +137,44 @@ const steps = [ } }, + //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') { + throw new Error(`Expected: "Framework Publishing" page title text; Actual: "${elementText}"`); + } + console.log('Passed: Framework Publishing page title text matched as expected'); + } + }, + + //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); + } + }, + //Import Framework button icon { description: 'Verify Import Framework buttion icon is present', @@ -173,6 +211,257 @@ const steps = [ } }, + //NEXT ACTION - Click Import Framework button + { description: 'Click Import Framework button', action: async () => await driver.findElement(By.linkText('Import Framework')).click() }, + + //Import Framework DIV + { + description: 'Wait for Import Framework DIV to open', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Import Framework DIV did not open'); + } + console.log('Passed: Import Framework DIV opened'); + } + }, + + //Import Framework DIV title + { + description: 'Validate Import Framework DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'Import Framework') { + throw new Error(`Expected: "Import Framework" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Import Framework DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Import Into label + { + description: 'Validate Import Into label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Import Into') { + throw new Error(`Expected: "Import Into" label text; Actual: "${elementText}"`); + } + console.log('Passed: Import Into label text matched as expected'); + } + }, + + //Import Into dropdown "New = { + const elementOption = await driver.findElement(By.css('#target')).getAttribute('value'); + if (elementOption !== 'new') { + throw new Error(`Expected: ""; Actual: "${elementOption}"`); + } + console.log('Passed: dropdown option matched as expected'); + } + }, + + //Name label + { + description: 'Validate Name label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .form-label')).getText(); + if (elementText !== 'Name') { + throw new Error(`Expected: "Name" label text; Actual: "${elementText}"`); + } + console.log('Passed: Name label text matched as expected'); + } + }, + + //Name textbox + { + description: 'Validate Name textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#orgname')).getText(); + if (elementValue !== '') { + throw new Error(`Expected: "Blank" Name textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Blank Name textbox value matched as expected'); + } + }, + + //Upload File label + { + description: 'Validate Upload File label', + action: async () => { + const elementText = await driver.findElement(By.css('#divupload > .form-label')).getText(); + if (elementText !== 'Upload File') { + throw new Error(`Expected: "Upload File" label text; Actual: "${elementText}"`); + } + console.log('Passed: Upload File label text matched as expected'); + } + }, + + //Upload File type + { + description: 'Validate Upload File type', + action: async () => { + const elementText = await driver.findElement(By.css('#upload')).getAttribute('type'); + if (elementText !== 'file') { + throw new Error(`Expected: "file" type; Actual: "${elementText}"`); + } + console.log('Passed: File type matched as expected'); + } + }, + + //Parent label + { + description: 'Validate Parent label', + action: async () => { + const elementText = await driver.findElement(By.css('#divparent > .form-label')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "Parent" label text; Actual: "${elementText}"`); + } + console.log('Passed: Parent label text matched as expected'); + } + }, + + //Parent dropdown + { + description: 'Validate Parent dropdown', + action: async () => { + const elementText = await driver.findElement(By.css('#parent > option:nth-child(1)')).getText(); + if (elementText !== 'None') { + throw new Error(`Expected: Parent dropdown "None" default text; Actual: "${elementText}"`); + } + console.log('Passed: Parent dropdown None default text matched as expected'); + } + }, + + //Download Import Template button icon + { + description: 'Verify Download Import Template buttion icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.mr-auto > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Download Import Template button icon not found'); + } + console.log('Passed: Download Import Template button icon present'); + } + }, + + //Download Import Template button text + { + description: 'Validate Download Import Template button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Download Import Template')).getText(); + if (elementText !== 'Download Import Template') { + throw new Error(`Expected: "Download Import Template" button text; Actual: "${elementText}"`); + } + console.log('Passed: Download Import Template button text matched as expected'); + } + }, + + //Download Import Template button color -green + { + description: 'Validate Download Import Template button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Download Import Template')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Download Import Template button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Download Import Template button color matched as expected'); + } + }, + + //Import button text + { + description: 'Validate Import button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalop')).getAttribute('value'); + if (elementText !== 'Import') { + throw new Error(`Expected: "Import" button text; Actual: "${elementText}"`); + } + console.log('Passed: Import button text matched as expected'); + } + }, + + //Import button color -green + { + description: 'Validate Import button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#modalop')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Import button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Import button color matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //NEXT ACTION - Import Framework DIV validation + { description: 'Click Import button', action: async () => await driver.findElement(By.css('#modalop')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Valiation text + { + description: 'Validattion text', + action: async () => { + const elementText = await driver.findElement(By.css('b')).getText(); + if (elementText !== 'Please enter a value for all highlighted fields') { + throw new Error(`Expected: "Please enter a value for all highlighted fields" validation text; Actual: "${elementText}"`); + } + console.log('Passed: Validation text matched as expected'); + } + }, + + //Validation text color -red + { + description: 'Validate text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('b')).getCssValue('color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Validation text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Validation text color matched as expected'); + } + }, + + //NEXT ACTION - DIV X-Close Icon + { description: 'Click DIV X icon', action: async () => await driver.findElement(By.css('.modal-lg .modal-header span')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + //Create button icon { description: 'Verify Create buttion icon is present', @@ -209,6 +498,209 @@ const steps = [ } }, + //NEXT ACTION - Click Create button + { description: 'Click Create button', action: async () => await driver.findElement(By.linkText('Create')).click() }, + + //Create DIV + { + description: 'Wait for Create DIV to load', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Create DIV did not load'); + } + console.log('Passed: Create DIV loaded'); + } + }, + + //Create DIV title + { + description: 'Validate Create DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'Create Organization/Framework') { + throw new Error(`Expected: "Create Organization/Framework" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Create Organization/Framework DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Type label + { + description: 'Validate Type label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Type') { + throw new Error(`Expected: "Type" label text; Actual: "${elementText}"`); + } + console.log('Passed: Type label text matched as expected'); + } + }, + + //Type dropdown (C= Organization) + { + description: 'Validate Type dropdown option', + action: async () => { + const elementOption = await driver.findElement(By.css('#orgtype')).getAttribute('value'); + if (elementOption !== 'C') { + throw new Error(`Expected: "Organization"; Actual: "${elementOption}"`); + } + console.log('Passed: Organization dropdown option matched as expected'); + } + }, + + //Name label + { + description: 'Validate Name label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .form-label')).getText(); + if (elementText !== 'Name') { + throw new Error(`Expected: "Name" label text; Actual: "${elementText}"`); + } + console.log('Passed: Name label text matched as expected'); + } + }, + + //Name textbox + { + description: 'Validate Name textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#orgname')).getText(); + if (elementValue !== '') { + throw new Error(`Expected: "Blank" Name textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Blank Name textbox value matched as expected'); + } + }, + + //Notes label + { + description: 'Validate Notes label', + action: async () => { + const elementText = await driver.findElement(By.css('#divnotes > .form-label')).getText(); + if (elementText !== 'Notes') { + throw new Error(`Expected: "Notes" label text; Actual: "${elementText}"`); + } + console.log('Passed: Notes label text matched as expected'); + } + }, + + //Notes textbox + { + description: 'Validate Notes textbox', + action: async () => { + const elementText = await driver.findElement(By.css('#notes')).getText(); + if (elementText !== '') { + throw new Error(`Expected: "Blank" Notes textbox value; Actual: "${elementText}"`); + } + console.log('Passed: Blank Notes textboxd value matched as expected'); + } + }, + + //Notes textbox + { + description: 'Validate Notes textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#notes')).getText(); + if (elementValue !== '') { + throw new Error(`Expected: "Blank" Notes textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Blank Notes textbox value matched as expected'); + } + }, + + //Create button text + { + description: 'Validate Create button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalop')).getAttribute('value'); + if (elementText !== 'Create') { + throw new Error(`Expected: "Create" button text; Actual: "${elementText}"`); + } + console.log('Passed: Create button text matched as expected'); + } + }, + + //Create button color -green + { + description: 'Validate Create button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#modalop')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Create button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Create button color matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //NEXT ACTION - Create DIV validation + { description: 'Click Import button', action: async () => await driver.findElement(By.css('#modalop')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Valiation text + { + description: 'Validattion text', + action: async () => { + const elementText = await driver.findElement(By.css('b')).getText(); + if (elementText !== 'Please enter a value for all highlighted fields') { + throw new Error(`Expected: "Please enter a value for all highlighted fields" validation text; Actual: "${elementText}"`); + } + console.log('Passed: Validation text matched as expected'); + } + }, + + //Validation text color -red + { + description: 'Validate text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('b')).getCssValue('color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Validation text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Validation text color matched as expected'); + } + }, + + //NEXT ACTION - DIV Close button + { description: 'Click DIV Close icon', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + //Search textbox { description: 'Verify Search textbox is present', @@ -257,25 +749,3022 @@ const steps = [ } }, - //Advanced Search button color -green (slightly different green color) + //Advanced Search button color -green (ECS-2894) { description: 'Validate Advanced Search button color', action: async () => { const elementStyle = await driver.findElement(By.css('.bg-green')).getCssValue('background-color'); - if (elementStyle !== 'rgba(26, 187, 156, 1)') { - throw new Error(`Advanced Search button color did not match; Actual: "${elementStyle}"`); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`ECS-2894 Advanced Search button color did not match; Actual: "${elementStyle}"`); } - console.log('Passed: Advanced Search button color matched as expected'); + console.log('Passed: ECS-2894 Advanced Search button color matched as expected'); + } + }, + + //NEXT ACTION - Advanced Search button + { description: 'Click Advanced Search button', action: async () => await driver.findElement(By.css('.bg-green')).click() }, + + //Advanced Search DIV + { + description: 'Wait for Advanced Search DIV to load', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#exampleModalCenterTitle')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Advanced Search DIV did not load'); + } + console.log('Passed: Advanced Search DIV loaded'); + } + }, + + //Advanced Search DIV title + { + description: 'Validate Advanced Search DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('#exampleModalCenterTitle')).getText(); + if (elementText !== 'Advance Framework Search') { + throw new Error(`Expected: "Advance Framework Searchh" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Advance Framework Search DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-dialog-centered .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Search in handle + { + description: 'Validate Search in handle', + action: async () => { + const elementText = await driver.findElement(By.css('.col-sm-12:nth-child(1) > label')).getText(); + if (elementText !== 'Search in') { + throw new Error(`Expected: "Search in" handle text; Actual: "${elementText}"`); + } + console.log('Passed: Search in handle text matched as expected'); + } + }, + + //Search in dropdown text + { + description: 'Validate Search in dropdown option', + action: async () => { + const elementOption = await driver.findElement(By.css('#feild')).getAttribute('value'); + if (elementOption !== 'stdtext') { + throw new Error(`Expected: "Item Text"; Actual: "${elementOption}"`); + } + console.log('Passed: Item Text dropdown option matched as expected'); + } + }, + + //Search term textbox -placeholder + { + description: 'Validate Search term textbox placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('#searchterm')).getAttribute('placeholder'); + if (elementValue !== 'Enter a search term') { + throw new Error(`Expected: Search term "Enter a search term" textbox placeholder; Actual: "${elementValue}"`); + } + console.log('Passed: Enter a search term textbox placeholder matched as expected'); + } + }, + + //Match phrase checkbox + { + description: 'Verify Match phrase checkbox is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.col-sm-12:nth-child(3) > input')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Match exact phrase checkbox not found'); + } + console.log('Passed: Match exact phrase checkbox present'); + } + }, + + //Match exact phrase label (ECS-2893) + { + description: 'Validate Match exact phrase label', + action: async () => { + const elementText = await driver.findElement(By.css('.ml-2:nth-child(2)')).getText(); + if (elementText !== 'Match exact phrase') { + throw new Error(`Expected: ECS-2893 "Match exact phrase" label; Actual: "${elementText}"`); + } + console.log('Passed: ECS-2893 Match exact phrase label matched as expected'); + } + }, + + //Filter By text + { + description: 'Validate Filter By text', + action: async () => { + const elementText = await driver.findElement(By.css('.col-sm-12:nth-child(4) > label')).getText(); + if (elementText !== 'Filter By') { + throw new Error(`Expected: "Filter By" text; Actual: "${elementText}"`); + } + console.log('Passed: Filter By text matched as expected'); + } + }, + + //Framework label + { + description: 'Validate Framework label', + action: async () => { + const elementText = await driver.findElement(By.css('.col-sm-6:nth-child(1) > label')).getText(); + if (elementText !== 'Framework') { + throw new Error(`Expected: "Framework" label; Actual: "${elementText}"`); + } + console.log('Passed: Framework label matched as expected'); + } + }, + + //Framework textbox -placeholder + { + description: 'Validate Framework textbox placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('#framesearch > div.modal-body > div.row.mt-2 > div:nth-child(1) > span > span.selection > span > span > textarea')).getAttribute('placeholder'); + if (elementValue !== 'All Framework') { + throw new Error(`Expected: Framework "All Framework" textbox placeholder; Actual: "${elementValue}"`); + } + console.log('Passed: Framework All Framework textbox placeholder matched as expected'); + } + }, + + //Level label + { + description: 'Validate Level label', + action: async () => { + const elementText = await driver.findElement(By.css('.col-sm-6:nth-child(2) > label')).getText(); + if (elementText !== 'Level') { + throw new Error(`Expected: "Level" label; Actual: "${elementText}"`); + } + console.log('Passed: Level label matched as expected'); + } + }, + + //Level textbox -value + { + description: 'Validate Level textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#level')).getAttribute('value'); + if (elementValue !== 'all') { + throw new Error(`Expected: Level "All" textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Level All textbox value matched as expected'); + } + }, + + //Subject label + { + description: 'Validate Subject label', + action: async () => { + const elementText = await driver.findElement(By.css('.col-sm-6:nth-child(3) > label')).getText(); + if (elementText !== 'Subject') { + throw new Error(`Expected: "Subject" label; Actual: "${elementText}"`); + } + console.log('Passed: Subject label matched as expected'); + } + }, + + //Subject textbox -placeholder + { + description: 'Validate Subject textbox placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('#subject > span > span.selection > span > span > textarea')).getAttribute('placeholder'); + if (elementValue !== 'All Subject') { + throw new Error(`Expected: Subject "All Subject" textbox placeholder; Actual: "${elementValue}"`); + } + console.log('Passed: Subjectd All Subject textbox placeholder matched as expected'); + } + }, + + //Grade label + { + description: 'Validate Grade label', + action: async () => { + const elementText = await driver.findElement(By.css('.col-sm-6:nth-child(4) > label')).getText(); + if (elementText !== 'Grade') { + throw new Error(`Expected: "Grade" label; Actual: "${elementText}"`); + } + console.log('Passed: Grade label matched as expected'); + } + }, + + //Grade textbox -placeholder + { + description: 'Validate Grade textbox placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('#grade > span > span.selection > span > span > textarea')).getAttribute('placeholder'); + if (elementValue !== ' All Grade') { + throw new Error(`Expected: Grade "All Grade" textbox placeholder; Actual: "${elementValue}"`); + } + console.log('Passed: Grade All Grade textbox placeholder matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('.btn-secondary:nth-child(1)')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //Close button color -white + { + description: 'Validate Close button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.btn-secondary:nth-child(1)')).getCssValue('background-color'); + if (elementStyle !== 'rgba(0, 0, 0, 0)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //Submit button text + { + description: 'Validate Submit button text', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-footer:nth-child(2) > .btn-primary')).getText(); + if (elementText !== 'Submit') { + throw new Error(`Expected: "Submit" button text; Actual: "${elementText}"`); + } + console.log('Passed: Submit button text matched as expected'); + } + }, + + //Submit button color -green + { + description: 'Validate Submit button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-footer:nth-child(2) > .btn-primary')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Submit button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Submit button color matched as expected'); + } + }, + + //NEXT ACTION - Advance Framework Search DIV validation + { description: 'Click Submit button', action: async () => await driver.findElement(By.css('.modal-footer:nth-child(2) > .btn-primary')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - DIV Close button + { description: 'Click DIV Close icon', action: async () => await driver.findElement(By.css('.modal-dialog-centered .modal-header span')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //FRAMEWORK LIST: 4Folder + 6files + //File icon 1 + { + description: 'Verify File icon 1 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.org:nth-child(1) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('File icon 1 not found'); + } + console.log('Passed: File icon 1 present'); + } + }, + + //Framework 1 title + { + description: 'Validate Framework 1 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('5th Grade Import ECS-2732')).getText(); + if (elementText !== '5th Grade Import ECS-2732') { + throw new Error(`Expected: "5th Grade Import ECS-2732" title text; Actual: "${elementText}"`); + } + console.log('Passed: 5th Grade Import ECS-2732 title text matched as expected'); + } + }, + + //Folder icon 1 + { + description: 'Verify Folder icon 1 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#folder874461689')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Folder icon 1 not found'); + } + console.log('Passed: Folder icon 1 present'); + } + }, + + //Framework 2 title + { + description: 'Validate Framework 2 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Adding a New Org to test with')).getText(); + if (elementText !== 'Adding a New Org to test with') { + throw new Error(`Expected: "Adding a New Org to test with" title text; Actual: "${elementText}"`); + } + console.log('Passed: Adding a New Org to test with title text matched as expected'); + } + }, + + //Folder icon 2 + { + description: 'Verify Folder icon 2 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#folder874452736')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Folder icon 2 not found'); + } + console.log('Passed: Folder icon 2 present'); + } + }, + + //Framework 3 title + { + description: 'Validate Framework 3 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('ECS-2732 Testing Frame II')).getText(); + if (elementText !== 'ECS-2732 Testing Frame II') { + throw new Error(`Expected: "ECS-2732 Testing Frame II" title text; Actual: "${elementText}"`); + } + console.log('Passed: ECS-2732 Testing Frame II title text matched as expected'); + } + }, + + //File icon 2 + { + description: 'Verify File icon 2 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(4) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('File icon 2 not found'); + } + console.log('Passed: File icon 2 present'); + } + }, + + //Framework 4 title + { + description: 'Validate Framework 4 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Kathleen Test')).getText(); + if (elementText !== 'Kathleen Test') { + throw new Error(`Expected: "Kathleen Test" title text; Actual: "${elementText}"`); + } + console.log('Passed: Kathleen Test title text matched as expected'); + } + }, + + //Folder icon 3 + { + description: 'Verify Folder icon 3 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#folder873575829')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Folder icon 3 not found'); + } + console.log('Passed: Folder icon 3 present'); + } + }, + + //Framework 5 title + { + description: 'Validate Framework 5 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Latest Test For Today')).getText(); + if (elementText !== 'Latest Test For Today') { + throw new Error(`Expected: "Latest Test For Today" title text; Actual: "${elementText}"`); + } + console.log('Passed: Latest Test For Today title text matched as expected'); + } + }, + + //Folder icon 4 + { + description: 'Verify Folder icon 4 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#folder873617737')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Folder icon 4 not found'); + } + console.log('Passed: Folder icon 4 present'); + } + }, + + //Framework 6 title + { + description: 'Validate Framework 6 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('My Latest Organization For Now')).getText(); + if (elementText !== 'My Latest Organization For Now') { + throw new Error(`Expected: "My Latest Organization For Now" title text; Actual: "${elementText}"`); + } + console.log('Passed: My Latest Organization For Now title text matched as expected'); + } + }, + + //File icon 3 + { + description: 'Verify File icon 3 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(7) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('File icon 3 not found'); + } + console.log('Passed: File icon 3 present'); + } + }, + + //Framework 7 title + { + description: 'Validate Framework 7 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Stats Test Framework')).getText(); + if (elementText !== 'Stats Test Framework') { + throw new Error(`Expected: "Stats Test Framework" title text; Actual: "${elementText}"`); + } + console.log('Passed: Stats Test Framework title text matched as expected'); + } + }, + + //File icon 4 + { + description: 'Verify File icon 4 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(8) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('File icon 4 not found'); + } + console.log('Passed: File icon 4 present'); + } + }, + + //Framework 8 title + { + description: 'Validate Framework 8 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Test Math: Grade 9')).getText(); + if (elementText !== 'Test Math: Grade 9') { + throw new Error(`Expected: "Test Math: Grade 9" title text; Actual: "${elementText}"`); + } + console.log('Passed: Test Math: Grade 9 title text matched as expected'); + } + }, + + //File icon 5 + { + description: 'Verify File icon 5 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(9) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('File icon 5 not found'); + } + console.log('Passed: File icon 5 present'); + } + }, + + //Framework 9 title + { + description: 'Validate Framework 9 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Thursday Framework')).getText(); + if (elementText !== 'Thursday Framework') { + throw new Error(`Expected: "Thursday Framework" title text; Actual: "${elementText}"`); + } + console.log('Passed: Thursday Framework title text matched as expected'); + } + }, + + //File icon 6 + { + description: 'Verify File icon 6 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(10) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('File icon 6 not found'); + } + console.log('Passed: File icon 6 present'); + } + }, + + //Framework 10 title + { + description: 'Validate Framework 10 title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Widget Test')).getText(); + if (elementText !== 'Widget Test') { + throw new Error(`Expected: "Widget Test" title text; Actual: "${elementText}"`); + } + console.log('Passed: Widget Test title text matched as expected'); + } + }, + + //NEXT ACTION - Click My Latest Organization For Now link + { description: 'Click My Latest Organization For Now link', action: async () => await driver.findElement(By.linkText('My Latest Organization For Now')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //My Latest Organization For Now Open file icon is present + { + description: 'Verify My Latest Organization For Now Open file icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#folder873617737')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('My Latest Organization For Now Open file icon is not present'); + } + console.log('Passed: My Latest Organization For Now Open file icon is present'); + } + }, + + //Juan Testing Again & Again Edit icon is present + { + description: 'Verify My Latest Organization For Now Edit icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(6) > .opts .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('My Latest Organization For Now Edit icon is not present'); + } + console.log('Passed: My Latest Organization For Now Edit icon is present'); + } + }, + + //At the Office File icon is present + { + description: 'Verify At the Office File icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#org-873617737 > .list-group-item:nth-child(1) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('At the Office File icon is not present'); + } + console.log('Passed: At the Office File icon is present'); + } + }, + + //At the Office title + { + description: 'Validate At the Office title', + action: async () => { + const elementText = await driver.findElement(By.linkText('At The Office')).getText(); + if (elementText !== 'At The Office') { + throw new Error(`Expected: "At The Office" title text; Actual: "${elementText}"`); + } + console.log('Passed: At The Office title text matched as expected'); + } + }, + + //Juan Testing Again & Again File icon is present + { + description: 'Verify Juan Testing Again & Again File icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.doc:nth-child(2) > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Juan Testing Again & Again File icon is not present'); + } + console.log('Passed: Juan Testing Again & Again File icon is present'); + } + }, + + //Juan Testing Again & Again title + { + description: 'Validate Juan Testing Again & Again title', + action: async () => { + const elementText = await driver.findElement(By.linkText('Juan Testing Again & Again')).getText(); + if (elementText !== 'Juan Testing Again & Again') { + throw new Error(`Expected: "Juan Testing Again & Again" title text; Actual: "${elementText}"`); + } + console.log('Passed: Juan Testing Again & Again title text matched as expected'); + } + }, + + //NEXT ACTION - Click My Latest Organization For Now Edit icon + { description: 'Click My Latest Organization For Now Edit icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(6) > .opts .fa')).click() }, + + //Organization DIV + { + description: 'Wait for Edit Organization DIV to open', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Edit Organization DIV did not open'); + } + console.log('Passed: Edit Organization DIV opened'); + } + }, + + //Edit Organization title + { + description: 'Validate Edit Organization DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'Edit Organization') { + throw new Error(`Expected: "Edit Organization" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Edit Organization DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Type label + { + description: 'Validate Type label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Type') { + throw new Error(`Expected: "Type" label text; Actual: "${elementText}"`); + } + console.log('Passed: Type label text matched as expected'); + } + }, + + //Type Info icon is present + { + description: 'Verify Type Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('a:nth-child(2) > .fa-question-circle')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Type Info icon is not present'); + } + console.log('Passed: Type Info icon is present'); + } + }, + + //Organization label + { + description: 'Validate Organization label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype')).getText(); + if (elementText !== 'Organization') { + throw new Error(`Expected: "Organization" label text; Actual: "${elementText}"`); + } + console.log('Passed: Organization label text matched as expected'); + } + }, + + //Fixes are made for text comparison for description text + { + description: 'Validate Applications of Linear Systems description text', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype')).getText(); + const expectedText = 'Organization'; + + // Trim the element text to avoid mismatch due to extra spaces or appended text + if (elementText.trimEnd() !== expectedText) { + throw new Error(`Expected: "${expectedText}" text; Actual: "${elementText}"`); + } + + console.log('Passed: text matched as expected'); } }, + //Organization label + { + description: 'Validate Organization label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname')).getText(); + const expectedText = 'Ogranization'; + //Trim expected text + if (elementText.trimStart() !== expectedText) { + throw new Error(`Expected: "${expectedText}" label text; Actual: "${elementText}"`); + } + console.log(`Passed: "${expectedText}" label text matched as expected`); + } + }, + //Name label + { + description: 'Validate Name label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .form-label')).getText(); + if (elementText !== 'Name') { + throw new Error(`Expected: "Name" label text; Actual: "${elementText}"`); + } + console.log('Passed: Name label text matched as expected'); + } + }, + + //Name textbox + { + description: 'Validate Name textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#orgname')).getAttribute('value'); + if (elementValue !== 'My Latest Organization For Now') { + throw new Error(`Expected: Name textbox, "My Latest Organization For Now" value; Actual: "${elementValue}"`); + } + console.log('Passed: Name textbox, My Latest Organization For Now value matched as expected'); + } + }, + + //Notes label + { + description: 'Validate Notes label', + action: async () => { + const elementText = await driver.findElement(By.css('#divnotes > .form-label')).getText(); + if (elementText !== 'Notes') { + throw new Error(`Expected: "Notes" label text; Actual: "${elementText}"`); + } + console.log('Passed: Notes label text matched as expected'); + } + }, + + //Notes textbox + { + description: 'Validate Notes textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#notes')).getText(); + if (elementValue !== 'Would this make a difference.') { + throw new Error(`Expected: Notest textbox, "Would this make a difference." value; Actual: "${elementValue}"`); + } + console.log('Passed: Notes textbox, Would this make a difference. value matched as expected'); + } + }, + + //Delete button text + { + description: 'Validate Delete button text', + action: async () => { + const elementText = await driver.findElement(By.css('#orgdelete')).getText(); + if (elementText !== 'Delete') { + throw new Error(`Expected: "Delete" button text; Actual: "${elementText}"`); + } + console.log('Passed: Delete button text matched as expected'); + } + }, + + //Delete button color -red + { + description: 'Validate Delete button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#orgdelete')).getCssValue('background-color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Delete button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Delete button color matched as expected'); + } + }, + + //Save button text + { + description: 'Validate Save button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalop')).getAttribute('value'); + if (elementText !== 'Save') { + throw new Error(`Expected: "Save" button text; Actual: "${elementText}"`); + } + console.log('Passed: Save button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Save button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Save button color matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //NEXT ACTION - Close DIV + { description: 'Click Close button', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again file icon + { description: 'Click Juan Testing Again & Again file icon', action: async () => await driver.findElement(By.css('.doc:nth-child(2) > .fa')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Juan Testing Again & Again Upload icon is present + { + description: 'Verify Juan Testing Again & Again Upload icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) > .float-right .fa-cloud-upload')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Juan Testing Again & Again Upload icon is not present'); + } + console.log('Passed: Juan Testing Again & Again Upload icon is present'); + } + }, + + //Juan Testing Again & Again View icon is present + { + description: 'Verify Juan Testing Again & Again View icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) > .float-right > .frame-name > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Juan Testing Again & Again View icon is not present'); + } + console.log('Passed: Juan Testing Again & Again View icon is present'); + } + }, + + //Juan Testing Again & Again Download icon is present + { + description: 'Verify Juan Testing Again & Again Download icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) > .float-right .fa-download')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Juan Testing Again & Again Download icon is not present'); + } + console.log('Passed: Juan Testing Again & Again Download icon is present'); + } + }, + + //Juan Testing Again & Again Info icon is present + { + description: 'Verify Juan Testing Again & Again Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) > .float-right .fa-info-circle')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Juan Testing Again & Again Info icon is not present'); + } + console.log('Passed: Juan Testing Again & Again Info icon is present'); + } + }, + + //Juan Testing Again & Again Edit icon 2 is present + { + description: 'Verify Juan Testing Again & Again Edit icon 2 is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(2) > .float-right .fa-pencil-square-o')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Juan Testing Again & Again Edit icon 2 is not present'); + } + console.log('Passed: Juan Testing Again & Again Edit icon 2 is present'); + } + }, + + //NEXT ACTION - Click Juan Testing Again & Again upload icon + { description: 'Click Juan Testing Again & Again upload icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .float-right .fa-cloud-upload')).click() }, + + //Publish Framework DIV + { + description: 'Wait for DIV to open', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publish Framework DIV did not open'); + } + console.log('Passed: Publish Framework DIV opened'); + } + }, + + //Publish Framework DIV title + { + description: 'Validate Publish Framework DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'Publish Framework') { + throw new Error(`Expected: "Publish Framework" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Publish Framework DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Framework label + { + description: 'Validate Framework label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Framework') { + throw new Error(`Expected: "Framework" label text; Actual: "${elementText}"`); + } + console.log('Passed: Framework label text matched as expected'); + } + }, + + //Framework textbox + { + description: 'Validate Framework textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#org')).getAttribute('value'); + if (elementValue !== '873575832') { + throw new Error(`Expected: Framework textbox, "Juan Testing Again & Again" value; Actual: "${elementValue}"`); + } + console.log('Passed: Framework textbox, Juan Testing Again & Again value matched as expected'); + } + }, + + //Display Title label + { + description: 'Validate Display Title label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .form-label')).getText(); + if (elementText !== 'Display Title') { + throw new Error(`Expected: "Display Title" label text; Actual: "${elementText}"`); + } + console.log('Passed: Display Title label text matched as expected'); + } + }, + + //Display Title Info icon is present + { + description: 'Verify Display Title 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('Display Title Info icon is not present'); + } + console.log('Passed: Display Title Info icon is present'); + } + }, + + //Display Title textbox + { + description: 'Validate Display Title textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#title')).getAttribute('value'); + if (elementValue !== '') { + throw new Error(`Expected: "Blank" Display Title textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Blank Display Title textbo value matched as expected'); + } + }, + + //Version label + { + description: 'Validate Version label', + action: async () => { + const elementText = await driver.findElement(By.css('#divsource > .form-label')).getText(); + if (elementText !== 'Version') { + throw new Error(`Expected: "Version" label text; Actual: "${elementText}"`); + } + console.log('Passed: Version label text matched as expected'); + } + }, + + //Version Info icon is present + { + description: 'Verify Version 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('Version Info icon is not present'); + } + console.log('Passed: Version Info icon is present'); + } + }, + + //Version textbox + { + description: 'Validate Version Title textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#version')).getAttribute('value'); + if (elementValue !== '') { + throw new Error(`Expected: "Blank" Version Title textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Blank Version Title textbox value matched as expected'); + } + }, + + //Display Status label + { + description: 'Validate Display Status label', + action: async () => { + const elementText = await driver.findElement(By.css('#divpublisher > .form-label')).getText(); + if (elementText !== 'Display Status') { + throw new Error(`Expected: "Display Status" label text; Actual: "${elementText}"`); + } + console.log('Passed: Display Status label text matched as expected'); + } + }, + + //Display Status Info icon is present + { + description: 'Verify Display Status Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divpublisher .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Display Status Info icon is not present'); + } + console.log('Passed: Display Status Info icon is present'); + } + }, + + //Display Status textbox + { + description: 'Validate Display Status textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#status')).getAttribute('value'); + if (elementValue !== 'Implemented') { + throw new Error(`Expected: Display Status textbox, "Implemented" value; Actual: "${elementValue}"`); + } + console.log('Passed: Display Status textbox, Implemented value matched as expected'); + } + }, + + //Group label + { + description: 'Validate Group label', + action: async () => { + const elementText = await driver.findElement(By.css('#divparent > .form-label')).getText(); + if (elementText !== 'Group') { + throw new Error(`Expected: "Group" label text; Actual: "${elementText}"`); + } + console.log('Passed: Group label text matched as expected'); + } + }, + + //Group Info icon is present + { + description: 'Verify 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('Group Info icon is not present'); + } + console.log('Passed: Group Info icon is present'); + } + }, + + //Group textbox + { + description: 'Validate Group textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#group')).getAttribute('value'); + if (elementValue !== '7') { + throw new Error(`Expected: Group textbox, "Initial Framework Group for Testing" value; Actual: "${elementValue}"`); + } + console.log('Passed: Group textbox, Initial Framework Group for Testing value matched as expected'); + } + }, + + //Download Formats label + { + description: 'Validate Download Formats label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-label')).getText(); + if (elementText !== 'Download Formats') { + throw new Error(`Expected: "Download Formats" label text; Actual: "${elementText}"`); + } + console.log('Passed: Download Formats label text matched as expected'); + } + }, + + //Download Formats Info icon is present + { + description: 'Verify Download Formats Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divcreator .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Download Formats Info icon is not present'); + } + console.log('Passed: Download Formats Info icon is present'); + } + }, + + //CSV checkbox -active + { + description: 'Validate CSV checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#formatcsv')).getAttribute('checked'); + if (elementStyle !== 'true') { + throw new Error(`CSV checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: CSV checkbox option value matched as expected'); + } + }, + + //CSV label + { + description: 'Validate CSV label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-check:nth-child(4) > .form-check-label')).getText(); + if (elementText !== 'CSV') { + throw new Error(`Expected: "CSV" label text; Actual: "${elementText}"`); + } + console.log('Passed: CSV label text matched as expected'); + } + }, + + //PDF checkbox -active + { + description: 'Validate PDF checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#formatpdf')).getAttribute('checked'); + if (elementStyle !== 'true') { + throw new Error(`PDF checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: PDF checkbox option value matched as expected'); + } + }, + + //PDF label + { + description: 'Validate PDF label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-check:nth-child(5) > .form-check-label')).getText(); + if (elementText !== 'PDF') { + throw new Error(`Expected: "PDF" label text; Actual: "${elementText}"`); + } + console.log('Passed: PDF label text matched as expected'); + } + }, + + //CASE JSON/API* checkbox -active + { + description: 'Validate CASE JSON API checkbox option enabled', + action: async () => { + const elementStyle = await driver.findElement(By.css('#formatcase')).getAttribute('checked'); + if (elementStyle !== 'true') { + throw new Error(`CASE JSON/API* checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: CASE JSON/API* checkbox option value matched as expected'); + } + }, + + //CASE JSON/API* label + { + description: 'Validate CASE JSON API label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-check:nth-child(6) > .form-check-label')).getText(); + if (elementText !== 'CASE JSON/API*') { + throw new Error(`Expected: "CASE JSON/API*" label text; Actual: "${elementText}"`); + } + console.log('Passed: CASE JSON/API* label text matched as expected'); + } + }, + + //Asterisk icons + { + description: 'Validate Asterisk icons', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator')).getText(); + if (elementText !== 'This option also allows access to this framework via CASE compliant API') { + throw new Error(`Expected: "This option also allows access to this framework via CASE compliant API" label text; Actual: "${elementText}"`); + } + console.log('Passed: This option also allows access to this framework via CASE compliant API label text matched as expected'); + } + }, + + //Asterisk label + { + description: 'Validate Asterisk label', + action: async () => { + const elementText = await driver.findElement(By.css('small')).getText(); + if (elementText !== 'This option also allows access to this framework via CASE compliant API') { + throw new Error(`Expected: "This option also allows access to this framework via CASE compliant API" label text; Actual: "${elementText}"`); + } + console.log('Passed: This option also allows access to this framework via CASE compliant API label text matched as expected'); + } + }, + + //Comment Settings label + { + description: 'Validate Comment Settings label', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus > .form-label')).getText(); + if (elementText !== 'Comment Settings') { + throw new Error(`Expected: "Comment Settings" label text; Actual: "${elementText}"`); + } + console.log('Passed: Comment Settings label text matched as expected'); + } + }, + + //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') { + throw new Error(`Allow Comments checkbox option value checked did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Allow Comments checkbox option value matched as expected'); + } + }, + + //Allow Comments label + { + description: 'Validate Allow Comments label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-check:nth-child(3) > .form-check-label')).getText(); + if (elementText !== 'Allow Comments') { + throw new Error(`Expected: "Allow Comments" label text; Actual: "${elementText}"`); + } + console.log('Passed: Allow Comments label text matched as expected'); + } + }, + + //Comments are private checkbox + { + 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'); + } + }, + + //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') { + throw new Error(`Expected: "Comments are private" label text; Actual: "${elementText}"`); + } + console.log('Passed: Comments are private label text matched as expected'); + } + }, + + //Publisher's Notes label + { + description: 'Validate Publishers Notes label', + action: async () => { + const elementText = await driver.findElement(By.css('#divpubnotes > .form-label')).getText(); + if (elementText !== `Publisher's Notes`) { + throw new Error(`Expected: "Publisher's Notes" label text; Actual: "${elementText}"`); + } + console.log(`Passed: Publisher's Notes label text matched as expected`); + } + }, + + //Publisher's Notes textbox + { + description: 'Validate Publishers Notes textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#pubnotes')).getAttribute('value'); + if (elementValue !== '') { + throw new Error(`Expected: "Blank" Publisher's Notes textbox value; Actual: "${elementValue}"`); + } + console.log(`Passed: Blank Publisher's Notes textbox value matched as expected`); + } + }, + + //Publish button text + { + description: 'Validate Publish button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalop')).getAttribute('value'); + if (elementText !== 'Publish') { + throw new Error(`Expected: "Publish" button text; Actual: "${elementText}"`); + } + console.log('Passed: Publish button text matched as expected'); + } + }, + + //Publish button color -green + { + description: 'Validate Publish button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#modalop')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Publish button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: SPublish button color matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //NEXT ACTION - Publish Framework -validation + { description: 'Click Publish button', action: async () => await driver.findElement(By.css('#modalop')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //Display Title valiation text + { + description: 'Display Title validattion text', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .invalid-feedback')).getText(); + if (elementText !== 'You must enter a framework title') { + throw new Error(`Expected: "You must enter a framework title" Display Title validation text; Actual: "${elementText}"`); + } + console.log('Passed: Display Title validation text matched as expected'); + } + }, + + //Display Title validation text color -red + { + description: 'Validate text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#divname > .invalid-feedback')).getCssValue('color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Display Title validation text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Display Title validation text color matched as expected'); + } + }, + + //Version valiation text + { + description: 'Version validattion text', + action: async () => { + const elementText = await driver.findElement(By.css('#divsource > .invalid-feedback')).getText(); + if (elementText !== 'You must enter a version for the published framework') { + throw new Error(`Expected: "You must enter a version for the published framework" Version validation text; Actual: "${elementText}"`); + } + console.log('Passed: Version validation text matched as expected'); + } + }, + + //Version validation text color -red + { + description: 'Validate text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#divsource > .invalid-feedback')).getCssValue('color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Version validation text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Version validation text color matched as expected'); + } + }, + + //DIV valiation text + { + description: 'DIV validattion text', + action: async () => { + const elementText = await driver.findElement(By.css('b')).getText(); + if (elementText !== 'Please enter a value for all highlighted fields') { + throw new Error(`Expected: "Please enter a value for all highlighted fields" DIV validation text; Actual: "${elementText}"`); + } + console.log('Passed: DIV validation text matched as expected'); + } + }, + + //DIV validation text color -red + { + description: 'Validate text color', + action: async () => { + const elementStyle = await driver.findElement(By.css('b')).getCssValue('color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`DIV validation text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV validation text color matched as expected'); + } + }, + + //NEXT ACTION - Close DIV + { description: 'Click Close button', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again file icon + { description: 'Click Juan Testing Again & Again file icon', action: async () => await driver.findElement(By.css('.doc:nth-child(2) > .fa')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again View Icon + { description: 'Click View icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .float-right > .frame-name > .fa')).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); + } + }, + + //Juan Testing Again & Again page title + { + description: 'Validate Juan Testing Again & Again page title', + action: async () => { + const elementText = await driver.findElement(By.css('h2')).getText(); + if (elementText !== 'Juan Testing Again & Again') { + throw new Error(`Expected: "Juan Testing Again & Again" page title; Actual: "${elementText}"`); + } + console.log('Passed: Juan Testing Again & Again page title matched as expected'); + } + }, + + //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)') { + throw new Error(`Framework Management page title text color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Framework Management page title text color matched as expected'); + } + }, + + //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') { + throw new Error(`Framework Management page title text font-size did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Framework Management page title text font-size matched as expected'); + } + }, + + //Edit icon + { + description: 'Verify Edit icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-pencil-square-o')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Edit icon not found'); + } + console.log('Passed: Edit icon present'); + } + }, + + //Publish button icon + { + description: 'Verify Publish button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-pencil-square-o')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publish button icon not found'); + } + console.log('Passed: Publish button icon present'); + } + }, + + //Publish button text + { + description: 'Validate Publish button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Publish')).getText(); + if (elementText !== 'Publish') { + throw new Error(`Expected: "Publish" button text; Actual: "${elementText}"`); + } + console.log('Passed: Publish button text matched as expected'); + } + }, + + //Publish button color -green + { + description: 'Validate Publish button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Publish')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Publish button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Publish button color matched as expected'); + } + }, + + //Download button icon + { + description: 'Verify Download button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-download')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Download button icon not found'); + } + console.log('Passed: Download button icon present'); + } + }, + + //Download button text + { + description: 'Validate Download button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Download')).getText(); + if (elementText !== 'Download') { + throw new Error(`Expected: "Download" button text; Actual: "${elementText}"`); + } + console.log('Passed: Download button text matched as expected'); + } + }, + + //Download button color -green + { + description: 'Validate Download button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Download')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Download button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Download button color matched as expected'); + } + }, + + //Add New Item button icon + { + description: 'Verify Add New Item button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.btn > .fa-plus')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Add New Item button icon not found'); + } + console.log('Passed: Add New Item button icon present'); + } + }, + + //Add New Item button text + { + description: 'Validate Add New Item button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Add New Item')).getText(); + if (elementText !== 'Add New Item') { + throw new Error(`Expected: "Add New Item" button text; Actual: "${elementText}"`); + } + console.log('Passed: Add New Item button text matched as expected'); + } + }, + + //Add New Item button color -green + { + description: 'Validate Add New Item button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Add New Item')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Add New Item button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Add New Item button color matched as expected'); + } + }, + + //Add New Item button text + { + description: 'Validate Add New Item button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Add New Item')).getText(); + if (elementText !== 'Add New Item') { + throw new Error(`Expected: "Add New Item" button text; Actual: "${elementText}"`); + } + console.log('Passed: Add New Item button text matched as expected'); + } + }, + + //Add New Item button color -green + { + description: 'Validate Add New Item button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Add New Item')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Add New Item button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Add New Item button color matched as expected'); + } + }, + + //Draft button text + { + description: 'Validate Draft button text', + action: async () => { + const elementText = await driver.findElement(By.css('.badge-secondary')).getText(); + if (elementText !== 'Draft') { + throw new Error(`Expected: "Draft" button text; Actual: "${elementText}"`); + } + console.log('Passed: Draft button text matched as expected'); + } + }, + + //Draft button color -gray + { + description: 'Validate Draft button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge-secondary')).getCssValue('background-color'); + if (elementStyle !== 'rgba(108, 117, 125, 1)') { + throw new Error(`Draft button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Draft button color matched as expected'); + } + }, + + //Effective date label + { + description: 'Validate Effective date label', + action: async () => { + const elementText = await driver.findElement(By.css('.mr-2 > em')).getText(); + if (elementText !== 'Effective 12/02/2022') { + throw new Error(`Expected: "Effective 12/02/2022" text; Actual: "${elementText}"`); + } + console.log('Passed: Effective 12/02/2022 text matched as expected'); + } + }, + + //Created by label + { + description: 'Validate Created by label', + action: async () => { + const elementText = await driver.findElement(By.css('span:nth-child(7)')).getText(); + if (elementText !== 'Created by: Juancho') { + throw new Error(`Expected: "Created by: Juancho" text; Actual: "${elementText}"`); + } + console.log('Passed: Created by: Juancho text matched as expected'); + } + }, + + //Source label + { + description: 'Validate Source label', + action: async () => { + const elementText = await driver.findElement(By.css('.mt-1')).getText(); + if (elementText !== 'Source: https://www.espn.com') { + throw new Error(`Expected: "Source: https://www.espn.com" text; Actual: "${elementText}"`); + } + console.log('Passed: Source: https://www.espn.com text matched as expected'); + } + }, + + //Source URL label + { + description: 'Validate Source URL label', + action: async () => { + const elementText = await driver.findElement(By.linkText('https://www.espn.com')).getText(); + if (elementText !== 'https://www.espn.com') { + throw new Error(`Expected: Source URL: "https://www.espn.com" link text; Actual: "${elementText}"`); + } + console.log('Passed: Source URL: https://www.espn.com link text matched as expected'); + } + }, + + //Source edit icon + { + description: 'Verify Source edit icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-external-link')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Source edit icon not found'); + } + console.log('Passed: Source edit icon present'); + } + }, + + //Search textbox -placeholder + { + description: 'Validate Search textbox placeholder', + action: async () => { + const elementValue = await driver.findElement(By.css('#framework-item-filter')).getAttribute('placeholder'); + if (elementValue !== 'Search...') { + throw new Error(`Expected: "Search" textbox placeholder; Actual: "${elementValue}"`); + } + console.log('Passed: Search textbox placeholder matched as expected'); + } + }, + + //Clear Search icon + { + description: 'Verify Clear Search icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-times')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Clear Search icon not found'); + } + console.log('Passed: Clear Search icon present'); + } + }, + + //Comments button comment icon + { + description: 'Verify Comments button comment icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-comment')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Comments button comment icon not found'); + } + console.log('Passed: Comments button comment icon present'); + } + }, + + //Comments 25 button text + { + description: 'Validate Comments button text', + action: async () => { + const elementText = await driver.findElement(By.css('.btn-sm:nth-child(1)')).getText(); + if (elementText !== 'Comments 25') { + throw new Error(`Expected: "Comments 25" button text; Actual: "${elementText}"`); + } + console.log('Passed: Comments 25 button text matched as expected'); + } + }, + + //Total comments button icon + { + description: 'Verify Total comments button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.badge-light')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Total comments button icon not found'); + } + console.log('Passed: Total comments button icon present'); + } + }, + + //Comments button color -green + { + description: 'Validate Comments button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.badge-secondary')).getCssValue('background-color'); + if (elementStyle !== 'rgba(108, 117, 125, 1)') { + throw new Error(`Comments button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Comments button color matched as expected'); + } + }, + + //Expand All button icon + { + description: 'Verify Expand All button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-expand')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Expand All button icon not found'); + } + console.log('Passed: Expand All button icon present'); + } + }, + + //Expand All button text + { + description: 'Validate Expand All button text', + action: async () => { + const elementText = await driver.findElement(By.css('#expandall')).getText(); + if (elementText !== 'Expand All') { + throw new Error(`Expected: "Expand All" button text; Actual: "${elementText}"`); + } + console.log('Passed: Expand All button text matched as expected'); + } + }, + + //Expand All button color -green + { + description: 'Validate Expand Allbutton color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#expandall')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Expand All button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Expand All button color matched as expected'); + } + }, + + //Collapse All button icon + { + description: 'Verify Collapse All button icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-compress')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Collapse All button icon not found'); + } + console.log('Passed: Collapse All button icon present'); + } + }, + + //Collapse All button text + { + description: 'Validate Collapse All button text', + action: async () => { + const elementText = await driver.findElement(By.css('#collapseall')).getText(); + if (elementText !== 'Collapse All') { + throw new Error(`Expected: "Collapse All" button text; Actual: "${elementText}"`); + } + console.log('Passed: Collapse All button text matched as expected'); + } + }, + + //Collapse All button color -green + { + description: 'Validate Collapse All button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#collapseall')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Collapse All button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Collapse All button color matched as expected'); + } + }, + + //Parent Standard Target icon + { + description: 'Verify Parent Standard Target icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#std-873617672 > .stdtext > .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Parent Standard Target icon not found'); + } + console.log('Passed: Parent Standard Target icon present'); + } + }, + + //Parent Standard text + { + description: 'Validate Parent Standard text', + action: async () => { + const elementText = await driver.findElement(By.css('#std-873617672 .stdstr')).getText(); + if (elementText !== 'Baseball and Statistics') { + throw new Error(`Expected: Parent Standard "Baseball and Statistics" text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Standard text matched as expected'); + } + }, + + //Parent Standard text -grade + { + description: 'Validate Parent Standard grade text', + action: async () => { + const elementText = await driver.findElement(By.css('#std-873617672 em')).getText(); + if (elementText !== '(Grade: 9,10,11,12)') { + throw new Error(`Expected: Parent Standard "(Grade: 9,10,11,12)" text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Standard grade text matched as expected'); + } + }, + + //Parent Standard Comments icon text + { + description: 'Validate Parent Standard Comments icon text', + action: async () => { + const elementText = await driver.findElement(By.css('#std-873617672 .badge')).getText(); + if (elementText !== '14') { + throw new Error(`Expected: Parent Standard Comments icon "14" text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Standard Comments icon text matched as expected'); + } + }, + + //Parent Standard Comments icon color -red + { + description: 'Validate arent Standard Comments icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#std-873617672 .badge')).getCssValue('background-color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Parent Standard Comments icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Parent Standard Comments icon color matched as expected'); + } + }, + + //Parent Standard Info icon + { + description: 'Verify Parent Standard Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#std-873617672 .fa-info-circle')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Parent Standard Info icon not found'); + } + console.log('Passed: Parent Standard Info icon present'); + } + }, + + //Parent Standard Ellipsis icon + { + description: 'Verify Parent Standard Ellipsis icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#std-873617672 .fa-ellipsis-h')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Parent Standard Ellipsis icon not found'); + } + console.log('Passed: Parent Standard Ellipsis icon present'); + } + }, + + //Parent Standard 2 Expand icon + { + description: 'Verify Parent Standard 2 Expand icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#icon-873617673')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Parent Standard 2 Expand icon not found'); + } + console.log('Passed: Parent Standard 2 Expand icon present'); + } + }, + + //Parent Standard 2 text + { + description: 'Validate Parent Standard 2 text', + action: async () => { + const elementText = await driver.findElement(By.css('#std-873617673 .stdstr')).getText(); + if (elementText !== 'Probabilities LFGSD') { + throw new Error(`Expected: Parent Standard 2 "Probabilities LFGSD" text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Standard 2 text matched as expected'); + } + }, + + //Parent Standard 2 text -grade + { + description: 'Validate Parent Standard 2 gade text', + action: async () => { + const elementText = await driver.findElement(By.css('#std-873617673 em')).getText(); + if (elementText !== '(Grade: 9)') { + throw new Error(`Expected: Parent Standard 2 "(Grade: 9)" text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Standard 2 grade text matched as expected'); + } + }, + + //Parent Standard 2 Comments icon text + { + description: 'Validate Parent Standard 2 Comments icon text', + action: async () => { + const elementText = await driver.findElement(By.css('#std-873617673 .badge')).getText(); + if (elementText !== '11') { + throw new Error(`Expected: Parent Standard 2 Comments icon "11" text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Standard 2 Comments icon text matched as expected'); + } + }, + + //Parent Standard 2 Comments icon color -red + { + description: 'Validate arent Standard 2 Comments icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#std-873617673 .badge')).getCssValue('background-color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Parent Standard 2 Comments icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Parent Standard 2 Comments icon color matched as expected'); + } + }, + + //Parent Standard 2 Info icon + { + description: 'Verify Parent Standard 2 Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#std-873617673 .fa-info-circle')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Parent Standard 2 Info icon not found'); + } + console.log('Passed: Parent Standard 2 Info icon present'); + } + }, + + //Parent Standard 2 Ellipsis icon + { + description: 'Verify Parent Standard 2 Ellipsis icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#std-873617673 .fa-ellipsis-h')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Parent Standard 2 Ellipsis icon not found'); + } + console.log('Passed: Parent Standard 2 Ellipsis icon present'); + } + }, + + //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); + } + }, + + //NEXT ACTION - Click My Latest Organization For Now link + { description: 'Click My Latest Organization For Now link', action: async () => await driver.findElement(By.linkText('My Latest Organization For Now')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again file icon + { description: 'Click Juan Testing Again & Again file icon', action: async () => await driver.findElement(By.css('.doc:nth-child(2) > .fa')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again Download Icon + { description: 'Click Download icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .float-right .fa-download')).click() }, + + //Export Framework DIV + { + description: 'Wait for DIV to open', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Export Framework DIV did not open'); + } + console.log('Passed: Export Framework DIV opened'); + } + }, + + //Export Framework DIV title + { + description: 'Validate Export Framework DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'Export Framework') { + throw new Error(`Expected: "Export Framework" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Export Framework DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Juan Testing Again & Again title + { + description: 'Validate Juan Testing Again & Again title', + action: async () => { + const elementText = await driver.findElement(By.css('b')).getText(); + if (elementText !== 'Juan Testing Again & Again') { + throw new Error(`Expected: "Juan Testing Again & Again" title text; Actual: "${elementText}"`); + } + console.log('Passed: Juan Testing Again & Again title text matched as expected'); + } + }, + + //Please choose format text + { + description: 'Validate Please choose format text', + action: async () => { + const elementText = await driver.findElement(By.css('p:nth-child(2)')).getText(); + if (elementText !== 'Please choose which format you wish to download:') { + throw new Error(`Expected: "Please choose which format you wish to download:" text; Actual: "${elementText}"`); + } + console.log('Passed: Please choose which format you wish to download: text matched as expected'); + } + }, + + //Export CSV button text + { + description: 'Validate Export CSV button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Export CSV')).getText(); + if (elementText !== 'Export CSV') { + throw new Error(`Expected: "Export CSV" button text; Actual: "${elementText}"`); + } + console.log('Passed: Export CSV button text matched as expected'); + } + }, + + //Export CSV button color -green + { + description: 'Validate Export CSV button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Export CSV')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Export CSV button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Export CSV button color matched as expected'); + } + }, + + //Export CASE JSON button text + { + description: 'Validate Export CASE JSON button text', + action: async () => { + const elementText = await driver.findElement(By.linkText('Export CASE JSON')).getText(); + if (elementText !== 'Export CASE JSON') { + throw new Error(`Expected: "Export CASE JSON" button text; Actual: "${elementText}"`); + } + console.log('Passed: Export CASE JSON button text matched as expected'); + } + }, + + //CASE JSON button color -green + { + description: 'Validate Export CASE JSON button color', + action: async () => { + const elementStyle = await driver.findElement(By.linkText('Export CASE JSON')).getCssValue('background-color'); + if (elementStyle !== 'rgba(48, 200, 172, 1)') { + throw new Error(`Export CASE JSON button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Export CASE JSON button color matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //NEXT ACTION - Close DIV + { description: 'Click Close button', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again file icon + { description: 'Click Juan Testing Again & Again file icon', action: async () => await driver.findElement(By.css('.doc:nth-child(2) > .fa')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again Info Icon + { description: 'Click Info icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .float-right .fa-info-circle')).click() }, + + //View Framework DIV + { + description: 'Wait for DIV to open', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('View Framework DIV did not open'); + } + console.log('Passed: View Framework DIV opened'); + } + }, + + //View Framework Info DIV title + { + description: 'Validate View Framework Info DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'View Framework Info') { + throw new Error(`Expected: "View Framework Info" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: View Framework Info DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Type label + { + description: 'Validate Type label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Type') { + throw new Error(`Expected: "Type" label; Actual: "${elementText}"`); + } + console.log('Passed: Type label matched as expected'); + } + }, + + //Type description + { + description: 'Validate Type description', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype')).getText(); + if (elementText !== 'Framework') { + throw new Error(`Expected: "Framework" type description text; Actual: "${elementText}"`); + } + console.log('Passed: Framework type description text matched as expected'); + } + }, + + //Name label + { + description: 'Validate Name label', + action: async () => { + const elementText = await driver.findElement(By.css('#divname > .form-label')).getText(); + if (elementText !== 'Name') { + throw new Error(`Expected: "Name" label; Actual: "${elementText}"`); + } + console.log('Passed: Name label matched as expected'); + } + }, + + //Name description + { + description: 'Validate Name description', + action: async () => { + const elementText = await driver.findElement(By.css('#divname')).getText(); + if (elementText !== 'Juan Testing Again & Again') { + throw new Error(`Expected: "Juan Testing Again & Again" name description text; Actual: "${elementText}"`); + } + console.log('Passed: Juan Testing Again & Again name description text matched as expected'); + } + }, + + //Source URL label + { + description: 'Validate Source URL label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(1) > #divsource > .form-label')).getText(); + if (elementText !== 'Source URL') { + throw new Error(`Expected: "Source URL" label; Actual: "${elementText}"`); + } + console.log('Passed: Source URL label matched as expected'); + } + }, + + //Source URL description + { + description: 'Validate Source URL description', + action: async () => { + const elementText = await driver.findElement(By.linkText('https://www.espn.com')).getText(); + if (elementText !== 'https://www.espn.com') { + throw new Error(`Expected: "https://www.espn.com" source URL description text; Actual: "${elementText}"`); + } + console.log('Passed: https://www.espn.com source URL description text matched as expected'); + } + }, + + //Parent label + { + description: 'Validate Parent label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(1) > #divparent > .form-label')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "Parent" label; Actual: "${elementText}"`); + } + console.log('Passed: Parent label matched as expected'); + } + }, + + //Parent description + { + description: 'Validate Parent description', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(1) > #divparent')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "Parent" parent description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent parent description text matched as expected'); + } + }, + + //Description label + { + description: 'Validate Description label', + action: async () => { + const elementText = await driver.findElement(By.css('#divdescription > .form-label')).getText(); + if (elementText !== 'Description') { + throw new Error(`Expected: "Description" label; Actual: "${elementText}"`); + } + console.log('Passed: Description label matched as expected'); + } + }, + + //Description description + { + description: 'Validate Description description', + action: async () => { + const elementText = await driver.findElement(By.css('#divdescription')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "1" parent description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent parent description text matched as expected'); + } + }, + + //Creator label + { + description: 'Validate Creator label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-label')).getText(); + if (elementText !== 'Creator') { + throw new Error(`Expected: "Creator" label; Actual: "${elementText}"`); + } + console.log('Passed: Creator label matched as expected'); + } + }, + + //Creator description + { + description: 'Validate Creator description', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "2" creator description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent creator description text matched as expected'); + } + }, + + //Publisher label + { + description: 'Validate Publisher label', + action: async () => { + const elementText = await driver.findElement(By.css('#divpublisher > .form-label')).getText(); + if (elementText !== 'Publisher') { + throw new Error(`Expected: "Publisher" label; Actual: "${elementText}"`); + } + console.log('Passed: Publisher label matched as expected'); + } + }, + + //Publisher description + { + description: 'Validate Publisher description', + action: async () => { + const elementText = await driver.findElement(By.css('#divpublisher')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "3" publisher description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent publisher description text matched as expected'); + } + }, + + //Status label + { + description: 'Validate Status label', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus > .form-label')).getText(); + if (elementText !== 'Status') { + throw new Error(`Expected: "Status" label; Actual: "${elementText}"`); + } + console.log('Passed: Status label matched as expected'); + } + }, + + //Status description + { + description: 'Validate Status description', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "4" Status description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent Status description text matched as expected'); + } + }, + + //Effective Date label + { + description: 'Validate Effective Date label', + action: async () => { + const elementText = await driver.findElement(By.css('#diveffective > .form-label')).getText(); + if (elementText !== 'Effective Date') { + throw new Error(`Expected: "Effective Date" label; Actual: "${elementText}"`); + } + console.log('Passed: Effective Date label matched as expected'); + } + }, + + //Effective Date description + { + description: 'Validate Effective Date description', + action: async () => { + const elementText = await driver.findElement(By.css('#diveffective')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "5" effective date description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent effective date description text matched as expected'); + } + }, + + //Language label + { + description: 'Validate Language label', + action: async () => { + const elementText = await driver.findElement(By.css('#divlang > .form-label')).getText(); + if (elementText !== 'Language') { + throw new Error(`Expected: "Language" label; Actual: "${elementText}"`); + } + console.log('Passed: Language label matched as expected'); + } + }, + + //Language description + { + description: 'Validate Language description', + action: async () => { + const elementText = await driver.findElement(By.css('#divlang')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "5" language description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent language description text matched as expected'); + } + }, + + //Version label + { + description: 'Validate Version label', + action: async () => { + const elementText = await driver.findElement(By.css('#divversion > .form-label')).getText(); + if (elementText !== 'Version') { + throw new Error(`Expected: "Version" label; Actual: "${elementText}"`); + } + console.log('Passed:Version label matched as expected'); + } + }, + + //Version description + { + description: 'Validate Version description', + action: async () => { + const elementText = await driver.findElement(By.css('#divversion')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "6" version description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent version description text matched as expected'); + } + }, + + //Notes label + { + description: 'Validate Notes label', + action: async () => { + const elementText = await driver.findElement(By.css('#divnotes > .form-label')).getText(); + if (elementText !== 'Notes') { + throw new Error(`Expected: "Notes" label; Actual: "${elementText}"`); + } + console.log('Passed: Notes label matched as expected'); + } + }, + + //Notes description + { + description: 'Validate Notes description', + action: async () => { + const elementText = await driver.findElement(By.css('#divnotes')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "6" notes description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent notes description text matched as expected'); + } + }, + + //Created label + { + description: 'Validate Created label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(4) > #divsource > .form-label')).getText(); + if (elementText !== 'Created') { + throw new Error(`Expected: "Created" label; Actual: "${elementText}"`); + } + console.log('Passed: Created label matched as expected'); + } + }, + + //Created description + { + description: 'Validate Created description', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(4) > #divsource')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "7" created description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent created description text matched as expected'); + } + }, + + //Last Modified label + { + description: 'Validate Last Modified label', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(4) > #divparent > .form-label')).getText(); + if (elementText !== 'Last Modified') { + throw new Error(`Expected: "Last Modified" label; Actual: "${elementText}"`); + } + console.log('Passed: Last Modified label matched as expected'); + } + }, + + //Last Modified description + { + description: 'Validate Last Modified description', + action: async () => { + const elementText = await driver.findElement(By.css('.form-row:nth-child(4) > #divparent')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "8" last modified description text; Actual: "${elementText}"`); + } + console.log('Passed: Parent last modified description text matched as expected'); + } + }, + + //NEXT ACTION - Close DIV + { description: 'Click Close button', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again file icon + { description: 'Click Juan Testing Again & Again file icon', action: async () => await driver.findElement(By.css('.doc:nth-child(2) > .fa')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, + + //NEXT ACTION - Click Juan Testing Again & Again Edit Icon + { description: 'Click Edit icon', action: async () => await driver.findElement(By.css('.list-group-item:nth-child(2) > .float-right .fa-pencil-square-o')).click() }, + + //Edit Framework DIV + { + description: 'Wait for Edit Framework DIV to open', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('.modal-lg .modal-title')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Edit Framework DIV did not open'); + } + console.log('Passed: Edit Framework DIV opened'); + } + }, + + //Edit Framework title + { + description: 'Validate Edit Framework DIV title', + action: async () => { + const elementText = await driver.findElement(By.css('.modal-lg .modal-title')).getText(); + if (elementText !== 'Edit Framework') { + throw new Error(`Expected: "Edit Framework" DIV title text; Actual: "${elementText}"`); + } + console.log('Passed: Edit Framework DIV title text matched as expected'); + } + }, + + //X icon DIV color -red + { + description: 'Validate X icon color', + action: async () => { + const elementStyle = await driver.findElement(By.css('.modal-lg .modal-header span')).getCssValue('color'); + if (elementStyle !== 'rgba(246, 60, 40, 1)') { + throw new Error(`DIV "X" icon color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: DIV X icon color matched as expected'); + } + }, + + //Type label + { + description: 'Validate Type label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Type') { + throw new Error(`Expected: "Type" label text; Actual: "${elementText}"`); + } + console.log('Passed: Type label text matched as expected'); + } + }, + + //Type Info icon is present + { + description: 'Verify Type 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('Type Info icon is not present'); + } + console.log('Passed: Type Info icon is present'); + } + }, + + //Type value text + { + description: 'Validate Type value text', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype')).getText(); + if (elementText !== 'Framework') { + throw new Error(`Expected: "Framework" Type value text; Actual: "${elementText}"`); + } + console.log('Passed: "Framework" Type value text matched as expected'); + } + }, + + //Name label + { + description: 'Validate Type label', + action: async () => { + const elementText = await driver.findElement(By.css('#divtype > .form-label')).getText(); + if (elementText !== 'Type') { + throw new Error(`Expected: "Type" labele text; Actual: "${elementText}"`); + } + console.log('Passed: Type labele text matched as expected'); + } + }, + + //Name textbox + { + description: 'Validate Name textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#orgname')).getText(); + if (elementValue !== '') { + throw new Error(`Expected: "Juan Testing Again & Again" Name textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Juan Testing Again & Again Name textbox value matched as expected'); + } + }, + + //Source URL label + { + description: 'Validate Source URL label', + action: async () => { + const elementText = await driver.findElement(By.css('#divsource > .form-label')).getText(); + if (elementText !== 'Source URL') { + throw new Error(`Expected: "Source URL" label text; Actual: "${elementText}"`); + } + console.log('Passed: Source URL label text matched as expected'); + } + }, + + //Source URL textbox + { + description: 'Validate Source URL textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#url')).getText(); + if (elementValue !== '') { + throw new Error(`Expected: "https://www.espn.com" Source URL textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: https://www.espn.com Source URL textbox value matched as expected'); + } + }, + + //Parent label + { + description: 'Validate Parent label', + action: async () => { + const elementText = await driver.findElement(By.css('#divparent > .form-label')).getText(); + if (elementText !== 'Parent') { + throw new Error(`Expected: "Parent" label text; Actual: "${elementText}"`); + } + console.log('Passed: Parent label text matched as expected'); + } + }, + + //Parent Info icon is present + { + description: 'Verify Parent 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('Parent Info icon is not present'); + } + console.log('Passed: Parent Info icon is present'); + } + }, + + //Parent dropdown "My Latest Organization For Now" (873617737) + { + description: 'Validate Parent dropdown option', + action: async () => { + const elementOption = await driver.findElement(By.css('#parent')).getAttribute('value'); + if (elementOption !== '873617737') { + throw new Error(`Expected: "My Latest Organization For Now"; Actual: "${elementOption}"`); + } + console.log('Passed: My Latest Organization For Now dropdown option matched as expected'); + } + }, + + //Description label + { + description: 'Validate Description label', + action: async () => { + const elementText = await driver.findElement(By.css('#divdescription > .form-label')).getText(); + if (elementText !== 'Description') { + throw new Error(`Expected: "Description" label text; Actual: "${elementText}"`); + } + console.log('Passed: Description label text matched as expected'); + } + }, + + //Description textbox value + { + description: 'Validate Description textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#description')).getText(); + if (elementValue !== 'This is my Framework testing description.') { + throw new Error(`Expected: "This is my Framework testing description." Description textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Description textbox value matched as expected'); + } + }, + + //Creator label + { + description: 'Validate Creator label', + action: async () => { + const elementText = await driver.findElement(By.css('#divcreator > .form-label')).getText(); + if (elementText !== 'Creator') { + throw new Error(`Expected: "Creator" label text; Actual: "${elementText}"`); + } + console.log('Passed: Creator label text matched as expected'); + } + }, + + //Creator Info icon is present + { + description: 'Verify Creator Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divcreator .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Creator Info icon is not present'); + } + console.log('Passed: Creator Info icon is present'); + } + }, + + //Creator textbox value + { + description: 'Validate Creator textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#creator')).getAttribute('value'); + if (elementValue !== 'Juancho') { + throw new Error(`Expected: "Juancho" Creator textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Creator textbox value matched as expected'); + } + }, + + //Publisher label + { + description: 'Validate Publisher label', + action: async () => { + const elementText = await driver.findElement(By.css('#divpublisher > .form-label')).getText(); + if (elementText !== 'Publisher') { + throw new Error(`Expected: "Publisher" label text; Actual: "${elementText}"`); + } + console.log('Passed: Publisher label text matched as expected'); + } + }, + + //Publisher Info icon is present + { + description: 'Verify Publisher Info icon is present', + action: async () => + { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divpublisher .fa')), 5000).catch(() => false); + if (!expectedIcon) { + throw new Error('Publisher Info icon is not present'); + } + console.log('Passed: Publisher Info icon is present'); + } + }, + + //Publisher textbox value + { + description: 'Validate Publisher textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#creator')).getAttribute('value'); + if (elementValue !== 'Juancho') { + throw new Error(`Expected: "Juancho" Publisher textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Publisher textbox value matched as expected'); + } + }, + + //Status label + { + description: 'Validate Status label', + action: async () => { + const elementText = await driver.findElement(By.css('#divstatus > .form-label')).getText(); + if (elementText !== 'Status') { + throw new Error(`Expected: "Status" label text; Actual: "${elementText}"`); + } + console.log('Passed: Status label text matched as expected'); + } + }, + + //Status dropdown + { + description: 'Validate Status dropdown option', + action: async () => { + const elementText = await driver.findElement(By.css('#status > option:nth-child(1)')).getText(); + if (elementText !== 'Draft') { + throw new Error(`Expected: "Draft" Status value text; Actual: "${elementText}"`); + } + console.log('Passed: Draft Status value text matched as expected'); + } + }, + + //Effective Date label + { + description: 'Validate Effective Date label', + action: async () => { + const elementText = await driver.findElement(By.css('#diveffective > .form-label')).getText(); + if (elementText !== 'Effective Date') { + throw new Error(`Expected: "Effective Date" label text; Actual: "${elementText}"`); + } + console.log('Passed: Effective Date label text matched as expected'); + } + }, + + //Effective Date textbox + { + description: 'Validate Effective Date textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#effective')).getAttribute('value'); + if (elementValue !== '12/02/2022') { + throw new Error(`Expected: "12/02/2022" Effective Date textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: 12/02/2022 Effective Date textbox value matched as expected'); + } + }, + + //Language label + { + description: 'Validate Language label', + action: async () => { + const elementText = await driver.findElement(By.css('#divlang > .form-label')).getText(); + if (elementText !== 'Language') { + throw new Error(`Expected: "Language" label text; Actual: "${elementText}"`); + } + console.log('Passed: Language label text matched as expected'); + } + }, + + //Language dropdown + { + description: 'Validate Language dropdown option', + action: async () => { + const elementOption = await driver.findElement(By.css('#lang')).getAttribute('value'); + if (elementOption !== 'en') { + throw new Error(`Expected: "English"; Actual: "${elementOption}"`); + } + console.log('Passed: English dropdown option matched as expected'); + } + }, + + //Version label + { + description: 'Validate Version label', + action: async () => { + const elementText = await driver.findElement(By.css('#divversion > .form-label')).getText(); + if (elementText !== 'Version') { + throw new Error(`Expected: "Version" label text; Actual: "${elementText}"`); + } + console.log('Passed: Version label text matched as expected'); + } + }, + + //Version textbox + { + description: 'Validate Version textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#version')).getAttribute('value'); + if (elementValue !== '2022.1.1') { + throw new Error(`Expected: "2022.1.1" Version textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: 2022.1.1 Version textbox value matched as expected'); + } + }, + + //Notes label + { + description: 'Validate Notes label', + action: async () => { + const elementText = await driver.findElement(By.css('#divnotes > .form-label')).getText(); + if (elementText !== 'Notes') { + throw new Error(`Expected: "Notes" label text; Actual: "${elementText}"`); + } + console.log('Passed: Notes label text matched as expected'); + } + }, + + //Notes textbox value + { + description: 'Validate Notes textbox value', + action: async () => { + const elementValue = await driver.findElement(By.css('#notes')).getText(); + if (elementValue !== 'This only contains Kindergarten for now.') { + throw new Error(`Expected: "This only contains Kindergarten for now." Notes textbox value; Actual: "${elementValue}"`); + } + console.log('Passed: Notes textbox value matched as expected'); + } + }, + + //Delete button text + { + description: 'Validate Delete button text', + action: async () => { + const elementText = await driver.findElement(By.css('#orgdelete')).getText(); + if (elementText !== 'Delete') { + throw new Error(`Expected: "Delete" button text; Actual: "${elementText}"`); + } + console.log('Passed: Delete button text matched as expected'); + } + }, + + //Delete button color -red + { + description: 'Validate Delete button color', + action: async () => { + const elementStyle = await driver.findElement(By.css('#orgdelete')).getCssValue('background-color'); + if (elementStyle !== 'rgba(220, 53, 69, 1)') { + throw new Error(`Delete button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Delete button color matched as expected'); + } + }, + + //Save button text + { + description: 'Validate Save button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalop')).getAttribute('value'); + if (elementText !== 'Save') { + throw new Error(`Expected: "Save" button text; Actual: "${elementText}"`); + } + console.log('Passed: Save button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Save button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Save button color matched as expected'); + } + }, + + //Close button text + { + description: 'Validate Close button text', + action: async () => { + const elementText = await driver.findElement(By.css('#modalclose')).getText(); + if (elementText !== 'Close') { + throw new Error(`Expected: "Close" button text; Actual: "${elementText}"`); + } + console.log('Passed: Close button text matched as expected'); + } + }, + + //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)') { + throw new Error(`Close button color did not match; Actual: "${elementStyle}"`); + } + console.log('Passed: Close button color matched as expected'); + } + }, + + //NEXT ACTION - Close DIV + { description: 'Click Close button', action: async () => await driver.findElement(By.css('#modalclose')).click() }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, //LOG OUT //NEXT ACTION - Log out { description: 'Click Username dropdown', action: async () => await driver.findElement(By.css('#navbarDropdown > span')).click() }, - { description: 'Wait action to complete', action: async () => await driver.sleep(2000) }, + { description: 'Wait for action to complete', action: async () => await driver.sleep(2000) }, //Log Out icon { @@ -299,6 +3788,18 @@ const steps = [ } }, + //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) => { @@ -346,6 +3847,8 @@ try { // 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(); @@ -359,17 +3862,18 @@ try { worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath); console.error(`Step ${stepIndex} FAILED: ${error.message}`); testStatus = 'Failed'; + allStepsPassed = false; } } //Check if login was successful const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); - if (loginButton) { - console.log('COMPLETED Script: frameworkManagementPage'); + if (loginButton & allStepsPassed) { + console.log('PASSED: Framework Management Page(ExACT_frameworkManagementPage); All test steps completed successfully'); testStatus = 'Passed'; } else { - console.log('FAILED: Unable to complete frameworkManagementPage script'); + console.log('FAILED: Framework Management Page(ExACT_frameworkManagementPage); One or more test steps failed'); testStatus = 'Failed'; }