Updated scripts
This commit is contained in:
@@ -2,7 +2,6 @@ import { Builder, By, Key, until } from 'selenium-webdriver';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import XLSX from 'xlsx';
|
import XLSX from 'xlsx';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { assert } from 'console';
|
|
||||||
|
|
||||||
const ExACT_dashboardMyContent = (req, res) => {
|
const ExACT_dashboardMyContent = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Dashboard - My Content: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Dashboard - My Content: Initiated</h2>');
|
||||||
@@ -15,41 +14,28 @@ const ExACT_dashboardMyContent = (req, res) => {
|
|||||||
|
|
||||||
//Page title
|
//Page title
|
||||||
const expectedDashboardTitle = 'Correlation Dashboard';
|
const expectedDashboardTitle = 'Correlation Dashboard';
|
||||||
const expectedDashboardTitleColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedDashboardTitleFont = '32px';
|
|
||||||
//My Content widget
|
//My Content widget
|
||||||
const expectedMyContentWidgetTitle = 'My Content';
|
const expectedMyContentWidgetTitle = 'My Content';
|
||||||
const expectedWidgetTitleColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedWidgetTitleFont = '18px';
|
|
||||||
//Ellipsis
|
//Ellipsis
|
||||||
const expectedEllipsisIconColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
//Create Content
|
//Create Content
|
||||||
const expectedCreateContentSetIconColor = 'rgba(33, 37, 41, 1)'; //navy blue (different?)
|
|
||||||
const expectedCreateContentSetLinkText = 'Create Content Set';
|
const expectedCreateContentSetLinkText = 'Create Content Set';
|
||||||
const expectedCreateContentSetLinkTextColor = 'rgba(33, 37, 41, 1)'; //navy blue (different?)
|
|
||||||
//Export Content
|
//Export Content
|
||||||
const expectedExportContentSetIconColor = 'rgba(33, 37, 41, 1)'; //navy blue (different?)
|
|
||||||
const expectedExportContentSetLinkText = 'Export Content Set';
|
const expectedExportContentSetLinkText = 'Export Content Set';
|
||||||
const expectedExportContentSetLinkTextColor = 'rgba(33, 37, 41, 1)'; //navy blue (different?)
|
|
||||||
//Filter
|
//Filter
|
||||||
const expectedSearchIconColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedFilterPlaceholder = 'filter...';
|
const expectedFilterPlaceholder = 'filter...';
|
||||||
//Sort
|
//Sort
|
||||||
const expectedSortLabel = 'Sort:';
|
const expectedSortLabel = 'Sort:';
|
||||||
const expectedSortDropDown = 'count';
|
const expectedSortDropDown = 'count';
|
||||||
//Content
|
//Content
|
||||||
const expectedBiologyQA = 'Biology - QA';
|
const expectedBiologyQALink = 'Biology - QA';
|
||||||
const expectedBiologyQACount = '1046';
|
const expectedBiologyQACountLink = '1046';
|
||||||
//Edit Content Set
|
//Edit Content Set DIV
|
||||||
const expectedEditDIVTitle = 'Edit Content Set';
|
|
||||||
const expectedEditDIVLabel = 'Content Set Name';
|
const expectedEditDIVLabel = 'Content Set Name';
|
||||||
const expectedEditDIVTextbox = 'Biology - QA';
|
const expectedEditDIVTextbox = 'Biology - QA';
|
||||||
|
const expectedCreatedDIVTextbox = 'Automated Content Set - To be deleted'
|
||||||
const expectedEditDIVDeleteBtn = 'Delete';
|
const expectedEditDIVDeleteBtn = 'Delete';
|
||||||
const expectedEditDIVDeleteBtnColor = 'rgba(220, 53, 69, 1)'; //red
|
|
||||||
const expectedEditDIVSaveBtn = 'Save';
|
const expectedEditDIVSaveBtn = 'Save';
|
||||||
const expectedEditDIVSaveBtnColor = 'rgba(48, 200, 172, 1)'; //gren
|
|
||||||
const expectedEditDIVCloseBtn = 'Close';
|
const expectedEditDIVCloseBtn = 'Close';
|
||||||
const expectedEditDIVCloseBtnColor = 'rgba(0, 0, 0, 0)'; //white
|
|
||||||
|
|
||||||
const steps = [
|
const steps = [
|
||||||
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php
|
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php
|
||||||
@@ -73,13 +59,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Dashboard title text color
|
//Dashboard title text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate dashboard title text color',
|
description: 'Validate dashboard title text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.e-heading')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.e-heading')).getCssValue('color');
|
||||||
if (elementStyle !== expectedDashboardTitleColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Dashboard title text color Expected: "${expectedDashboardTitleColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Dashboard title text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Dashboard title text color matched as expected');
|
console.log('Passed: Dashboard title text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -90,8 +76,8 @@ const steps = [
|
|||||||
description: 'Validate dashboard title text font size',
|
description: 'Validate dashboard title text font size',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.e-heading')).getCssValue('font-size');
|
const elementStyle = await driver.findElement(By.css('.e-heading')).getCssValue('font-size');
|
||||||
if (elementStyle !== expectedDashboardTitleFont) {
|
if (elementStyle !== '32px') {
|
||||||
throw new Error(`Expected: "${expectedDashboardTitleFont}"; Actual: "${elementStyle}"`);
|
throw new Error(`Dashboard title text fond-size did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Dashboard title text font-size matched as expected');
|
console.log('Passed: Dashboard title text font-size matched as expected');
|
||||||
}
|
}
|
||||||
@@ -109,13 +95,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Widget title text color
|
//Widget title text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate widget title text color',
|
description: 'Validate widget title text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getCssValue('color');
|
||||||
if (elementStyle !== expectedWidgetTitleColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Widget title text color Expected: "${expectedWidgetTitleColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Widget title text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Widget title text color matched as expected');
|
console.log('Passed: Widget title text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -126,32 +112,32 @@ const steps = [
|
|||||||
description: 'Validate widget title text font size',
|
description: 'Validate widget title text font size',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getCssValue('font-size');
|
const elementStyle = await driver.findElement(By.css('.h-100 h2:nth-child(2)')).getCssValue('font-size');
|
||||||
if (elementStyle !== expectedWidgetTitleFont) {
|
if (elementStyle !== '18px') {
|
||||||
throw new Error(`Expected: "${expectedWidgetTitleFont}"; Actual: "${elementStyle}"`);
|
throw new Error(`Widget title text font-size did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Widget title text font-size matched as expected');
|
console.log('Passed: Widget title text font-size matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Ellipsis icon color
|
//Ellipsis icon color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate ellipsis icon color',
|
description: 'Validate ellipsis icon color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.fa-ellipsis-h')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.fa-ellipsis-h')).getCssValue('color');
|
||||||
if (elementStyle !== expectedEllipsisIconColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Ellipsis icon color Expected: "${expectedEllipsisIconColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Ellipsis icon color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Ellipsis icon color matched as expected');
|
console.log('Passed: Ellipsis icon color matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Search icon color
|
//Search icon color -dark blue
|
||||||
{
|
{
|
||||||
description: 'Validate search icon color',
|
description: 'Validate search icon color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.col-12 > .fa')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.col-12 > .fa')).getCssValue('color');
|
||||||
if (elementStyle !== expectedSearchIconColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Search icon color Expected: "${expectedSearchIconColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Search icon color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Search icon color matched as expected');
|
console.log('Passed: Search icon color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -198,8 +184,8 @@ const steps = [
|
|||||||
description: 'Validate Biology-QA title',
|
description: 'Validate Biology-QA title',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.linkText('Biology - QA')).getText();
|
const elementText = await driver.findElement(By.linkText('Biology - QA')).getText();
|
||||||
if (elementText !== expectedBiologyQA) {
|
if (elementText !== expectedBiologyQALink) {
|
||||||
throw new Error(`Expected: "${expectedBiologyQA}"; Actual: "${elementText}"`);
|
throw new Error(`Expected: "${expectedBiologyQALink}"; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Biology-QA title matched as expected');
|
console.log('Passed: Biology-QA title matched as expected');
|
||||||
}
|
}
|
||||||
@@ -222,8 +208,8 @@ const steps = [
|
|||||||
description: 'Validate Biology-QA count',
|
description: 'Validate Biology-QA count',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .badge')).getText();
|
const elementText = await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .badge')).getText();
|
||||||
if (elementText !== expectedBiologyQACount) {
|
if (elementText !== expectedBiologyQACountLink) {
|
||||||
throw new Error(`Expected: "${expectedBiologyQACount}"; Actual: "${elementText}"`);
|
throw new Error(`Expected: "${expectedBiologyQACountLink}"; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Biology-QA count matched as expected');
|
console.log('Passed: Biology-QA count matched as expected');
|
||||||
}
|
}
|
||||||
@@ -231,15 +217,22 @@ const steps = [
|
|||||||
|
|
||||||
//Add Content Set
|
//Add Content Set
|
||||||
{ description: 'Click Biology-QA edit icon', action: async () => await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .fa')).click() },
|
{ description: 'Click Biology-QA edit icon', action: async () => await driver.findElement(By.css('#mycontentlist > #content-org-list > .content-org .fa')).click() },
|
||||||
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
|
|
||||||
|
//Wait for DIV
|
||||||
|
{
|
||||||
|
description: 'Wait for DIV to open',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.modal-content .modal-title')), 50000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//Edit Content Set DIV
|
//Edit Content Set DIV
|
||||||
{
|
{
|
||||||
description: 'Validate edit DIV title',
|
description: 'Validate edit DIV title',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementText = await driver.findElement(By.css('.modal-title')).getText();
|
const elementText = await driver.findElement(By.css('.modal-content .modal-title')).getText();
|
||||||
if (elementText !== expectedEditDIVTitle) {
|
if (elementText !== 'Edit Content Set') {
|
||||||
throw new Error(`Expected: "${expectedEditDIVTitle}"; Actual: "${elementText}"`);
|
throw new Error(`Edit DIV title did not match; Actual: "${elementText}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Edit DIV title matched as expected');
|
console.log('Passed: Edit DIV title matched as expected');
|
||||||
}
|
}
|
||||||
@@ -281,13 +274,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Edit Content Set DIV - Delete button color
|
//Edit Content Set DIV - Delete button color -red
|
||||||
{
|
{
|
||||||
description: 'Validate edit DIV delete button color',
|
description: 'Validate edit DIV delete button color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('#orgdelete')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('#orgdelete')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedEditDIVDeleteBtnColor) {
|
if (elementStyle !== 'rgba(220, 53, 69, 1)') {
|
||||||
throw new Error(`Edit DIV delete button color Expected: "${expectedEditDIVDeleteBtnColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Edit DIV delete button color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Edit DIV delete button color matched as expected');
|
console.log('Passed: Edit DIV delete button color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -305,13 +298,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Edit Content Set DIV - Save button color
|
//Edit Content Set DIV - Save button color -green
|
||||||
{
|
{
|
||||||
description: 'Validate edit DIV save button color',
|
description: 'Validate edit DIV save button color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('#modalop')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('#modalop')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedEditDIVSaveBtnColor) {
|
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
|
||||||
throw new Error(`Edit DIV save button color Expected: "${expectedEditDIVSaveBtnColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Edit DIV save button color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Edit DIV save button color matched as expected');
|
console.log('Passed: Edit DIV save button color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -329,13 +322,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Edit Content Set DIV - Close button color
|
//Edit Content Set DIV - Close button color -white
|
||||||
{
|
{
|
||||||
description: 'Validate edit DIV close button color',
|
description: 'Validate edit DIV close button color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('#modalclose')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('#modalclose')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedEditDIVCloseBtnColor) {
|
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
|
||||||
throw new Error(`Edit DIV close button color Expected: "${expectedEditDIVCloseBtnColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Edit DIV close button color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Edit DIV close button color matched as expected');
|
console.log('Passed: Edit DIV close button color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -348,13 +341,13 @@ const steps = [
|
|||||||
{ description: 'Click ellipsis icon', action: async () => await driver.findElement(By.css('.fa-ellipsis-h')).click() },
|
{ description: 'Click ellipsis icon', action: async () => await driver.findElement(By.css('.fa-ellipsis-h')).click() },
|
||||||
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
|
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
//Create Content Set icon color
|
//Create Content Set icon color -dark blue
|
||||||
{
|
{
|
||||||
description: 'Validate create content set icon color',
|
description: 'Validate create content set icon color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.fa-plus')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.fa-plus')).getCssValue('color');
|
||||||
if (elementStyle !== expectedCreateContentSetIconColor) {
|
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
|
||||||
throw new Error(`Create Content Set icon color Expected: "${expectedCreateContentSetIconColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Create Content Set icon color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Create Content Set icon color matched as expected');
|
console.log('Passed: Create Content Set icon color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -372,25 +365,25 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Create Content Set link text color
|
//Create Content Set link text color -dark blue
|
||||||
{
|
{
|
||||||
description: 'Validate create content set link text color',
|
description: 'Validate create content set link text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.linkText('Create Content Set')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.linkText('Create Content Set')).getCssValue('color');
|
||||||
if (elementStyle !== expectedCreateContentSetLinkTextColor) {
|
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
|
||||||
throw new Error(`Create Content Set link text color Expected: "${expectedCreateContentSetLinkTextColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Create Content Set link text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Create Content Set link text color matched as expected');
|
console.log('Passed: Create Content Set link text color matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Export Content Set icon color
|
//Export Content Set icon color -dark blue
|
||||||
{
|
{
|
||||||
description: 'Validate export content set icon color',
|
description: 'Validate export content set icon color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.fa-download')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.fa-download')).getCssValue('color');
|
||||||
if (elementStyle !== expectedExportContentSetIconColor) {
|
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
|
||||||
throw new Error(`Export Content icon color Expected: "${expectedExportContentSetIconColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Export Content icon color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Export Content icon color matched as expected');
|
console.log('Passed: Export Content icon color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -408,17 +401,155 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Export Content Set link text color
|
//Export Content Set link text color -dark blue
|
||||||
{
|
{
|
||||||
description: 'Validate export content set link text color',
|
description: 'Validate export content set link text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.linkText('Export Content Set')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.linkText('Export Content Set')).getCssValue('color');
|
||||||
if (elementStyle !== expectedExportContentSetLinkTextColor) {
|
if (elementStyle !== 'rgba(33, 37, 41, 1)') {
|
||||||
throw new Error(`Export Content Set icon color Expected: "${expectedExportContentSetLinkTextColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Export Content Set icon color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Export Content Set icon color matched as expected');
|
console.log('Passed: Export Content Set icon color matched as expected');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//Create Content Set
|
||||||
|
{ description: 'Click ellipsis icon', action: async () => await driver.findElement(By.linkText('Create Content Set')).click() },
|
||||||
|
|
||||||
|
//Wait for DIV
|
||||||
|
{
|
||||||
|
description: 'Wait for DIV to open',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.modal-content .modal-title')), 50000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Create Content Set DIV
|
||||||
|
{
|
||||||
|
description: 'Validate create content set DIV title',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.modal-content .modal-title')).getText();
|
||||||
|
if (elementText !== 'Create Content Set') {
|
||||||
|
throw new Error(`Content set DIV title did not match; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Create content set DIV title matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Create Content Set DIV - label
|
||||||
|
{
|
||||||
|
description: 'Validate create DIV label',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.form-label')).getText();
|
||||||
|
if (elementText !== expectedEditDIVLabel) {
|
||||||
|
throw new Error(`Expected: "${expectedEditDIVLabel}"; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Create DIV label matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Enter Content Set Name
|
||||||
|
{ description: 'Enter content set name', action: async () => await driver.findElement(By.css('#orgname')).sendKeys('Automated Content Set - To be deleted') },
|
||||||
|
{ description: 'Click create button', action: async () => await driver.findElement(By.css('#modalop')).click() },
|
||||||
|
//{ description: 'Driver sleep', action: async () => await driver.sleep(5000) },
|
||||||
|
|
||||||
|
//Wait for confirmation message
|
||||||
|
{
|
||||||
|
description: 'Wait for DIV to open',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('strong:nth-child(1)')), 50000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Validate confirmation message
|
||||||
|
{
|
||||||
|
description: 'Validate confirmation message',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('strong:nth-child(1)')).getText();
|
||||||
|
if (elementText !== 'The content set was successfuly created') {
|
||||||
|
throw new Error(`Expected confirmation message did not match; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Confirmation message displayed as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Validate confirmation message background color -green
|
||||||
|
{
|
||||||
|
description: 'Validate confirmation message background color',
|
||||||
|
action: async () => {
|
||||||
|
const elementStyle = await driver.findElement(By.css('#statalert')).getCssValue('background-color');
|
||||||
|
if (elementStyle !== 'rgba(40, 167, 69, 1)') {
|
||||||
|
throw new Error(`Confirmation message background color did not match; Actual: "${elementStyle}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Confirmation background color matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Validate created content set
|
||||||
|
{
|
||||||
|
description: 'Verify created automated content set',
|
||||||
|
action: async () => {
|
||||||
|
const expectedCreatedContentSet = await driver.wait(until.elementLocated(By.linkText('Automated Content Set - To be deleted')), 5000).catch(() => false);
|
||||||
|
if (!expectedCreatedContentSet) {
|
||||||
|
throw new Error('Automated created content set not found');
|
||||||
|
}
|
||||||
|
console.log('Passed: Automated content set present');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Click created content set
|
||||||
|
{ description: 'Click created content set edit icon', action: async () => await driver.findElement(By.css('#content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list > #content-org-list .fa')).click() },
|
||||||
|
|
||||||
|
//Wait for DIV
|
||||||
|
{
|
||||||
|
description: 'Wait for DIV to open',
|
||||||
|
action: async () => {
|
||||||
|
return await driver.wait(until.elementLocated(By.css('.modal-content .modal-title')), 50000).catch(() => false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Edit Content Set DIV
|
||||||
|
{
|
||||||
|
description: 'Validate edit DIV title',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.modal-content .modal-title')).getText();
|
||||||
|
if (elementText !== 'Edit Content Set') {
|
||||||
|
throw new Error(`Edit DIV title did not match; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Edit DIV title matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Edit Content Set DIV - label
|
||||||
|
{
|
||||||
|
description: 'Validate edit DIV label',
|
||||||
|
action: async () => {
|
||||||
|
const elementText = await driver.findElement(By.css('.form-label')).getText();
|
||||||
|
if (elementText !== expectedEditDIVLabel) {
|
||||||
|
throw new Error(`Expected: "${expectedEditDIVLabel}"; Actual: "${elementText}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Edit DIV label matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Edit Content Set DIV - textbox
|
||||||
|
{
|
||||||
|
description: 'Validate edit DIV textbox',
|
||||||
|
action: async () => {
|
||||||
|
const elementValue = await driver.findElement(By.css('#orgname')).getAttribute('value');
|
||||||
|
if (elementValue !== expectedCreatedDIVTextbox) {
|
||||||
|
throw new Error(`Edit DIV textbox Expected: "${expectedCreatedDIVTextbox}"; Actual: "${elementValue}"`);
|
||||||
|
}
|
||||||
|
console.log('Passed: Edit DIV textbox matched as expected');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//Delete created content set
|
||||||
|
{ description: 'Click delete button', action: async () => await driver.findElement(By.css('#orgdelete')).click() },
|
||||||
|
{ description: 'Driver sleep', action: async () => await driver.sleep(2000) },
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
|
||||||
@@ -477,7 +608,7 @@ try {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
||||||
console.error(`Step ${stepIndex} failed: ${error.message}`);
|
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Builder, By, Key, until } from 'selenium-webdriver';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import XLSX from 'xlsx';
|
import XLSX from 'xlsx';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { assert } from 'console';
|
|
||||||
|
|
||||||
const ExACT_landingPage = (req, res) => {
|
const ExACT_landingPage = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Landing Page: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Landing Page: Initiated</h2>');
|
||||||
@@ -16,47 +15,34 @@ const ExACT_landingPage = (req, res) => {
|
|||||||
//Left Panel:
|
//Left Panel:
|
||||||
//Title
|
//Title
|
||||||
const expectedTitleText = 'Empowering publishers with the ability to correlate their unique content to standards.';
|
const expectedTitleText = 'Empowering publishers with the ability to correlate their unique content to standards.';
|
||||||
const expectedTitleFont = '32px';
|
|
||||||
//Description
|
//Description
|
||||||
const expectedDescriptiveText1 = 'The ExACT platform is the education industry’s most trusted source to globally correlate content to standards and produce content alignment reports.';
|
const expectedDescriptiveText1 = 'The ExACT platform is the education industry’s most trusted source to globally correlate content to standards and produce content alignment reports.';
|
||||||
const expectedDescriptiveText2 = 'With access to over five million learning outcomes, ExACT’s robust toolset allows end users to discover new markets for their content, find gaps, and adjust alignments for specific opportunities.';
|
const expectedDescriptiveText2 = 'With access to over five million learning outcomes, ExACT’s robust toolset allows end users to discover new markets for their content, find gaps, and adjust alignments for specific opportunities.';
|
||||||
//Sign Up
|
//Sign Up
|
||||||
const expectedSignUpText = 'Sign Up For A 30 Day Free Trial';
|
const expectedSignUpText = 'Sign Up For A 30 Day Free Trial';
|
||||||
const expectedFreeTrialLinkColor = 'rgba(255, 111, 97, 1)'; //Red/Orange
|
|
||||||
//Bullet Points
|
//Bullet Points
|
||||||
const expectedBulletPointText1 = 'Learn more about ExACT AutoAlign, the AI-based alignment tool.';
|
const expectedBulletPointText1 = 'Learn more about ExACT AutoAlign, the AI-based alignment tool.';
|
||||||
const expectedBulletPointLinkColor1 = 'rgba(48, 200, 172, 1)'; //teal
|
|
||||||
const expectedBulletPointText2 = 'See your Correlation Analytics.';
|
const expectedBulletPointText2 = 'See your Correlation Analytics.';
|
||||||
const expectedBulletPointLinkColor2 = 'rgba(48, 200, 172, 1)'; //teal
|
|
||||||
const expectedBulletPointText3 = 'Explore how your Content maps to International Standards.';
|
const expectedBulletPointText3 = 'Explore how your Content maps to International Standards.';
|
||||||
const expectedBulletPointLinkColor3 = 'rgba(48, 200, 172, 1)'; //teal
|
|
||||||
|
|
||||||
//Right Panel:
|
//Right Panel:
|
||||||
//Welcome back
|
//Welcome back
|
||||||
const expectedWelcomeBackText = 'WELCOME BACK!';
|
const expectedWelcomeBackText = 'WELCOME BACK!';
|
||||||
const expectedWelcomeBackColor = 'rgba(117, 117, 117, 1)' //gray
|
|
||||||
//Login
|
//Login
|
||||||
const expectedLoginTitleText = 'Login to your account';
|
const expectedLoginTitleText = 'Login to your account';
|
||||||
const expectedLoginTitleColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedLoginTitleFont = '32px';
|
|
||||||
//Username
|
//Username
|
||||||
const expectedUsernameLabel = 'Username';
|
const expectedUsernameLabel = 'Username';
|
||||||
const expectedUsernameColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedUsernamePlaceholder = 'Username';
|
const expectedUsernamePlaceholder = 'Username';
|
||||||
//Password
|
//Password
|
||||||
const expectedPasswordLabel = 'Password';
|
const expectedPasswordLabel = 'Password';
|
||||||
const expectedPasswordColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedPasswordPlaceholder = 'Password';
|
const expectedPasswordPlaceholder = 'Password';
|
||||||
//Forgot password link
|
//Forgot password link
|
||||||
const expectedForgotPasswordLinkColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
//Login button
|
//Login button
|
||||||
const expectedLoginButtonText = 'Login';
|
const expectedLoginButtonText = 'Login';
|
||||||
const expectedLoginButtonColor = 'rgba(48, 200, 172, 1)'; //teal
|
|
||||||
//Don't have account text
|
//Don't have account text
|
||||||
const expectedDontHaveAccountText = `DON'T HAVE AN ACCOUNT?`;
|
const expectedDontHaveAccountText = `DON'T HAVE AN ACCOUNT?`;
|
||||||
//Free trial button
|
//Free trial button
|
||||||
const expectedFreeTrialButtonText = '30 Day';
|
const expectedFreeTrialButtonText = '30 Day';
|
||||||
const expectedFreeTrialButtonColor = 'rgba(0, 0, 0, 0)'; //white
|
|
||||||
|
|
||||||
const steps = [
|
const steps = [
|
||||||
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php
|
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://stage.edgate.com/exact/login.php') }, //PROD - https://correlation.edgate.com/exact/login.php
|
||||||
@@ -82,8 +68,8 @@ const steps = [
|
|||||||
description: 'Validate Title text font size',
|
description: 'Validate Title text font size',
|
||||||
action: async () =>
|
action: async () =>
|
||||||
{ const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('font-size');
|
{ const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('font-size');
|
||||||
if (elementStyle !== expectedTitleFont) {
|
if (elementStyle !== '32px') {
|
||||||
throw new Error(`Title text font-size Expected: "${expectedTitleFont}"; Actual: "${elementStyle}"`);
|
throw new Error(`Title text font-size did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Title text font-size matched as expected');
|
console.log('Passed: Title text font-size matched as expected');
|
||||||
}
|
}
|
||||||
@@ -125,13 +111,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Free trial link text color
|
//Free trial link text color -red/orange
|
||||||
{
|
{
|
||||||
description: 'Validate free trial link color',
|
description: 'Validate free trial link color',
|
||||||
action: async () =>
|
action: async () =>
|
||||||
{ const elementStyle = await driver.findElement(By.linkText('30 Day Free Trial')).getCssValue('color');
|
{ const elementStyle = await driver.findElement(By.linkText('30 Day Free Trial')).getCssValue('color');
|
||||||
if (elementStyle !== expectedFreeTrialLinkColor) {
|
if (elementStyle !== 'rgba(255, 111, 97, 1)') {
|
||||||
throw new Error(`Free trial link text color Expected: "${expectedFreeTrialLinkColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Free trial link text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Free trial link text color matched as expected');
|
console.log('Passed: Free trial link text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -161,13 +147,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Bullet Point link 1 text color
|
//Bullet Point link 1 text color -teal
|
||||||
{
|
{
|
||||||
description: 'Validate bullet point link 1 text color',
|
description: 'Validate bullet point link 1 text color',
|
||||||
action: async () =>
|
action: async () =>
|
||||||
{ const elementStyle = await driver.findElement(By.linkText('ExACT AutoAlign,')).getCssValue('color');
|
{ const elementStyle = await driver.findElement(By.linkText('ExACT AutoAlign,')).getCssValue('color');
|
||||||
if (elementStyle !== expectedBulletPointLinkColor1) {
|
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
|
||||||
throw new Error(`Bullet point link 1 text color Expected: "${expectedBulletPointLinkColor1}"; Actual: "${elementStyle}"`);
|
throw new Error(`Bullet point link 1 text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Bullet point link 1 text color matched as expected');
|
console.log('Passed: Bullet point link 1 text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -197,13 +183,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Bullet Point link 2 text color
|
//Bullet Point link 2 text color -teal
|
||||||
{
|
{
|
||||||
description: 'Validate bullet point link 2 text color',
|
description: 'Validate bullet point link 2 text color',
|
||||||
action: async () =>
|
action: async () =>
|
||||||
{ const elementStyle = await driver.findElement(By.linkText('Correlation Analytics.')).getCssValue('color');
|
{ const elementStyle = await driver.findElement(By.linkText('Correlation Analytics.')).getCssValue('color');
|
||||||
if (elementStyle !== expectedBulletPointLinkColor2) {
|
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
|
||||||
throw new Error(`Bullet point link 2 text color Expected: "${expectedBulletPointLinkColor2}"; Actual: "${elementStyle}"`);
|
throw new Error(`Bullet point link 2 text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Bullet point link 2 text color matched as expected');
|
console.log('Passed: Bullet point link 2 text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -233,13 +219,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Bullet Point link 3 text color
|
//Bullet Point link 3 text color -teal
|
||||||
{
|
{
|
||||||
description: 'Validate bullet point link 3 text color',
|
description: 'Validate bullet point link 3 text color',
|
||||||
action: async () =>
|
action: async () =>
|
||||||
{ const elementStyle = await driver.findElement(By.linkText('International Standards.')).getCssValue('color');
|
{ const elementStyle = await driver.findElement(By.linkText('International Standards.')).getCssValue('color');
|
||||||
if (elementStyle !== expectedBulletPointLinkColor3) {
|
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
|
||||||
throw new Error(`Bullet point link 3 text color Expected: "${expectedBulletPointLinkColor3}"; Actual: "${elementStyle}"`);
|
throw new Error(`Bullet point link 3 text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Bullet point link 3 text color matched as expected');
|
console.log('Passed: Bullet point link 3 text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -270,13 +256,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Welcome back text color
|
//Welcome back text color -gray
|
||||||
{
|
{
|
||||||
description: 'Validate Welcome back text color',
|
description: 'Validate Welcome back text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('#formLogin > p')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('#formLogin > p')).getCssValue('color');
|
||||||
if (elementStyle !== expectedWelcomeBackColor) {
|
if (elementStyle !== 'rgba(117, 117, 117, 1)') {
|
||||||
throw new Error(`Welcome back text color Expected: "${expectedWelcomeBackColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Welcome back text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Welcome back text color matched as expected');
|
console.log('Passed: Welcome back text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -306,13 +292,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Login title text color
|
//Login title text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Login title text color',
|
description: 'Validate Login title text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('color');
|
||||||
if (elementStyle !== expectedLoginTitleColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Login title text color Expected: "${expectedLoginTitleColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Login title text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Login title text color matched as expected');
|
console.log('Passed: Login title text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -323,8 +309,8 @@ const steps = [
|
|||||||
description: 'Validate Login title text font size',
|
description: 'Validate Login title text font size',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('font-size');
|
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('font-size');
|
||||||
if (elementStyle !== expectedLoginTitleFont) {
|
if (elementStyle !== '32px') {
|
||||||
throw new Error(`Login title text font-size Expected: "${expectedLoginTitleFont}"; Actual: "${elementStyle}"`);
|
throw new Error(`Login title text font-size did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Login title text font-size matched as expected');
|
console.log('Passed: Login title text font-size matched as expected');
|
||||||
}
|
}
|
||||||
@@ -342,13 +328,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Username label text color
|
//Username label text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Username label text color',
|
description: 'Validate Username label text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(4) > label')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(4) > label')).getCssValue('color');
|
||||||
if (elementStyle !== expectedUsernameColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Username label text color Expected: "${expectedUsernameColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Username label text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Username label text color matched as expected');
|
console.log('Passed: Username label text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -378,13 +364,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Password label text color
|
//Password label text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Password label text color',
|
description: 'Validate Password label text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getCssValue('color');
|
||||||
if (elementStyle !== expectedPasswordColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Password label text color Expected: "${expectedPasswordColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Password label text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Password label text color matched as expected');
|
console.log('Passed: Password label text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -402,13 +388,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Forgot password text link color
|
//Forgot password text link color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Forgot Password link text color',
|
description: 'Validate Forgot Password link text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.linkText('Forgot Password?')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.linkText('Forgot Password?')).getCssValue('color');
|
||||||
if (elementStyle !== expectedForgotPasswordLinkColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Forgot password link text color Expected: "${expectedForgotPasswordLinkColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Forgot password link text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Forgot password link text color matched as expected');
|
console.log('Passed: Forgot password link text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -426,13 +412,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Login button background color
|
//Login button background color -teal
|
||||||
{
|
{
|
||||||
description: 'Validate Login button background color',
|
description: 'Validate Login button background color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.login')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('.login')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedLoginButtonColor) {
|
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
|
||||||
throw new Error(`Login button background color Expected: "${expectedLoginButtonColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Login button background color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Login button background color matched as expected');
|
console.log('Passed: Login button background color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -462,13 +448,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Free trial button background color
|
//Free trial button background color -white
|
||||||
{
|
{
|
||||||
description: 'Validate Free trial button background color',
|
description: 'Validate Free trial button background color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.btn > span')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('.btn > span')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedFreeTrialButtonColor) {
|
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
|
||||||
throw new Error(`Free trial button background color Expected: "${expectedFreeTrialButtonColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Free trial button background color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Free trial button background color matched as expected');
|
console.log('Passed: Free trial button background color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -542,7 +528,7 @@ try {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
||||||
console.error(`Step ${stepIndex} failed: ${error.message}`);
|
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Builder, By, Key, until } from 'selenium-webdriver';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import XLSX from 'xlsx';
|
import XLSX from 'xlsx';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { assert } from 'console';
|
|
||||||
|
|
||||||
const ExACT_login = (req, res) => {
|
const ExACT_login = (req, res) => {
|
||||||
res.send('<h2>ExACT Automated Test Script - Login: Initiated</h2>');
|
res.send('<h2>ExACT Automated Test Script - Login: Initiated</h2>');
|
||||||
@@ -13,36 +12,25 @@ const ExACT_login = (req, res) => {
|
|||||||
let worksheet;
|
let worksheet;
|
||||||
const startTime = new Date().toISOString();
|
const startTime = new Date().toISOString();
|
||||||
|
|
||||||
//Right Panel:
|
//Welcome back
|
||||||
//Welcome back
|
|
||||||
const expectedWelcomeBackText = 'WELCOME BACK!';
|
const expectedWelcomeBackText = 'WELCOME BACK!';
|
||||||
const expectedWelcomeBackColor = 'rgba(117, 117, 117, 1)' //gray
|
|
||||||
//Login
|
//Login
|
||||||
const expectedLoginTitleText = 'Login to your account';
|
const expectedLoginTitleText = 'Login to your account';
|
||||||
const expectedLoginTitleColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedLoginTitleFont = '32px';
|
|
||||||
//Username
|
//Username
|
||||||
const expectedUsernameLabel = 'Username';
|
const expectedUsernameLabel = 'Username';
|
||||||
const expectedUsernameColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedUsernamePlaceholder = 'Username';
|
const expectedUsernamePlaceholder = 'Username';
|
||||||
//Password
|
//Password
|
||||||
const expectedPasswordLabel = 'Password';
|
const expectedPasswordLabel = 'Password';
|
||||||
const expectedPasswordColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
const expectedPasswordPlaceholder = 'Password';
|
const expectedPasswordPlaceholder = 'Password';
|
||||||
//Forgot password link
|
|
||||||
const expectedForgotPasswordLinkColor = 'rgba(40, 39, 90, 1)'; //navy blue
|
|
||||||
//Login button
|
//Login button
|
||||||
const expectedLoginButtonText = 'Login';
|
const expectedLoginButtonText = 'Login';
|
||||||
const expectedLoginButtonColor = 'rgba(48, 200, 172, 1)'; //teal
|
|
||||||
//Don't have account text
|
//Don't have account text
|
||||||
const expectedDontHaveAccountText = `DON'T HAVE AN ACCOUNT?`;
|
const expectedDontHaveAccountText = `DON'T HAVE AN ACCOUNT?`;
|
||||||
//Free trial button
|
//Free trial button
|
||||||
const expectedFreeTrialButtonText = '30 Day';
|
const expectedFreeTrialButtonText = '30 Day';
|
||||||
const expectedFreeTrialButtonColor = 'rgba(0, 0, 0, 0)'; //white
|
|
||||||
|
|
||||||
//Validation
|
//Validation
|
||||||
const expectedAuthenticationText = 'Authentication Failed. Please check the username and password you entered and try again.';
|
const expectedAuthenticationText = 'Authentication Failed. Please check the username and password you entered and try again.';
|
||||||
const expectedAuthenticationColor = 'rgba(231, 76, 60, 0.88)'; //orange
|
|
||||||
|
|
||||||
//Signed in Username
|
//Signed in Username
|
||||||
const expectedUsername = 'JuanIsThe BestAdmin';
|
const expectedUsername = 'JuanIsThe BestAdmin';
|
||||||
@@ -76,13 +64,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Welcome back text color
|
//Welcome back text color -gray
|
||||||
{
|
{
|
||||||
description: 'Validate Welcome back text color',
|
description: 'Validate Welcome back text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('#formLogin > p')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('#formLogin > p')).getCssValue('color');
|
||||||
if (elementStyle !== expectedWelcomeBackColor) {
|
if (elementStyle !== 'rgba(117, 117, 117, 1)') {
|
||||||
throw new Error(`Welcome back text color Expected: "${expectedWelcomeBackColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Welcome back text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Welcome back text color matched as expected');
|
console.log('Passed: Welcome back text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -112,13 +100,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Login title text color
|
//Login title text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Login title text color',
|
description: 'Validate Login title text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('color');
|
||||||
if (elementStyle !== expectedLoginTitleColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Login title text color Expected: "${expectedLoginTitleColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Login title text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Login title text color matched as expected');
|
console.log('Passed: Login title text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -129,8 +117,8 @@ const steps = [
|
|||||||
description: 'Validate Login title text font size',
|
description: 'Validate Login title text font size',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('font-size');
|
const elementStyle = await driver.findElement(By.css('h2:nth-child(3)')).getCssValue('font-size');
|
||||||
if (elementStyle !== expectedLoginTitleFont) {
|
if (elementStyle !== '32px') {
|
||||||
throw new Error(`Login title text font-size Expected: "${expectedLoginTitleFont}"; Actual: "${elementStyle}"`);
|
throw new Error(`Login title text font-size did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Login title text font-size matched as expected');
|
console.log('Passed: Login title text font-size matched as expected');
|
||||||
}
|
}
|
||||||
@@ -148,13 +136,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Username label text color
|
//Username label text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Username label text color',
|
description: 'Validate Username label text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(4) > label')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(4) > label')).getCssValue('color');
|
||||||
if (elementStyle !== expectedUsernameColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Username label text color Expected: "${expectedUsernameColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Username label text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Username label text color matched as expected');
|
console.log('Passed: Username label text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -184,13 +172,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Password label text color
|
//Password label text color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Password label text color',
|
description: 'Validate Password label text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getCssValue('color');
|
||||||
if (elementStyle !== expectedPasswordColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Password label text color Expected: "${expectedPasswordColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Password label text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Password label text color matched as expected');
|
console.log('Passed: Password label text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -208,13 +196,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Forgot password text link color
|
//Forgot password text link color -navy blue
|
||||||
{
|
{
|
||||||
description: 'Validate Forgot Password link text color',
|
description: 'Validate Forgot Password link text color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.linkText('Forgot Password?')).getCssValue('color');
|
const elementStyle = await driver.findElement(By.linkText('Forgot Password?')).getCssValue('color');
|
||||||
if (elementStyle !== expectedForgotPasswordLinkColor) {
|
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
|
||||||
throw new Error(`Forgot password link text color Expected: "${expectedForgotPasswordLinkColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Forgot password link text color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Forgot password link text color matched as expected');
|
console.log('Passed: Forgot password link text color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -232,13 +220,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Login button background color
|
//Login button background color -teal
|
||||||
{
|
{
|
||||||
description: 'Validate Login button background color',
|
description: 'Validate Login button background color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.login')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('.login')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedLoginButtonColor) {
|
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
|
||||||
throw new Error(`Login button background color Expected: "${expectedLoginButtonColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Login button background color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Login button background color matched as expected');
|
console.log('Passed: Login button background color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -268,13 +256,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Free trial button background color
|
//Free trial button background color -white
|
||||||
{
|
{
|
||||||
description: 'Validate Free trial button background color',
|
description: 'Validate Free trial button background color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.btn > span')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('.btn > span')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedFreeTrialButtonColor) {
|
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
|
||||||
throw new Error(`Free trial button background color Expected: "${expectedFreeTrialButtonColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Free trial button background color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Free trial button background color matched as expected');
|
console.log('Passed: Free trial button background color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -325,13 +313,13 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//Authentication validation text background color
|
//Authentication validation text background color -red/orange
|
||||||
{
|
{
|
||||||
description: 'Validate authentication alert background color',
|
description: 'Validate authentication alert background color',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const elementStyle = await driver.findElement(By.css('.alert')).getCssValue('background-color');
|
const elementStyle = await driver.findElement(By.css('.alert')).getCssValue('background-color');
|
||||||
if (elementStyle !== expectedAuthenticationColor) {
|
if (elementStyle !== 'rgba(231, 76, 60, 0.88)') {
|
||||||
throw new Error(`Authentication alert background color Expected: "${expectedAuthenticationColor}"; Actual: "${elementStyle}"`);
|
throw new Error(`Authentication alert background color did not match; Actual: "${elementStyle}"`);
|
||||||
}
|
}
|
||||||
console.log('Passed: Authentication alert background color matched as expected');
|
console.log('Passed: Authentication alert background color matched as expected');
|
||||||
}
|
}
|
||||||
@@ -414,7 +402,7 @@ try {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
const screenshotPath = await takeScreenshot(driver, stepIndex, `${step.description}_Failed`);
|
||||||
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
worksheet = logStep(worksheet, step.description, 'Failed', stepIndex, timestamp, screenshotPath);
|
||||||
console.error(`Step ${stepIndex} failed: ${error.message}`);
|
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
|
||||||
testStatus = 'Failed';
|
testStatus = 'Failed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user