diff --git a/frameworkManagementPageResults.xlsx b/frameworkManagementPageResults.xlsx index aa70ba3..7177fac 100644 Binary files a/frameworkManagementPageResults.xlsx and b/frameworkManagementPageResults.xlsx differ diff --git a/tests/frameworkManagementPage.js b/tests/frameworkManagementPage.js index 591c17b..8741dda 100644 --- a/tests/frameworkManagementPage.js +++ b/tests/frameworkManagementPage.js @@ -1,6 +1,6 @@ import { Builder, By, Key, until, Select, Browser } from 'selenium-webdriver'; import { Options as ChromeOptions } from 'selenium-webdriver/chrome.js'; -import fs from 'fs'; +import fs, { link } from 'fs'; import XLSX from 'xlsx'; import path from 'path'; @@ -35,6 +35,7 @@ const steps = [ description: 'Login', action: async () => { const multipleChecks = 'Log In'; + console.log('------------->| CORRELATION DASHBOARD |<-------------'); const errors = []; @@ -111,6 +112,7 @@ const steps = [ description: 'Dashboard title text, size, and color', action: async () => { const multipleChecks = 'Dashboard title'; + const element = await driver.findElement(By.css('.e-heading')); //Get text, font, size, and color @@ -170,6 +172,12 @@ const steps = [ await driver.findElement(By.linkText('Frameworks')).click(); console.log('----->| NEXT ACTION: Clicked Frameworks navigation link'); + //Wait for page readyState + await driver.wait(async () => { + const readyState = await driver.executeScript('return document.readyState'); + return readyState === 'complete'; + }, 30000, 'ExACT Dashboard did not fully load within 30 seconds'); + //Wait until the element exists in the DOM const pageTitle = await driver.wait( until.elementLocated(By.css('h2')), @@ -189,6 +197,7 @@ const steps = [ description: 'Framework Management page title text, size, and color', action: async () => { const multipleChecks = 'Framework Management page title'; + const element = await driver.findElement(By.css('h2')); //Get text, font, size, and color @@ -241,1308 +250,1677 @@ const steps = [ } }, - //Publishing button icon + //Publishing button { - description: 'Verify Publishing buttion icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.btn > .fa-cloud-upload')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Publishing button icon not found'); - } - console.log('Passed: Publishing button icon present'); - } - }, - - //Publishing button text - { - description: 'Validate Publishing button text', + description: 'Publishing button text, font, size, color, href, and button color', action: async () => { - const elementText = await driver.findElement(By.linkText('Publishing')).getText(); - if (elementText !== 'Publishing') { - throw new Error(`Expected: "Publishing" button text; Actual: "${elementText}"`); + const multipleChecks = 'Publishing button'; + + const elementIcon = await driver.findElement(By.css('.btn > .fa-cloud-upload')); + const element = await driver.findElement(By.linkText('Publishing')); + const expectedHref = 'https://correlation.edgate.com/exact/publish_frameworks.php'; + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Publishing button icon was displayed as expected'); + } else { + errors.push('Expected: Publishing button icon was not displayed'); + } + + //text + if (elementText === 'Publishing') { + console.log('Passed: Publishing button text matched as expected'); + } else { + errors.push(`Expected: "Publishing"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Publishing button text font matched as expected'); + } else { + errors.push(`Expected: Publishing button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '16px') { + console.log('Passed: Publishing button text font-size matched as expected'); + } else { + errors.push(`Expected: Publishing button text font-size "16px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Publishing button text color matched as expected'); + } else { + errors.push(`Expected: Publishing button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); + } + + //button color + if (elementButtonColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Publishing button background color matched as expected'); + } else { + errors.push(`Expected: Publishing button background color: "rgba(48, 200, 172, 1)"; Actual: "${elementButtonColor}"`); + } + + //href + const actualHref = await element.getAttribute('href'); + if (actualHref && actualHref === expectedHref) { + console.log('Passed: Publishing button href matched as expected'); + } else { + errors.push(`Expected: Publishing button href to be "${expectedHref}"; but found "${actualHref}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Publishging button text matched as expected'); } }, - //Publishing button color -green + //Import Framework button { - description: 'Validate Publishing button color', + description: 'Import Framework button text, font, size, color, href, and button color', action: async () => { - const elementStyle = await driver.findElement(By.linkText('Publishing')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Publishing button color did not match; Actual: "${elementStyle}"`); - } - console.log('Passed: Publishing button color matched as expected'); - } - }, -/* - //NEXT ACTION - Click Publishing button - { description: 'Click Publishing button', action: async () => await driver.findElement(By.linkText('Publishing')).click() }, + const multipleChecks = 'Import Framework button'; - //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'); + const elementIcon = await driver.findElement(By.css('.fa-upload')); + const element = await driver.findElement(By.linkText('Import Framework')); + const expectedHref = 'https://correlation.edgate.com/exact/import_framework_modal.php'; + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Import Framework button icon was displayed as expected'); + } else { + errors.push('Expected: Import Framework button icon was not displayed'); + } + + //text + if (elementText === 'Import Framework') { + console.log('Passed: Import Framework button text matched as expected'); + } else { + errors.push(`Expected: "Import Framework"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Import Framework button text font matched as expected'); + } else { + errors.push(`Expected: Import Framework button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '16px') { + console.log('Passed: Import Framework button text font-size matched as expected'); + } else { + errors.push(`Expected: Import Framework button text font-size "16px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Import Framework button text color matched as expected'); + } else { + errors.push(`Expected: Import Framework button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); + } + + //button color + if (elementButtonColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Import Framework button background color matched as expected'); + } else { + errors.push(`Expected: Import Framework button background color: "rgba(48, 200, 172, 1)"; Actual: "${elementButtonColor}"`); + } + + //href + const actualHref = await element.getAttribute('href'); + if (actualHref && actualHref === expectedHref) { + console.log('Passed: Import Framework button href matched as expected'); + } else { + errors.push(`Expected: Import Framework button href to be "${expectedHref}"; but found "${actualHref}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Publishing page loaded'); } }, - //Framework Publishing page title + //Create button { - description: 'Validate Framework Publishing page title', + description: 'Create button text, font, size, color, href, and button color', 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}"`); + const multipleChecks = 'Create button'; + + const elementIcon = await driver.findElement(By.css('.fa-plus-circle')); + const element = await driver.findElement(By.linkText('Create')); + const expectedHref = 'https://correlation.edgate.com/exact/org_add_modal.php'; + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Create button icon was displayed as expected'); + } else { + errors.push('Expected: Create button icon was not displayed'); } - 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', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-upload')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Import Framework button icon not found'); + //text + if (elementText === 'Create') { + console.log('Passed: Create button text matched as expected'); + } else { + errors.push(`Expected: "Create"; Actual: "${elementText}"`); } - console.log('Passed: Import Framework button icon present'); - } - }, - //Import Framework button text - { - description: 'Validate Import Framework button text', - action: async () => { - const elementText = await driver.findElement(By.linkText('Import Framework')).getText(); - if (elementText !== 'Import Framework') { - throw new Error(`Expected: "Import Framework" button text; Actual: "${elementText}"`); + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Create button text font matched as expected'); + } else { + errors.push(`Expected: Create button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); } - console.log('Passed: Import Framework button text matched as expected'); - } - }, - //Import Framework button color -green - { - description: 'Validate Import Framework button color', - action: async () => { - const elementStyle = await driver.findElement(By.linkText('Import Framework')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Import Framework button color did not match; Actual: "${elementStyle}"`); + //font size + if (elementTextSize === '16px') { + console.log('Passed: Create button text font-size matched as expected'); + } else { + errors.push(`Expected: Create button text font-size "16px"; Actual: "${elementTextSize}"`); } - console.log('Passed: Import Framework button color matched as expected'); - } - }, - //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'); + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Create button text color matched as expected'); + } else { + errors.push(`Expected: Create button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); } - 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}"`); + //button color + if (elementButtonColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Create button background color matched as expected'); + } else { + errors.push(`Expected: Create button background color: "rgba(48, 200, 172, 1)"; Actual: "${elementButtonColor}"`); } - 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}"`); + //href + const actualHref = await element.getAttribute('href'); + if (actualHref && actualHref === expectedHref) { + console.log('Passed: Create button href matched as expected'); + } else { + errors.push(`Expected: Create button href to be "${expectedHref}"; but found "${actualHref}"`); } - 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}"`); + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - 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', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-plus-circle')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Create button icon not found'); - } - console.log('Passed: Create button icon present'); - } - }, - - //Create button text - { - description: 'Validate Create button text', - action: async () => { - const elementText = await driver.findElement(By.linkText('Create')).getText(); - 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.linkText('Create')).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'); - } - }, - - //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 ROW //Search textbox { - description: 'Verify Search textbox is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#FilterOrganization')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Search textbox not found'); - } - console.log('Passed: Search textbox present'); - } - }, - - //Search textbox icon - { - description: 'Verify Search textbox icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-times')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Search textbox icon not found'); - } - console.log('Passed: Search textbox icon present'); - } - }, - - //Advanced Search button icon - { - description: 'Verify Advanced Search buttion icon is present', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('.fa-plus-circle')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Advanced Search button icon not found'); - } - console.log('Passed: Advanced Search button icon present'); - } - }, - - //Advanced Search button text - { - description: 'Validate Advanced Search button text', + description: 'Verify Search textbox', action: async () => { - const elementText = await driver.findElement(By.css('div:nth-child(4) > .btn')).getText(); - if (elementText !== 'Advanced Search') { - throw new Error(`Expected: "Advanced Search" button text; Actual: "${elementText}"`); + const multipleChecks = 'Search textbox'; + + const element = await driver.findElement(By.css('#FilterOrganization')); + const elementIcon = await driver.findElement(By.css('.fa-times')); + + //Track all errors + const errors = []; + + //textbox + if (element) { + console.log('Passed: Search textbox is present'); + } else { + errors.push('Expected: Search textbox not found'); + } + + //icon + if (elementIcon) { + console.log('Passed: Search textbox clear icon is present'); + } else { + errors.push('Expected: Search textbox clear icon not found'); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Advanced Search button text matched as expected'); } }, - //Advanced Search button color -green + //Advanced Search button { - description: 'Validate Advanced Search button color', + description: 'Advanced Search button text, font, size, color, and button color', action: async () => { - const elementStyle = await driver.findElement(By.css('div:nth-child(4) > .btn')).getCssValue('background-color'); - if (elementStyle !== 'rgba(48, 200, 172, 1)') { - throw new Error(`Advanced Search button color did not match; Actual: "${elementStyle}"`); + const multipleChecks = 'Advanced Search button'; + + const elementIcon = await driver.findElement(By.css('.btn > .fa-search')); + const element = await driver.findElement(By.css('div:nth-child(4) > .btn')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementButtonColor = await element.getCssValue('background-color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Advanced Search button icon was displayed as expected'); + } else { + errors.push('Expected: Advanced Search button icon was not displayed'); + } + + //text + if (elementText === 'Advanced Search') { + console.log('Passed: Advanced Search button text matched as expected'); + } else { + errors.push(`Expected: "Advanced Search"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Advanced Search button text font matched as expected'); + } else { + errors.push(`Expected: Advanced Search button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '16px') { + console.log('Passed: Advanced Search button text font-size matched as expected'); + } else { + errors.push(`Expected: Advanced Search button text font-size "16px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(255, 255, 255, 1)') { + console.log('Passed: Advanced Search button text color matched as expected'); + } else { + errors.push(`Expected: Advanced Search button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`); + } + + //button color + if (elementButtonColor === 'rgba(48, 200, 172, 1)') { + console.log('Passed: Advanced Search button background color matched as expected'); + } else { + errors.push(`Expected: Advanced Search button background color: "rgba(48, 200, 172, 1)"; Actual: "${elementButtonColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Advanced Search button color matched as expected'); } }, - //NEXT ACTION - Advanced Search button - { description: 'Click Advanced Search button', action: async () => await driver.findElement(By.css('div:nth-child(4) > .btn')).click() }, - - //Advanced Search DIV + //FRAMEWORK LIST + //Framework 4, 5, and 6 are hidden (Creating Org folder is collapsed) { - 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', + description: 'Organization 1 and Frameworks 1-3 visible; Frameworks 4-6 hidden', action: async () => { - const elementText = await driver.findElement(By.css('#exampleModalCenterTitle')).getText(); - if (elementText !== 'Advance Framework Search') { - throw new Error(`Expected: "Advance Framework Search" DIV title text; Actual: "${elementText}"`); + const multipleChecks = 'Framework list before search'; + + const visibleItems = [ + { name: 'Organization 1 folder icon', locator: By.css('#folder1279361494') }, + { name: 'Organization 1 title', locator: By.linkText('Creating Org') }, + { name: 'Framework 1 file icon', locator: By.css('.org:nth-child(2) > .fa') }, + { name: 'Framework 1 title', locator: By.linkText('ECS-2933 Testing On Prod') }, + { name: 'Framework 2 file icon', locator: By.css('.org:nth-child(3) > .fa') }, + { name: 'Framework 2 title', locator: By.linkText('Widget Test') }, + { name: 'Framework 3 file icon', locator: By.css('.list-group-item:nth-child(4) > .fa') }, + { name: 'Framework 3 title', locator: By.linkText('ecs31444') }, + ]; + + const hiddenItems = [ + { name: 'Framework 4 file icon', locator: By.css('.doc:nth-child(1) > .fa') }, + { name: 'Framework 4 title', locator: By.linkText('5th Grade Import ECS-2732') }, + { name: 'Framework 5 file icon', locator: By.css('.doc:nth-child(2) > .fa') }, + { name: 'Framework 5 title', locator: By.linkText('Imported Framework Updated') }, + { name: 'Framework 6 file icon', locator: By.css('.doc:nth-child(3) > .fa') }, + { name: 'Framework 6 title', locator: By.linkText('NewTicket') }, + ]; + + //Track all errors + const errors = []; + + //Visible = in the page and displayed + for (const item of visibleItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (isDisplayed) { + console.log(`Passed: ${item.name} was displayed as expected`); + } else { + errors.push(`Expected: ${item.name} was not displayed; Actual: hidden`); + } + } + + //Hidden = not in the page, or in the page but not displayed + for (const item of hiddenItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (!isDisplayed) { + console.log(`Passed: ${item.name} was hidden as expected`); + } else { + errors.push(`Expected: ${item.name} was not hidden; Actual: displayed`); + } + } + + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Advance Framework Search DIV title text matched as expected'); } }, - //X icon DIV color -red + //Organization 1 { - description: 'Validate X icon color', + description: 'Organization 1 folder icon, text, font, size, color and tooltip', 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}"`); + const multipleChecks = 'Organization 1 - Creating Org'; + + const elementIcon = await driver.findElement(By.css('#folder1279361494')); + const expectedClass = 'fa fa-folder mr-1 frame-icon'; + const element = await driver.findElement(By.linkText('Creating Org')); + + //Get button text, text font, text size, text color, and button color + const elementIconColor = await elementIcon.getCssValue('color'); + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementTooltip = await element.getAttribute('title'); + + //Track all errors + const errors = []; + + //image class + const actualClass = await elementIcon.getAttribute('class'); + if (actualClass && actualClass === expectedClass) { + console.log('Passed: Organization 1 folder icon class matched expected'); + } else { + errors.push(`Expected: Organization 1 folder icon class: "${expectedClass}"; but found "${actualClass}"`); + } + + //icon color + if (elementIconColor === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Organization 1 folder icon color matched as expected'); + } else { + errors.push(`Expected: Organization 1 folder icon color: "rgba(40, 39, 90, 1)"; Actual: "${elementIconColor}"`); + } + + //text + if (elementText === 'Creating Org') { + console.log('Passed: Organization 1 title text matched as expected'); + } else { + errors.push(`Expected: "Creating Org "; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Organization 1 title text font matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Organization 1 title text font-size matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Organization 1 title text color matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //tooltip + if (elementTooltip === 'Click to expand/collapse') { + console.log('Passed: Organization 1 title tooltip matched as expected'); + } else { + errors.push(`Expected: Organization 1 title tooltip: "Click to expand/collapse"; Actual: "${elementTooltip}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: DIV X icon color matched as expected'); } }, - //Search in handle + //Organization 1 edit icon on hover { - description: 'Validate Search in handle', + description: 'Organization 1 edit icon is displayed on hover', 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}"`); + const element = await driver.findElement(By.linkText('Creating Org')); + + //Edit (pencil) icon that belongs to the Creating Org row only + const editIcon = await driver.findElement(By.css('li[data-li="1279361494"] > .opts .fa-pencil-square-o')); + + //Hover over the Organization 1 title + await driver.actions({ async: true }).move({ origin: element }).perform(); + console.log('----->| NEXT ACTION: Hover over Creating Org title to display edit icon'); + + //Give the edit icon up to 5 seconds to appear + try { + await driver.wait(until.elementIsVisible(editIcon), 5000); + console.log('Passed: Organization 1 edit icon was displayed on hover as expected'); + } catch { + throw new Error('Expected: Organization 1 edit icon to be displayed on hover; Actual: Not displayed'); } - console.log('Passed: Search in handle text matched as expected'); } }, - //Search in dropdown text + //Framework 1 { - description: 'Validate Search in dropdown option', + description: 'Framework 1 file icon, text, font, size, and color', action: async () => { - const elementOption = await driver.findElement(By.css('#feild')).getAttribute('value'); - if (elementOption !== 'stdtext') { - throw new Error(`Expected: "Item Text"; Actual: "${elementOption}"`); + const multipleChecks = 'Framework 1 - ECS-2933 Testing On Prod'; + + const elementIcon = await driver.findElement(By.css('.org:nth-child(2) > .fa')); + const element = await driver.findElement(By.linkText('ECS-2933 Testing On Prod')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 1 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 1 file icon was not displayed'); + } + + //text + if (elementText === 'ECS-2933 Testing On Prod') { + console.log('Passed: Framework 1 title text matched as expected'); + } else { + errors.push(`Expected: "ECS-2933 Testing On Prod"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 1 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 1 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Framework 1 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 1 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 1 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 1 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Item Text dropdown option matched as expected'); } }, - //Search term textbox -placeholder + //Framework 2 { - description: 'Validate Search term textbox placeholder', + description: 'Framework 2 file icon, text, font, size, and color', 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}"`); + const multipleChecks = 'Framework 2 - Widget Test'; + + const elementIcon = await driver.findElement(By.css('.org:nth-child(3) > .fa')); + const element = await driver.findElement(By.linkText('Widget Test')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 2 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 2 file icon was not displayed'); + } + + //text + if (elementText === 'Widget Test') { + console.log('Passed: Framework 2 title text matched as expected'); + } else { + errors.push(`Expected: "Widget Test"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 2 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 2 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Framework 2 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 2 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 2 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 2 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Enter a search term textbox placeholder matched as expected'); } }, - //Match phrase checkbox + //Framework 3 { - 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 - { - description: 'Validate Match exact phrase label', + description: 'Framework 3 file icon, text, font, size, and color', action: async () => { - const elementText = await driver.findElement(By.css('.ml-2:nth-child(2)')).getText(); - if (elementText !== 'Match exact phrase') { - throw new Error(`Expected: "Match exact phrase" label; Actual: "${elementText}"`); + const multipleChecks = 'Framework 3 - ecs31444'; + + const elementIcon = await driver.findElement(By.css('.list-group-item:nth-child(4) > .fa')); + const element = await driver.findElement(By.linkText('ecs31444')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 3 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 3 file icon was not displayed'); + } + + //text + if (elementText === 'ecs31444') { + console.log('Passed: Framework 3 title text matched as expected'); + } else { + errors.push(`Expected: "ecs31444"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 3 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 3 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Framework 3 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 3 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 3 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 3 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Match exact phrase label matched as expected'); } }, - //Filter By text + //NEXT ACTION { - description: 'Validate Filter By text', + description: 'Search for hidden Framework title', 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}"`); + //Slow type so the list has time to filter after each keystroke + const filterInput = await driver.findElement(By.css('#FilterOrganization')); + for (const char of 'imported frame') { + await filterInput.sendKeys(char); + await driver.sleep(200); } - console.log('Passed: Filter By text matched as expected'); + console.log('----->| NEXT ACTION: Searched for "Imported Framework"'); + await driver.sleep(2000); + + //Wait until it becomes visible | Imported Framework Updated file icon + const fileIcon = await driver.wait(until.elementLocated(By.css('.doc:nth-child(2) > .fa')), 30000); + await driver.wait(until.elementIsVisible(fileIcon), 30000); } }, - //Framework label + //Search results - only Organization 1 and Framework 5 visible { - description: 'Validate Framework label', + description: 'Search results show only Organization 1 and Framework 5', 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}"`); + const multipleChecks = 'Search results for "imported frame"'; + + const visibleItems = [ + { name: 'Organization 1 folder icon', locator: By.css('#folder1279361494') }, + { name: 'Organization 1 title', locator: By.linkText('Creating Org') }, + { name: 'Framework 5 file icon', locator: By.css('.doc:nth-child(2) > .fa') }, + { name: 'Framework 5 title', locator: By.linkText('Imported Framework Updated') }, + ]; + + const hiddenItems = [ + { name: 'Framework 1 file icon', locator: By.css('.org:nth-child(2) > .fa') }, + { name: 'Framework 1 title', locator: By.linkText('ECS-2933 Testing On Prod') }, + { name: 'Framework 2 file icon', locator: By.css('.org:nth-child(3) > .fa') }, + { name: 'Framework 2 title', locator: By.linkText('Widget Test') }, + { name: 'Framework 3 file icon', locator: By.css('.list-group-item:nth-child(4) > .fa') }, + { name: 'Framework 3 title', locator: By.linkText('ecs31444') }, + { name: 'Framework 4 file icon', locator: By.css('.doc:nth-child(1) > .fa') }, + { name: 'Framework 4 title', locator: By.linkText('5th Grade Import ECS-2732') }, + { name: 'Framework 6 file icon', locator: By.css('.doc:nth-child(3) > .fa') }, + { name: 'Framework 6 title', locator: By.linkText('NewTicket') }, + ]; + + //Track all errors + const errors = []; + + //Visible = in the page and displayed + for (const item of visibleItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (isDisplayed) { + console.log(`Passed: ${item.name} was displayed as expected`); + } else { + errors.push(`Expected: ${item.name} was not displayed; Actual: hidden`); + } + } + + //Hidden = not in the page, or in the page but not displayed + for (const item of hiddenItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (!isDisplayed) { + console.log(`Passed: ${item.name} was hidden as expected`); + } else { + errors.push(`Expected: ${item.name} was not hidden; Actual: displayed`); + } + } + + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Framework label matched as expected'); } }, - - //Framework textbox -placeholder + + //Organization 1 { - description: 'Validate Framework textbox placeholder', + description: 'Organization 1 folder icon, text, font, size, color and tooltip', 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}"`); + const multipleChecks = 'Organization 1 - Creating Org'; + + const elementIcon = await driver.findElement(By.css('#folder1279361494')); + const expectedClass = 'fa mr-1 frame-icon fa-folder-open'; + const element = await driver.findElement(By.linkText('Creating Org')); + + //Get button text, text font, text size, text color, and button color + const elementIconColor = await elementIcon.getCssValue('color'); + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementTooltip = await element.getAttribute('title'); + + //Track all errors + const errors = []; + + //image class + const actualClass = await elementIcon.getAttribute('class'); + if (actualClass && actualClass === expectedClass) { + console.log('Passed: Organization 1 folder icon class matched expected'); + } else { + errors.push(`Expected: Organization 1 folder icon class: "${expectedClass}"; but found "${actualClass}"`); + } + + //icon color + if (elementIconColor === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Organization 1 folder icon color matched as expected'); + } else { + errors.push(`Expected: Organization 1 folder icon color: "rgba(40, 39, 90, 1)"; Actual: "${elementIconColor}"`); + } + + //text + if (elementText === 'Creating Org') { + console.log('Passed: Organization 1 title text matched as expected'); + } else { + errors.push(`Expected: "Creating Org "; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Organization 1 title text font matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Organization 1 title text font-size matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(0, 86, 179, 1)') { + console.log('Passed: Organization 1 title text color matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text color: "rgba(0, 86, 179, 1)"; Actual: "${elementTextColor}"`); + } + + //tooltip + if (elementTooltip === 'Click to expand/collapse') { + console.log('Passed: Organization 1 title tooltip matched as expected'); + } else { + errors.push(`Expected: Organization 1 title tooltip: "Click to expand/collapse"; Actual: "${elementTooltip}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Framework All Framework textbox placeholder matched as expected'); } }, - //Level label + //Framework 5 { - description: 'Validate Level label', + description: 'Framework 5 file icon, text, font, size, and color', 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}"`); + const multipleChecks = 'Framework 5 - Imported Framework Updated'; + + const elementIcon = await driver.findElement(By.css('.doc:nth-child(2) > .fa')); + const element = await driver.findElement(By.linkText('Imported Framework Updated')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 5 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 5 file icon was not displayed'); + } + + //text + if (elementText === 'Imported Framework Updated') { + console.log('Passed: Framework 5 title text matched as expected'); + } else { + errors.push(`Expected: "Imported Framework Updated"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 5 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 5 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '20.449px') { + console.log('Passed: Framework 5 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 5 title text font-size "20.449px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 5 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 5 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Level label matched as expected'); } }, - //Level textbox -value - { - description: 'Validate Level textbox value', + //NEXT ACTION + { + description: 'Click the Clear search icon', 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'); + await driver.findElement(By.css('.fa-times')).click(); + console.log('----->| NEXT ACTION: Clicked the Clear search icon'); + await driver.sleep(2000); + + //Wait until it becomes visible | ecs31444 file icon + const fileIcon = await driver.wait(until.elementLocated(By.css('.list-group-item:nth-child(4) > .fa')), 30000); + await driver.wait(until.elementIsVisible(fileIcon), 30000); } }, - //Subject label + //Framework 4, 5, and 6 hidden (Creating Org folder is collapsed) { - description: 'Validate Subject label', + description: 'Organization 1 and Frameworks 1-3 visible; Frameworks 4-6 hidden', 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}"`); + const multipleChecks = 'Framework list before search'; + + const visibleItems = [ + { name: 'Organization 1 folder icon', locator: By.css('#folder1279361494') }, + { name: 'Organization 1 title', locator: By.linkText('Creating Org') }, + { name: 'Framework 1 file icon', locator: By.css('.org:nth-child(2) > .fa') }, + { name: 'Framework 1 title', locator: By.linkText('ECS-2933 Testing On Prod') }, + { name: 'Framework 2 file icon', locator: By.css('.org:nth-child(3) > .fa') }, + { name: 'Framework 2 title', locator: By.linkText('Widget Test') }, + { name: 'Framework 3 file icon', locator: By.css('.list-group-item:nth-child(4) > .fa') }, + { name: 'Framework 3 title', locator: By.linkText('ecs31444') }, + ]; + + const hiddenItems = [ + { name: 'Framework 4 file icon', locator: By.css('.doc:nth-child(1) > .fa') }, + { name: 'Framework 4 title', locator: By.linkText('5th Grade Import ECS-2732') }, + { name: 'Framework 5 file icon', locator: By.css('.doc:nth-child(2) > .fa') }, + { name: 'Framework 5 title', locator: By.linkText('Imported Framework Updated') }, + { name: 'Framework 6 file icon', locator: By.css('.doc:nth-child(3) > .fa') }, + { name: 'Framework 6 title', locator: By.linkText('NewTicket') }, + ]; + + //Track all errors + const errors = []; + + //Visible = in the page and displayed + for (const item of visibleItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (isDisplayed) { + console.log(`Passed: ${item.name} was displayed as expected`); + } else { + errors.push(`Expected: ${item.name} was not displayed; Actual: hidden`); + } + } + + //Hidden = not in the page, or in the page but not displayed + for (const item of hiddenItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (!isDisplayed) { + console.log(`Passed: ${item.name} was hidden as expected`); + } else { + errors.push(`Expected: ${item.name} was not hidden; Actual: displayed`); + } + } + + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Subject label matched as expected'); } }, - //Subject textbox -placeholder + //NEXT ACTION { - description: 'Validate Subject textbox placeholder', + description: 'Click Creating Org link', 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'); + await driver.findElement(By.linkText('Creating Org')).click(); + console.log('----->| NEXT ACTION: Clicked Creating Org link'); + + //Wait for page readyState + await driver.wait(async () => { + const readyState = await driver.executeScript('return document.readyState'); + return readyState === 'complete'; + }, 30000, 'ExACT Dashboard did not fully load within 30 seconds'); + + //Wait until the element exists in the DOM + const frameworkFileIcon = await driver.wait( + until.elementLocated(By.css('.doc:nth-child(1) > .fa')), + 30000 + ); + + //Wait until it becomes visible + await driver.wait( + until.elementIsVisible(frameworkFileIcon), + 30000 + ); } }, - //Grade label + //Organization 1 and Frameworks 1-6 visible (Creating Org folder is expanded) { - description: 'Validate Grade label', + description: 'Organization 1 and Frameworks 1-6 visible', 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}"`); + const multipleChecks = 'Framework list with Creating Org expanded'; + + const visibleItems = [ + { name: 'Organization 1 folder icon', locator: By.css('#folder1279361494') }, + { name: 'Organization 1 title', locator: By.linkText('Creating Org') }, + { name: 'Framework 1 file icon', locator: By.css('.org:nth-child(2) > .fa') }, + { name: 'Framework 1 title', locator: By.linkText('ECS-2933 Testing On Prod') }, + { name: 'Framework 2 file icon', locator: By.css('.org:nth-child(3) > .fa') }, + { name: 'Framework 2 title', locator: By.linkText('Widget Test') }, + { name: 'Framework 3 file icon', locator: By.css('.list-group-item:nth-child(4) > .fa') }, + { name: 'Framework 3 title', locator: By.linkText('ecs31444') }, + { name: 'Framework 4 file icon', locator: By.css('.doc:nth-child(1) > .fa') }, + { name: 'Framework 4 title', locator: By.linkText('5th Grade Import ECS-2732') }, + { name: 'Framework 5 file icon', locator: By.css('.doc:nth-child(2) > .fa') }, + { name: 'Framework 5 title', locator: By.linkText('Imported Framework Updated') }, + { name: 'Framework 6 file icon', locator: By.css('.doc:nth-child(3) > .fa') }, + { name: 'Framework 6 title', locator: By.linkText('NewTicket') }, + ]; + + //Track all errors + const errors = []; + + //Visible = in the page and displayed + for (const item of visibleItems) { + const matches = await driver.findElements(item.locator); + const isDisplayed = matches.length > 0 && await matches[0].isDisplayed(); + + if (isDisplayed) { + console.log(`Passed: ${item.name} was displayed as expected`); + } else { + errors.push(`Expected: ${item.name} was not displayed; Actual: hidden`); + } + } + + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Grade label matched as expected'); } }, - //Grade textbox -placeholder + //Organization 1 { - description: 'Validate Grade textbox placeholder', + description: 'Organization 1 folder icon, text, font, size, color and tooltip', 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}"`); + const multipleChecks = 'Organization 1 - Creating Org'; + + const elementIcon = await driver.findElement(By.css('#folder1279361494')); + const expectedClass = 'fa mr-1 frame-icon fa-folder-open'; + const element = await driver.findElement(By.linkText('Creating Org')); + + //Get button text, text font, text size, text color, and button color + const elementIconColor = await elementIcon.getCssValue('color'); + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + const elementTooltip = await element.getAttribute('title'); + + //Track all errors + const errors = []; + + //image class + const actualClass = await elementIcon.getAttribute('class'); + if (actualClass && actualClass === expectedClass) { + console.log('Passed: Organization 1 folder icon class matched expected'); + } else { + errors.push(`Expected: Organization 1 folder icon class: "${expectedClass}"; but found "${actualClass}"`); + } + + //icon color + if (elementIconColor === 'rgba(40, 39, 90, 1)') { + console.log('Passed: Organization 1 folder icon color matched as expected'); + } else { + errors.push(`Expected: Organization 1 folder icon color: "rgba(40, 39, 90, 1)"; Actual: "${elementIconColor}"`); + } + + //text + if (elementText === 'Creating Org') { + console.log('Passed: Organization 1 title text matched as expected'); + } else { + errors.push(`Expected: "Creating Org "; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Organization 1 title text font matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Organization 1 title text font-size matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(0, 86, 179, 1)') { + console.log('Passed: Organization 1 title text color matched as expected'); + } else { + errors.push(`Expected: Organization 1 title text color: "rgba(0, 86, 179, 1)"; Actual: "${elementTextColor}"`); + } + + //tooltip + if (elementTooltip === 'Click to expand/collapse') { + console.log('Passed: Organization 1 title tooltip matched as expected'); + } else { + errors.push(`Expected: Organization 1 title tooltip: "Click to expand/collapse"; Actual: "${elementTooltip}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Grade All Grade textbox placeholder matched as expected'); } }, - //Close button text + //Framework 4 { - description: 'Validate Close button text', + description: 'Framework 4 file icon, text, font, size, and color', 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}"`); + const multipleChecks = 'Framework 4 - 5th Grade Import ECS-2732'; + + const elementIcon = await driver.findElement(By.css('.doc:nth-child(1) > .fa')); + const element = await driver.findElement(By.linkText('5th Grade Import ECS-2732')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 4 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 4 file icon was not displayed'); + } + + //text + if (elementText === '5th Grade Import ECS-2732') { + console.log('Passed: Framework 4 title text matched as expected'); + } else { + errors.push(`Expected: "5th Grade Import ECS-2732"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 4 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 4 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '20.449px') { + console.log('Passed: Framework 4 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 4 title text font-size "20.449px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 4 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 4 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Close button text matched as expected'); } }, - //Close button color -white + //Framework 5 { - description: 'Validate Close button color', + description: 'Framework 5 file icon, text, font, size, and 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}"`); + const multipleChecks = 'Framework 5 - Imported Framework Updated'; + + const elementIcon = await driver.findElement(By.css('.doc:nth-child(2) > .fa')); + const element = await driver.findElement(By.linkText('Imported Framework Updated')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 5 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 5 file icon was not displayed'); + } + + //text + if (elementText === 'Imported Framework Updated') { + console.log('Passed: Framework 5 title text matched as expected'); + } else { + errors.push(`Expected: "Imported Framework Updated"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 5 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 5 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '20.449px') { + console.log('Passed: Framework 5 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 5 title text font-size "20.449px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 5 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 5 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Close button color matched as expected'); } }, - //Submit button text + //Framework 6 { - description: 'Validate Submit button text', + description: 'Framework 6 file icon, text, font, size, and color', 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}"`); + const multipleChecks = 'Framework 6 - NewTicket'; + + const elementIcon = await driver.findElement(By.css('.doc:nth-child(3) > .fa')); + const element = await driver.findElement(By.linkText('NewTicket')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 6 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 6 file icon was not displayed'); + } + + //text + if (elementText === 'NewTicket') { + console.log('Passed: Framework 6 title text matched as expected'); + } else { + errors.push(`Expected: "NewTicket"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 6 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 6 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '20.449px') { + console.log('Passed: Framework 6 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 6 title text font-size "20.449px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 6 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 6 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Submit button text matched as expected'); } }, - //Submit button color -green + //Framework 1 { - description: 'Validate Submit button color', + description: 'Framework 1 file icon, text, font, size, and 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}"`); + const multipleChecks = 'Framework 1 - ECS-2933 Testing On Prod'; + + const elementIcon = await driver.findElement(By.css('.org:nth-child(2) > .fa')); + const element = await driver.findElement(By.linkText('ECS-2933 Testing On Prod')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 1 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 1 file icon was not displayed'); + } + + //text + if (elementText === 'ECS-2933 Testing On Prod') { + console.log('Passed: Framework 1 title text matched as expected'); + } else { + errors.push(`Expected: "ECS-2933 Testing On Prod"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 1 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 1 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Framework 1 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 1 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 1 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 1 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - 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 + //Framework 2 { - 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', + description: 'Framework 2 file icon, text, font, size, and color', 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}"`); + const multipleChecks = 'Framework 2 - Widget Test'; + + const elementIcon = await driver.findElement(By.css('.org:nth-child(3) > .fa')); + const element = await driver.findElement(By.linkText('Widget Test')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 2 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 2 file icon was not displayed'); + } + + //text + if (elementText === 'Widget Test') { + console.log('Passed: Framework 2 title text matched as expected'); + } else { + errors.push(`Expected: "Widget Test"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 2 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 2 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Framework 2 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 2 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 2 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 2 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: 5th Grade Import ECS-2732 title text matched as expected'); } }, - //Folder icon 1 + //Framework 3 { - 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', + description: 'Framework 3 file icon, text, font, size, and color', 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}"`); + const multipleChecks = 'Framework 3 - ecs31444'; + + const elementIcon = await driver.findElement(By.css('.list-group-item:nth-child(4) > .fa')); + const element = await driver.findElement(By.linkText('ecs31444')); + + //Get button text, text font, text size, text color, and button color + const elementText = await element.getText(''); + const elementTextFont = await element.getCssValue('font-family'); + const elementTextSize = await element.getCssValue('font-size'); + const elementTextColor = await element.getCssValue('color'); + + //Track all errors + const errors = []; + + //icon present + if (await elementIcon.isDisplayed()) { + console.log('Passed: Framework 3 file icon was displayed as expected'); + } else { + errors.push('Expected: Framework 3 file icon was not displayed'); + } + + //text + if (elementText === 'ecs31444') { + console.log('Passed: Framework 3 title text matched as expected'); + } else { + errors.push(`Expected: "ecs31444"; Actual: "${elementText}"`); + } + + //font-family + if (elementTextFont === "Poppins, sans-serif") { + console.log('Passed: Framework 3 title text font matched as expected'); + } else { + errors.push(`Expected: Framework 3 title text font "Poppins, sans-serif"; Actual: ${elementTextFont}`); + } + + //font size + if (elementTextSize === '18.59px') { + console.log('Passed: Framework 3 title text font-size matched as expected'); + } else { + errors.push(`Expected: Framework 3 title text font-size "18.59px"; Actual: "${elementTextSize}"`); + } + + //color + if (elementTextColor === 'rgba(73, 80, 87, 1)') { + console.log('Passed: Framework 3 title text color matched as expected'); + } else { + errors.push(`Expected: Framework 3 title text color: "rgba(73, 80, 87, 1)"; Actual: "${elementTextColor}"`); + } + + //Throw summary if any validation failed + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - console.log('Passed: Adding a New Org to test with title text matched as expected'); } }, - //Folder icon 2 + //Framework 5 option icons on hover { - 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', + description: 'Framework 5 option icons are displayed on hover', 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}"`); + //Imported Framework Updated row (id 1279361500) inside the Creating Org folder + const row = await driver.findElement(By.xpath('//ul[@id="org-1279361494"]/li[.//a[contains(@href, "id=1279361500")]]')); + const optionsArea = await row.findElement(By.css('.opts')); + + //Option icons, identified by the page each one opens + const optionIcons = [ + { name: 'Publish Framework icon', href: 'framework_publish_modal.php', expectedTitle: 'Publish Framework' }, + { name: 'View Framework icon', href: 'viewframework.php' }, + { name: 'Download This Framework icon', href: 'export_framework_modal.php', expectedTitle: 'Download This Framework' }, + { name: 'Framework View icon', href: 'framework_view_modal.php' }, + { name: 'Edit icon', href: 'org_edit_modal.php' }, + ]; + + //Hover over the Framework 5 row + await driver.actions({ async: true }).move({ origin: row }).perform(); + console.log('----->| NEXT ACTION: Hover over Imported Framework Updated title to display edit icon'); + + //Track all errors + const errors = []; + + //Give each icon up to 5 seconds to appear + for (const icon of optionIcons) { + const matches = await optionsArea.findElements(By.css(`a[href*="${icon.href}"] .fa`)); + + if (matches.length === 0) { + errors.push(`Expected: Framework 5 ${icon.name} to exist; Actual: not found`); + continue; + } + + try { + await driver.wait(until.elementIsVisible(matches[0]), 5000); + console.log(`Passed: Framework 5 ${icon.name} was displayed on hover as expected`); + } catch { + errors.push(`Expected: Framework 5 ${icon.name} to be displayed on hover; Actual: not displayed`); + } + + //Title (tooltip) is on the icon's link + if (icon.expectedTitle) { + const iconLink = await optionsArea.findElement(By.css(`a[href*="${icon.href}"]`)); + const iconTitle = await iconLink.getAttribute('title'); + + if (iconTitle === icon.expectedTitle) { + console.log(`Passed: Framework 5 ${icon.name} title matched as expected`); + } else { + errors.push(`Expected: Framework 5 ${icon.name} title: "${icon.expectedTitle}"; Actual: "${iconTitle}"`); + } + } + } + + if (errors.length > 0) { + //Add summary line only when multiple checks failed + if (errors.length > 1) { + errors.unshift('Framework 5 option icons on hover - Multiple validation checks did not pass'); + } + + //Throw collected messages — catch() will prefix with "FAILED:" + throw new Error(errors.join('\n')); } - 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 { @@ -1614,1525 +1992,7 @@ const steps = [ } }, - //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 is present - { - description: 'Validate Asterisk icons', - action: async () => - { const expectedIcon = await driver.wait(until.elementLocated(By.css('#divcreator')), 5000).catch(() => false); - if (!expectedIcon) { - throw new Error('Asterisk icon is not present'); - } - console.log('Passed: Asterisk icon is present'); - } - }, - - //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: Publish 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 value { description: 'Validate Type value', @@ -3168,17 +2028,7 @@ const steps = [ } }, - //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 value { @@ -3215,41 +2065,7 @@ const steps = [ } }, - //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 value - { - description: 'Validate Source URL value', - 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 valuen text; Actual: "${elementText}"`); - } - console.log('Passed: https://www.espn.com source URL value 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 value { @@ -3286,17 +2102,7 @@ const steps = [ } }, - //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 value { @@ -3333,17 +2139,7 @@ const steps = [ } }, - //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 value { @@ -3380,17 +2176,7 @@ const steps = [ } }, - //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 value { @@ -3427,18 +2213,7 @@ const steps = [ } }, - //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 value { description: 'Validate Status value', @@ -3474,17 +2249,7 @@ const steps = [ } }, - //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 value { @@ -3521,17 +2286,7 @@ const steps = [ } }, - //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 value { @@ -3568,17 +2323,7 @@ const steps = [ } }, - //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 value { @@ -3615,17 +2360,7 @@ const steps = [ } }, - //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 value { @@ -3662,17 +2397,7 @@ const steps = [ } }, - //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 value { @@ -3709,17 +2434,7 @@ const steps = [ } }, - //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 value { @@ -3756,77 +2471,7 @@ const steps = [ } }, - //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', @@ -3862,381 +2507,6 @@ const steps = [ } }, - //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 @@ -4326,6 +2596,8 @@ try { let allStepsPassed = true; + const failedSteps = []; //Track failed steps + for (const step of steps) { const stepIndex = steps.indexOf(step) + 1; const timestamp = new Date().toISOString(); @@ -4362,19 +2634,24 @@ try { ); console.error(`Step ${stepIndex} FAILED: ${error.message}`); + failedSteps.push(`Step ${stepIndex}: ${step.description} - ${error.message}`); //Track failed step testStatus = 'Failed'; allStepsPassed = false; } } //Check if log out was successful - const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); + //const loginButton = await driver.wait(until.elementLocated(By.css('.login')), 5000).catch(() => false); - if (loginButton && allStepsPassed) { + if (allStepsPassed) { + console.log('------------->| THE END |<-------------'); console.log('PASSED: Framework Management Page(frameworkManagementPage); All test steps completed successfully'); testStatus = 'Passed'; } else { + console.log('------------->| THE END |<-------------'); console.log('FAILED: Framework Management Page(frameworkManagementPage); One or more test steps failed'); + console.log('FAILED STEPS:'); + failedSteps.forEach(step => console.error(` ✗ ${step}`)); testStatus = 'Failed'; } @@ -4388,7 +2665,7 @@ try { } finally { await driver.quit(); } -})(); + })(); } export default frameworkManagementPage;