Compare commits

...

61 Commits

Author SHA1 Message Date
jhuerta
d42e41d9aa Added stand alone logging 2026-11-10 14:19:01 -08:00
jhuerta
31c8f74518 Updated script resultfile 2026-11-10 11:27:45 -08:00
jhuerta
ff50ab728b Restructured scripts 2026-11-06 16:27:10 -08:00
jhuerta
b5d9e33b4d Moved ExACT Landing Page script 2026-11-06 15:03:26 -08:00
jhuerta
1bf8978094 Updated results excel sheet name 2026-11-06 12:44:21 -08:00
jhuerta
dc4d4c4a24 Updated My Standards Widget script 2026-11-06 12:43:23 -08:00
jhuerta
25c94ebc5e Moved Correlation Dashboard script 2026-11-06 09:53:28 -08:00
jhuerta
57e89b6b53 Added and Completed Approve tabs 2026-11-05 18:33:20 -08:00
jhuerta
8a64b6ddfe Added and Completed Specialty Reports Page script 2026-11-05 15:21:53 -08:00
jhuerta
fb5ce957fc Added and Completed View Queued Report Page script 2026-11-05 12:57:00 -08:00
jhuerta
3821c6278c Corrected end statement 2026-10-30 14:56:53 -07:00
jhuerta
f193784252 Completed Report Build Youre Report Page script 2026-10-30 12:30:54 -07:00
jhuerta
80e13f94e4 Started Report Build Your Report script 2026-10-29 15:13:49 -07:00
jhuerta
8ebaf749ce Renamed 2026-10-29 15:11:26 -07:00
jhuerta
8c5b78dbf4 Updated result sheet path 2026-10-29 15:04:55 -07:00
jhuerta
72da5df4ca Removed commented out code 2026-10-29 14:45:34 -07:00
jhuerta
7fed41d6ac Added and completed Approve Page script 2026-10-29 14:34:26 -07:00
jhuerta
54e8956472 Cleaned up Import Choose File check 2026-10-29 11:07:42 -07:00
jhuerta
866efbd43f Completed Acitivy Report script 2026-10-29 11:06:36 -07:00
jhuerta
409f9edde9 Completed Upload Import Alignments Page 2026-10-28 17:28:56 -07:00
jhuerta
015b51997e Completed script 2026-10-28 14:59:24 -07:00
jhuerta
5186faf1b6 Cleaned up html page 2026-10-28 14:59:02 -07:00
jhuerta
45b89837e1 Cleaned up next steps script 2026-10-28 14:49:33 -07:00
jhuerta
300708a85a Completed Upload Submit A Resource Page script 2026-10-27 16:17:06 -07:00
jhuerta
a27fd65cce Cleaned up results file structure 2026-10-27 14:36:03 -07:00
jhuerta
2e3a67438e Cleaned file structure 2026-10-27 14:35:16 -07:00
jhuerta
d536166028 Started building Upload Submit A Resource script 2026-10-27 10:16:53 -07:00
jhuerta
ac0fcad963 Moved to Frameworks folder structure 2026-10-27 10:16:28 -07:00
jhuerta
d8d1f49056 Moved under Frameworks foler 2026-10-27 10:15:06 -07:00
jhuerta
da8d8e914c Added Upload branch, cleaned up page 2026-10-27 10:10:06 -07:00
jhuerta
a7e36560ee Completed AutoAlign Page script 2026-10-26 16:43:24 -07:00
jhuerta
5a3946ad74 Cleaned upl href values 2026-10-26 16:42:57 -07:00
jhuerta
1f9e03c530 Cleaned up scripts 2026-10-23 18:17:42 -07:00
jhuerta
77b04d695b Corrected start log title 2026-10-23 12:03:05 -07:00
jhuerta
c34e61937c Corrected file structure for Align 2026-10-23 12:02:26 -07:00
jhuerta
d36ba0ca22 Moved to Align file structure 2026-10-23 11:21:56 -07:00
jhuerta
d499d802a3 Completed script 2026-10-22 17:38:17 -07:00
jhuerta
a6fcb195bc Renamed file 2026-10-22 17:16:33 -07:00
jhuerta
fca0f654ac Updated EdGate footer 2026-10-22 17:15:25 -07:00
jhuerta
ae97282f9a Corrected href checks 2026-10-22 16:25:16 -07:00
jhuerta
d2583998c8 Removed hidden comment 2026-10-21 14:45:37 -07:00
jhuerta
6f30e1b432 Renamed script 2026-10-21 14:43:41 -07:00
jhuerta
8b4fdc706e Initial Alignment Content Page update 2026-10-19 17:00:36 -07:00
jhuerta
d6793d7c55 Cleaned description line 1349 2026-10-19 16:44:13 -07:00
jhuerta
d6171d8661 Updated naming convention for script 2026-10-16 11:41:13 -07:00
jhuerta
9f1cbb7b2e Cleaned up Log Out script 2026-10-16 11:32:25 -07:00
jhuerta
2e0d791286 Cleaned top of script 2026-10-16 11:18:04 -07:00
jhuerta
300804baaf Completed Framework script 2026-10-16 09:06:27 -07:00
jhuerta
fc96f911f6 Cleaned up completed message 2026-10-16 09:06:06 -07:00
jhuerta
8e77e7f622 Completed Dashboard script 2026-10-16 09:05:35 -07:00
jhuerta
1111b1c00a Updated naming convention 2026-10-13 12:09:24 -07:00
jhuerta
10840ac188 Add dashboard and My Standards search tests; update existing tests and results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 15:27:11 -07:00
c4d68d5a13 Added My Standards widget 2026-04-07 15:12:05 -07:00
d4cd0417f4 Updated ULR to prod 2026-04-07 15:09:03 -07:00
fb242c097e Checked in results 2026-04-07 15:04:20 -07:00
f12bea0876 Checked in results 2026-04-07 15:01:58 -07:00
9488a04d52 Checked in results 2026-04-07 14:54:02 -07:00
cc718411d0 Checked in results 2026-04-07 14:52:58 -07:00
65445ac8f8 Checked in landing page result sheet 2026-04-07 14:51:44 -07:00
2d9c0b0806 Revamped script 2026-04-07 14:50:12 -07:00
72bd36bb77 Revampted script 2026-04-07 13:43:19 -07:00
50 changed files with 92911 additions and 19459 deletions

4
.gitignore vendored
View File

@@ -1,2 +1,4 @@
node_modules
screenshots
screenshots
.vscode/
.claude/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

204
index.js
View File

@@ -1,24 +1,58 @@
import express from 'express';
import ExACT_landingPage from './tests/ExACT_landingPage.js';
import ExACT_login from './tests/ExACT_login.js';
//Dashboard
import ExACT_dashboardMyContent from './tests/ExACT_DashboardMyContent.js';
//Content
import ExACT_contentPage from './tests/ExACT_contentPage.js';
import ExACT_editItem from './tests/ExACT_editItem.js';
//Align
import ExACT_alignContentPage from './tests/ExACT_alignContentPage.js';
import ExACT_alignStandardsPage from './tests/ExACT_alignStandardsPage.js';
import ExACT_editItemAddConcept from './tests/ExACT_editItemAddConcept.js';
import ExACT_alignConceptsPage from './tests/ExACT_alignConceptsPage.js';
//Framework
import ExACT_frameworkManagementPage from './tests/ExACT_frameworkManagementPage.js';
import exactLandingPage from './tests/LandingPage/exactLandingPage.js';
//import ExACT_login from './tests/ExACT_login.js';
//DASHBOARDS
import correlationDashboard from './tests/CorrelationDashboard/correlationDashboard.js';
import dashboardMyStandards from './tests/CorrelationDashboard/MyStandardsWidget/dashboardMyStandards.js';
import ExACT_dashboardMyContent from './tests/ExACT_dashboardMyContent.js';
import ExACT_dashboardSemanticStandardsComparison from './tests/ExACT_dashboardSemanticStandardsComparison.js';
import myStandardsSearchAlignedContent from './tests/myStandardsSearchAlignedContent.js';
import myStandardsSearchRelatedStandards from './tests/myStandardsSearchRelatedStandards.js';
//FRAMEWORKS
import frameworkManagementPage from './tests/Frameworks/frameworkManagementPage.js';
import ExACT_frameworkPublishingPage from './tests/ExACT_frameworkPublishingPage.js';
import ExACT_frameworkPublishFrameworkDIV from './tests/ExACT_frameworkPublishFrameworkDIV.js';
import ExACT_frameworkFrameworkGroupsDIV from './tests/ExACT_frameworkFrameworkGroupsDIV.js';
import ExACT_frameworkFrameworkSettingsDIV from './tests/ExACT_frameworkFrameworkSettingsDIV.js';
//ALIGN
import alignContentPage from './tests/Align/alignContentPage.js';
import alignStandardsPage from './tests/Align/alignStandardsPage.js';
import alignAutoAlignPage from './tests/Align/alignAutoAlignPage.js';
//UPLOAD
import uploadSubmitAResourcePage from './tests/Upload/uploadSubmitAResourcePage.js';
import uploadBatchUploadPage from './tests/Upload/uploadBatchUpload.js';
import uploadImportAlignmentsPage from './tests/Upload/uploadImportAlignmentsPage.js';
//ACTIVITY REPORT
import activityReportPage from './tests/ActivityReport/ActivityReportPage.js';
//REPORT
import reportBuildYourReportPage from './tests/Report/reportBuildYourReportPage.js';
import reportViewQueuedReportsPage from './tests/Report/reportViewQueuedReportsPage.js';
import reportSpecialtyReportsPage from './tests/Report/reportSpecialtyReportsPage.js';
//APPROVE
import approvePendingAlignmentsPage from './tests/Approve/approvePendingAlignmentsPage.js';
import approveContentSubmissionsPage from './tests/Approve/approveContentSubmissionsPage.js';
import approveApprovalHistoryPage from './tests/Approve/approveApprovalHistoryPage.js';
import approveRejectionHistoryPage from './tests/Approve/approveRejectionHistoryPage.js';
//Content
import ExACT_contentPage from './tests/ExACT_contentPage.js';
import ExACT_editItem from './tests/ExACT_editItem.js';
import ExACT_editItemAddConcept from './tests/ExACT_editItemAddConcept.js';
import ExACT_alignConceptsPage from './tests/ExACT_alignConceptsPage.js';
const app = express();
app.get('/', (req, res) => {
@@ -28,59 +62,129 @@ app.get('/', (req, res) => {
<h1 style="text-align:center; color:#055a8c; padding-top: 20px;">ExACT Automated Regression Scripts</h1>
<div style="text-align:center; color:#001; font-size:15px; ">(Click the corresponding link to execute the desired script)</div>
<br><div style="padding:3px;"><strong><a href='/ExACT_landingPage' target='_blank'>ExACT Landing Page</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_login' target='_blank'>Login</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">EXACT LANDING PAGE</h1>
<div style="padding:3px;"><strong><a href='/exactLandingPage' target='_blank'>ExACT Landing Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">DASHBOARD</h1>
<div style="padding:3px;"><strong><a href='/correlationDashboard' target='_blank'>Correlation Dashboard</a></strong></div>
<div style="padding:3px;"><strong>- <a href='/dashboardMyStandards' target='_blank'>My Standards Widget</a></strong></div>
<!-- NEEDS UPDATE
<div style="padding:3px;"><strong><a href='/ExACT_dashboardMyContent' target='_blank'>My Content Widget</a></strong></div>
-->
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">FRAMEWORKS</h1>
<div style="padding:3px;"><strong><a href='/frameworkManagementPage' target='_blank'>Framework Management Page</a></strong></div>
<!-- NEEDS UPDATE
<div style="padding:3px;"><strong><a href='/ExACT_frameworkPublishingPage' target='_blank'>Framework Publishing Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/ExACT_frameworkPublishFrameworkDIV' target='_blank'>Publish Framework DIV</a></strong></div>
<div style="padding:3px;"><strong><a href='/ExACT_frameworkFrameworkGroupsDIV' target='_blank'>Framework Groups DIV</a></strong></div>
<div style="padding:3px;"><strong><a href='/ExACT_frameworkFrameworkSettingsDIV' target='_blank'>Framework Settings DIV</a></strong></div>
-->
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">ALIGN</h1>
<div style="padding:3px;"><strong><a href='/alignContentPage' target='_blank'>Content Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/alignStandardsPage' target='_blank'>Standards Page</a></strong></div>
<div style="padding:3px;"><strong>- <a href='/myStandardsSearchAlignedContent' target='_blank'>My Standards Search / Aligned Content</a></strong></div>
<div style="padding:3px;"><strong>- <a href='/myStandardsSearchRelatedStandards' target='_blank'>My Standards Search / Related Standards</a></strong></div>
<div style="padding:3px;"><strong><a href='/alignAutoAlignPage' target='_blank'>AutoAlign Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">UPLOAD</h1>
<div style="padding:3px;"><strong><a href='/uploadSubmitAResourcePage' target='_blank'>Submit A Resource Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/uploadBatchUploadPage' target='_blank'>Batch Upload Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/uploadImportAlignmentsPage' target='_blank'>Import Alignments Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">ACTIVITY REPORT</h1>
<div style="padding:3px;"><strong><a href='/activityReportPage' target='_blank'>Activity Report Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">REPORT</h1>
<div style="padding:3px;"><strong><a href='/reportBuildYourReportPage' target='_blank'>Build Your Report Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/reportViewQueuedReportsPage' target='_blank'>View Queued Reports Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/reportSpecialtyReportsPage' target='_blank'>Specialty Reports Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">APPROVE</h1>
<div style="padding:3px;"><strong><a href='/approvePendingAlignmentsPage' target='_blank'>Pending Alignments Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/approveContentSubmissionsPage' target='_blank'>Content Submissions Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/approveApprovalHistoryPage' target='_blank'>Approval History Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/approveRejectionHistoryPage' target='_blank'>Rejection History Page</a></strong></div>
<!-- NEEDS UPDATE
<div style="padding:3px;"><strong><a href='/ExACT_dashboardSemanticStandardsComparison' target='_blank'>Semantic Standards Comparison Widget</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">CONTENT</h1>
<div style="padding:3px;"><strong><a href='/ExACT_contentPage' target='_blank'>Content Page</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_editItem' target='_blank'>Edit Item</a></strong></div>
<div style="padding:3px;"><strong><a href='/ExACT_editItem' target='_blank'>Edit Item</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">ALIGN</h1>
<div style="padding:3px;"><strong><a href='/ExACT_alignContentPage' target='_blank'>Align Content Page</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_editItemAddConcept' target='_blank'>Align - Edit Content and Align Concept</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_alignStandardsPage' target='_blank'>Align Standards Page</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_alignConceptsPage' target='_blank'>Align Concepts Page</a></strong></div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">FRAMEWORKS</h1>
<div style="padding:3px;"><strong><a href='/ExACT_frameworkManagementPage' target='_blank'>Framework Management Page</a></strong></div>
<div style="padding:3px;"><strong><a href='/ExACT_editItemAddConcept' target='_blank'>Align - Edit Content and Align Concept</a></strong></div>
<div style="padding:3px;"><strong><a href='/ExACT_alignConceptsPage' target='_blank'>Align Concepts Page</a></strong></div>
-->
<br><div style="padding:3px;"><strong><a href='/ExACT_frameworkPublishingPage' target='_blank'>Framework Publishing Page</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_frameworkPublishFrameworkDIV' target='_blank'>Publish Framework DIV</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_frameworkFrameworkGroupsDIV' target='_blank'>Framework Groups DIV</a></strong></div>
<br><div style="padding:3px;"><strong><a href='/ExACT_frameworkFrameworkSettingsDIV' target='_blank'>Framework Settings DIV</a></strong></div>
<br>
</div>
`);
})
//Landing:
app.get('/ExACT_landingPage', ExACT_landingPage);
//EXACT LANDING
app.get('/exactLandingPage', exactLandingPage);
//Login
app.get('/ExACT_login', ExACT_login);
//Dashboard
//My Content
app.get('/ExACT_dashboardMyContent', ExACT_dashboardMyContent);
//app.get('/ExACT_login', ExACT_login);
//DASHBOARDS
app.get('/correlationDashboard', correlationDashboard);
app.get('/dashboardMyStandards', dashboardMyStandards);
//FRAMEWORKS
app.get('/frameworkManagementPage', frameworkManagementPage);
app.get('/ExACT_frameworkPublishingPage', ExACT_frameworkPublishingPage);
app.get('/ExACT_frameworkPublishFrameworkDIV', ExACT_frameworkPublishFrameworkDIV);
app.get('/ExACT_frameworkFrameworkGroupsDIV', ExACT_frameworkFrameworkGroupsDIV);
app.get('/ExACT_frameworkFrameworkSettingsDIV', ExACT_frameworkFrameworkSettingsDIV);
//ALIGN
app.get('/alignContentPage', alignContentPage);
app.get('/alignStandardsPage', alignStandardsPage);
app.get('/alignAutoAlignPage', alignAutoAlignPage);
//UPLOAD
app.get('/uploadSubmitAResourcePage', uploadSubmitAResourcePage);
app.get('/uploadBatchUploadPage', uploadBatchUploadPage);
app.get('/uploadImportAlignmentsPage', uploadImportAlignmentsPage);
//ACTIVITY REPORT
app.get('/activityReportPage', activityReportPage);
//ACTIVITY REPORT
app.get('/reportBuildYourReportPage', reportBuildYourReportPage);
app.get('/reportViewQueuedReportsPage', reportViewQueuedReportsPage);
app.get('/reportSpecialtyReportsPage', reportSpecialtyReportsPage);
//APPROVE
app.get('/approvePendingAlignmentsPage', approvePendingAlignmentsPage);
app.get('/approveContentSubmissionsPage', approveContentSubmissionsPage);
app.get('/approveApprovalHistoryPage', approveApprovalHistoryPage);
app.get('/approveRejectionHistoryPage', approveRejectionHistoryPage);
//My Content
app.get('/ExACT_dashboardMyContent', ExACT_dashboardMyContent);
app.get('/ExACT_dashboardSemanticStandardsComparison', ExACT_dashboardSemanticStandardsComparison);
app.get('/myStandardsSearchAlignedContent', myStandardsSearchAlignedContent);
app.get('/myStandardsSearchRelatedStandards', myStandardsSearchRelatedStandards);
//Content
app.get('/ExACT_contentPage', ExACT_contentPage);
//Edit Item
app.get('/ExACT_contentPage', ExACT_contentPage);
//Edit Item
app.get('/ExACT_editItem', ExACT_editItem);
//Align
app.get('/ExACT_alignContentPage', ExACT_alignContentPage);
app.get('/ExACT_alignStandardsPage', ExACT_alignStandardsPage);
app.get('/ExACT_editItemAddConcept', ExACT_editItemAddConcept);
app.get('/ExACT_alignConceptsPage', ExACT_alignConceptsPage);
//Framework
app.get('/ExACT_frameworkManagementPage', ExACT_frameworkManagementPage);
app.get('/ExACT_frameworkPublishingPage', ExACT_frameworkPublishingPage);
app.get('/ExACT_frameworkPublishFrameworkDIV', ExACT_frameworkPublishFrameworkDIV);
app.get('/ExACT_frameworkFrameworkGroupsDIV', ExACT_frameworkFrameworkGroupsDIV);
app.get('/ExACT_frameworkFrameworkSettingsDIV', ExACT_frameworkFrameworkSettingsDIV);
app.listen(8000, () => {
app.listen(8000, () => {
console.log('Server is up and running on port 8000');
});

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -55,10 +55,11 @@ const steps = [
action: async () => {
const element = await driver.findElement(By.css('.e-heading'));
//Get text, color, and size
//Get text, font, size, and color
const elementText = await element.getText();
const elementColor = await element.getCssValue('color');
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
@@ -71,6 +72,14 @@ const steps = [
errors.push(message);
}
//Validate font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Dashboard - Page title text font matched as expected');
} else {
const message = `Expected: Dashboard - Page title text font "Poppins, sans-serif"; Actual: "${elementFont}"`;
errors.push(message);
}
//Validate color -navy blue
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Dashboard - Page title text color matched as expected');
@@ -122,10 +131,11 @@ const steps = [
action: async () => {
const element = await driver.findElement(By.css('.standards-compare h2'));
//Get text, color, and size
//Get text, font, size, and color
const elementText = await element.getText();
const elementColor = await element.getCssValue('color');
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
@@ -138,6 +148,22 @@ const steps = [
errors.push(message);
}
//Validate font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Dashboard - Semantic Standards Comparison Widget title font matched as expected');
} else {
const message = `Expected: Dashboard - Semantic Standards Comparison Widget title font "Poppins, sans-serif"; Actual: "${elementFont}"`;
errors.push(message);
}
//Validate size
if (elementSize === '18px') {
console.log('Passed: Dashboard - Semantic Standards Comparison Widget title text font-size matched as expected');
} else {
const message = `Expected: Dashboard - Semantic Standards Comparison Widget title text font-size "18px"; Actual: "${elementSize}"`;
errors.push(message);
}
//Validate color -navy blue
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Dashboard - Semantic Standards Comparison Widget title text color matched as expected');
@@ -173,10 +199,11 @@ const steps = [
action: async () => {
const element = await driver.findElement(By.css('#sscMap-tab'));
//Get text, color, and size
//Get text, font, size, and color
const elementText = await element.getText();
const elementColor = await element.getCssValue('color');
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
@@ -189,6 +216,14 @@ const steps = [
errors.push(message);
}
//Validate font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Dashboard - National Standards tab title font matched as expected');
} else {
const message = `Expected: Dashboard - National Standards tab title font "Poppins, sans-serif"; Actual: "${elementFont}"`;
errors.push(message);
}
//Validate color -navy blue
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Dashboard - National Standards tab title text color matched as expected');
@@ -224,10 +259,11 @@ const steps = [
action: async () => {
const element = await driver.findElement(By.css('#sscFilterLaunch-tab'));
//Get text, color, and size
//Get text, font, size, and color
const elementText = await element.getText();
const elementColor = await element.getCssValue('color');
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
@@ -240,6 +276,14 @@ const steps = [
errors.push(message);
}
//Validate font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Dashboard - Custom Comparison tab title font matched as expected');
} else {
const message = `Expected: Dashboard - Custom Comparison tab title font "Poppins, sans-serif"; Actual: "${elementFont}"`;
errors.push(message);
}
//Validate color -gray
if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Dashboard - Custom Comparison tab title color matched as expected');
@@ -413,16 +457,17 @@ const steps = [
}
},
//Dashboard - National Standards tab title, text, and font size (dimmed)
//National Standards tab title, text, and font size (dimmed)
{
description: 'Validate Dashboard - National Standards tab title text, color, and size',
description: 'Validate National Standards tab title text, color, and size',
action: async () => {
const element = await driver.findElement(By.css('#sscMap-tab'));
//Get text, color, and size
//Get text, font, size, and color
const elementText = await element.getText();
const elementColor = await element.getCssValue('color');
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
@@ -435,6 +480,14 @@ const steps = [
errors.push(message);
}
//Validate font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Dashboard - National Standards tab title font matched as expected');
} else {
const message = `Expected: Dashboard - National Standards tab title font "Poppins, sans-serif"; Actual: "${elementFont}"`;
errors.push(message);
}
//Validate color -gray
if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Dashboard - National Standards tab title text color matched as expected');
@@ -464,41 +517,50 @@ const steps = [
}
},
//Dashboard - Custom Comparison tab title and color (active)
//Custom Comparison tab title and color (active)
{
description: 'Validate Dashboard - Custom Comparison tab title, text color, and size',
description: 'Validate Custom Comparison tab title, text color, and size',
action: async () => {
const element = await driver.findElement(By.css('#sscFilterLaunch-tab'));
//Get text, color, and size
//Get text, font, size, and color
const elementText = await element.getText();
const elementColor = await element.getCssValue('color');
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
//Validate text
if (elementText === 'Custom Comparison') {
console.log('Passed: Dashboard - Custom Comparison tab title matched as expected');
console.log('Passed: Custom Comparison tab title matched as expected');
} else {
const message = `Expected: Dashboard - "Custom Comparison" tab title; Actual: "${elementText}"`;
const message = `Expected: "Custom Comparison" tab title; Actual: "${elementText}"`;
errors.push(message);
}
//Validate font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Custom Comparison tab title font matched as expected');
} else {
const message = `Expected: Custom Comparison tab title font "Poppins, sans-serif"; Actual: "${elementFont}"`;
errors.push(message);
}
//Validate color -navy blue
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Dashboard - Custom Comparison tab title color matched as expected');
console.log('Passed: Custom Comparison tab title color matched as expected');
} else {
const message = `Expected: Dashboard - Custom Comparison tab title color "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`;
const message = `Expected: Custom Comparison tab title color "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`;
errors.push(message);
}
//Validate font size
if (elementSize === '15px') {
console.log('Passed: Dashboard - Custom Comparison tab title font size matched as expected');
console.log('Passed: Custom Comparison tab title font size matched as expected');
} else {
const message = `Expected: Dashboard - Custom Comparison tab title font size "15px"; Actual: "${elementSize}"`;
const message = `Expected: Custom Comparison tab title font size "15px"; Actual: "${elementSize}"`;
errors.push(message);
}
@@ -522,9 +584,9 @@ const steps = [
const elementText = await driver.findElement(By.css('#sscFilterLaunchPane > div > div')).getText();
if (elementText === `EdGate's advanced analysis tool provides semantic similarities, differences, and gaps across different state or organizational standards. Our advanced text analysis calculates semantic matches and provides a comprehensive comparison dataset for your team to make informed decisions faster and more effectively.`) {
console.log("Passed: Dashboard - Custom Comparison info text matched as expected");
console.log("Passed: Custom Comparison - info text matched as expected");
} else {
throw new Error(`Expected: Dashboard - "Custom Comparison info text did not match"; Actual: "${elementText}"`);
throw new Error(`Expected: Custom Comparison - "Custom Comparison info text did not match"; Actual: "${elementText}"`);
}
}
},
@@ -558,25 +620,25 @@ const steps = [
//Validate text
if (elementText === 'Get Started') {
console.log('Passed: Dashboard - Get Started button text matched as expected');
console.log('Passed: Custom Comparison - Get Started button text matched as expected');
} else {
const message = `Expected: Dashboard - "Get Started" button text; Actual: "${elementText}"`;
const message = `Expected: Custom Comparison - "Get Started" button text; Actual: "${elementText}"`;
errors.push(message);
}
//Validate color -green
if (elementColor === 'rgba(48, 200, 172, 1)') {
console.log('Passed: Dashboard - Get Started button color matched as expected');
console.log('Passed: Custom Comparison - Get Started button color matched as expected');
} else {
const message = `Expected: Dashboard - Get Started button color "rgba(48, 200, 172, 1)"; Actual: "${elementColor}"`;
const message = `Expected: Custom Comparison - Get Started button color "rgba(48, 200, 172, 1)"; Actual: "${elementColor}"`;
errors.push(message);
}
//Validate button icon is present
if (icon) {
console.log('Passed: Dashboard - Get Started button icon is present');
console.log('Passed: Custom Comparison - Get Started button icon is present');
} else {
const message = 'Expected: Dashboard - Get Started button icon not found';
const message = 'Expected: Custom Comparison - Get Started button icon not found';
errors.push(message);
}
@@ -621,9 +683,9 @@ const steps = [
}
},
//Dashboard - National Standards tab title, text, and font size (active)
//Custom Comparison - National Standards tab title, text, and font size (active)
{
description: 'Validate Dashboard - National Standards tab title text, color, and size',
description: 'Validate Custom Comparison - National Standards tab title text, color, and size',
action: async () => {
const element = await driver.findElement(By.css('#sscMap-tab'));
@@ -637,25 +699,25 @@ const steps = [
//Validate text
if (elementText === 'National Standards') {
console.log('Passed: Dashboard - National Standards tab title matched as expected');
console.log('Passed: Custom Comparison - National Standards tab title matched as expected');
} else {
const message = `Expected: Dashboard - "National Standards"; Actual: "${elementText}"`;
const message = `Expected: Custom Comparison - "National Standards"; Actual: "${elementText}"`;
errors.push(message);
}
//Validate color -navy blue
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Dashboard - National Standards tab title text color matched as expected');
console.log('Passed: Custom Comparison - National Standards tab title text color matched as expected');
} else {
const message = `Expected: Dashboard - National Standards tab title text color "rgba(40, 39, 90, 1)"'; Actual: "${elementColor}"`;
const message = `Expected: Custom Comparison - National Standards tab title text color "rgba(40, 39, 90, 1)"'; Actual: "${elementColor}"`;
errors.push(message);
}
//Validate font size
if (elementSize === '15px') {
console.log('Passed: Dashboard - National Standards tab title text font-size matched as expected');
console.log('Passed: Custom Comparison - National Standards tab title text font-size matched as expected');
} else {
const message = `Expected: Dashboard - National Standards tab title text font-size "15px"; Actual: "${elementSize}"`;
const message = `Expected: Custom Comparison - National Standards tab title text font-size "15px"; Actual: "${elementSize}"`;
errors.push(message);
}
@@ -672,9 +734,9 @@ const steps = [
}
},
//Dashboard - Custom Comparison tab title and color (dimmed)
//Custom Comparison - Custom Comparison tab title and color (dimmed)
{
description: 'Validate Dashboard - Custom Comparison tab title, text color, and size',
description: 'Validate Custom Comparison - Custom Comparison tab title, text color, and size',
action: async () => {
const element = await driver.findElement(By.css('#sscFilterLaunch-tab'));
@@ -688,25 +750,25 @@ const steps = [
//Validate text
if (elementText === 'Custom Comparison') {
console.log('Passed: Dashboard - Custom Comparison tab title matched as expected');
console.log('Passed: Custom Comparison - Custom Comparison tab title matched as expected');
} else {
const message = `Expected: Dashboard - "Custom Comparison" tab title; Actual: "${elementText}"`;
const message = `Expected: Custom Comparison - "Custom Comparison" tab title; Actual: "${elementText}"`;
errors.push(message);
}
//Validate color -gray
if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Dashboard - Custom Comparison tab title color matched as expected');
console.log('Passed: Custom Comparison - Custom Comparison tab title color matched as expected');
} else {
const message = `Expected: Dashboard - Custom Comparison tab title color "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`;
const message = `Expected: Custom Comparison - Custom Comparison tab title color "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`;
errors.push(message);
}
//Validate font size
if (elementSize === '15px') {
console.log('Passed: Dashboard - Custom Comparison tab title font size matched as expected');
console.log('Passed: Custom Comparison - Custom Comparison tab title font size matched as expected');
} else {
const message = `Expected: Dashboard - Custom Comparison tab title font size "15px"; Actual: "${elementSize}"`;
const message = `Expected: Custom Comparison - Custom Comparison tab title font size "15px"; Actual: "${elementSize}"`;
errors.push(message);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,601 +0,0 @@
import { Builder, By, Key, until } from 'selenium-webdriver';
import fs from 'fs';
import XLSX from 'xlsx';
import path from 'path';
const ExACT_landingPage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: ExACT Login Page(ExACT_landingPage); Initiated</h2>');
(async function example() {
let driver = await new Builder().forBrowser('chrome').build();
let testStatus = 'Failed';
let workbook;
let worksheet;
const startTime = new Date().toISOString();
//Left Panel:
//Title
const expectedTitleText = 'Empowering publishers with the ability to correlate their unique content to standards.';
//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 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
const expectedSignUpText = 'Sign Up For A 30 Day Free Trial';
//Bullet Points
const expectedBulletPointText1 = 'Learn more about ExACT AutoAlign, the AI-based alignment tool.';
const expectedBulletPointText2 = 'See your Correlation Analytics.';
const expectedBulletPointText3 = 'Explore how your Content maps to International Standards.';
//Right Panel:
//Welcome back
const expectedWelcomeBackText = 'WELCOME BACK!';
//Login
const expectedLoginTitleText = 'Login to your account';
//Username
const expectedUsernameLabel = 'Username';
const expectedUsernamePlaceholder = 'Username';
//Password
const expectedPasswordLabel = 'Password';
const expectedPasswordPlaceholder = 'Password';
//Forgot password link
//Login button
const expectedLoginButtonText = 'Login';
//Don't have account text
const expectedDontHaveAccountText = `DON'T HAVE AN ACCOUNT?`;
//Free trial button
const expectedFreeTrialButtonText = '30 Day';
const steps = [
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://correlation.edgate.com/exact/login.php') },
{ description: 'Expand browser', action: async () => await driver.manage().window().maximize() },
{
description: 'Validate title text',
action: async () => {
//Wait for page to load completely
await driver.wait(async () => {
const readyState = await driver.executeScript('return document.readyState');
return readyState === 'complete';
}, 30000, 'ExACT Login Page did not fully load within 30 seconds');
console.log('---------------->| BEGIN |<----------------');
console.log('---------->| ExACT Login Page |<---------');
console.log('Passed: ExACT Login Page loaded successfully');
}
},
//LEFT PANEL
//Title text
{ description: 'Wait for title text to be present', action: async () => await driver.wait(until.elementsLocated(By.css('h2:nth-child(1)')), 5000) },
{
description: 'Validate title text',
action: async () =>
{ const elementText = await driver.findElement(By.css('h2:nth-child(1)')).getText();
if (elementText !== expectedTitleText) {
throw new Error(`Expected: "${expectedTitleText}"; Actual: "${elementText}"`);
}
console.log('Passed: Title text matched as expected');
}
},
//Title text font
{
description: 'Validate Title text font size',
action: async () =>
{ const elementStyle = await driver.findElement(By.css('h2:nth-child(1)')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Title text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Title text font-size matched as expected');
}
},
//Descriptive text 1
{
description: 'Validate descriptive text 1',
action: async () =>
{ const elementText = await driver.findElement(By.css('.content-inner > p:nth-child(2)')).getText();
if (elementText !== expectedDescriptiveText1) {
throw new Error(`Expected: "${expectedDescriptiveText1}"; Actual: "${elementText}"`);
}
console.log('Passed: Descriptive text 1 matched as expected');
}
},
//Descriptive text 2
{
description: 'Validate descriptive text 2',
action: async () =>
{ const elementText = await driver.findElement(By.css('p:nth-child(3)')).getText();
if (elementText !== expectedDescriptiveText2) {
throw new Error(`Expected: "${expectedDescriptiveText2}"; Actual: "${elementText}"`);
}
console.log('Passed: Descriptive text 2 matched as expected');
}
},
//Sign Up text
{
description: 'Validate sign up text',
action: async () =>
{ const elementText = await driver.findElement(By.css('h4')).getText();
if (elementText !== expectedSignUpText) {
throw new Error(`Expected: "${expectedSignUpText}"; Actual: "${elementText}"`);
}
console.log('Passed: Sign up text matched as expected');
}
},
//Free trial link text color -red/orange
{
description: 'Validate free trial link color',
action: async () =>
{ const elementStyle = await driver.findElement(By.linkText('30 Day Free Trial')).getCssValue('color');
if (elementStyle !== 'rgba(255, 111, 97, 1)') {
throw new Error(`Free trial link text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Free trial link text color matched as expected');
}
},
//Bullet Point Icon 1
{
description: 'Verify bullet point icon 1 is present',
action: async () =>
{ const expectedbulletPointIcon = await driver.wait(until.elementLocated(By.css('li:nth-child(1) img')), 5000).catch(() => false);
if (!expectedbulletPointIcon) {
throw new Error('Bullet Point Icon 1 not found');
}
console.log('Passed: Bullet Point Icon 1 present');
}
},
//Bullet Point 1 text
{
description: 'Validate bullet point 1 text',
action: async () =>
{ const elementText = await driver.findElement(By.css('li:nth-child(1) > .list-flex')).getText();
if (elementText !== expectedBulletPointText1) {
throw new Error(`Expected: "${expectedBulletPointText1}"; Actual: "${elementText}"`);
}
console.log('Passed: Bullet point 1 text matched as expected');
}
},
//Bullet Point link 1 text color -teal
{
description: 'Validate bullet point link 1 text color',
action: async () =>
{ const elementStyle = await driver.findElement(By.linkText('ExACT AutoAlign,')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
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');
}
},
//Bullet Point Icon 2
{
description: 'Verify bullet point icon 2 is present',
action: async () =>
{ const expectedbulletPointIcon = await driver.wait(until.elementLocated(By.css('li:nth-child(2) img')), 5000).catch(() => false);
if (!expectedbulletPointIcon) {
throw new Error('Bullet Point Icon 2 not found');
}
console.log('Passed: Bullet Point Icon 2 present');
}
},
//Bullet Point 2 text
{
description: 'Validate bullet point 2 text',
action: async () =>
{ const elementText = await driver.findElement(By.css('li:nth-child(2) > .list-flex')).getText();
if (elementText !== expectedBulletPointText2) {
throw new Error(`Expected: "${expectedBulletPointText2}"; Actual: "${elementText}"`);
}
console.log('Passed: Bullet point 2 text matched as expected');
}
},
//Bullet Point link 2 text color -teal
{
description: 'Validate bullet point link 2 text color',
action: async () =>
{ const elementStyle = await driver.findElement(By.linkText('Correlation Analytics.')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
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');
}
},
//Bullet Point Icon 3
{
description: 'Verify bullet point icon 3 is present',
action: async () =>
{ const expectedbulletPointIcon = await driver.wait(until.elementLocated(By.css('li:nth-child(3) img')), 5000).catch(() => false);
if (!expectedbulletPointIcon) {
throw new Error('Bullet Point Icon 3 not found');
}
console.log('Passed: Bullet Point Icon 3 present');
}
},
//Bullet Point 3 text
{
description: 'Validate bullet point 3 text',
action: async () =>
{ const elementText = await driver.findElement(By.css('li:nth-child(3) > .list-flex')).getText();
if (elementText !== expectedBulletPointText3) {
throw new Error(`Expected: "${expectedBulletPointText3}"; Actual: "${elementText}"`);
}
console.log('Passed: Bullet point 3 text matched as expected');
}
},
//Bullet Point link 3 text color -teal
{
description: 'Validate bullet point link 3 text color',
action: async () =>
{ const elementStyle = await driver.findElement(By.linkText('International Standards.')).getCssValue('color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
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');
}
},
//RIGHT PANEL
//ExACT logo
{
description: 'Verify ExACT logo is present',
action: async () => {
const expectedExactLogo = await driver.wait(until.elementLocated(By.css('.logo')), 5000).catch(() => false);
if (!expectedExactLogo) {
throw new Error('ExACT logo not found');
}
console.log('Passed: ExACT logo present');
}
},
//Welcome back text
{
description: 'Validate Welcome back text',
action: async () => {
const elementText = await driver.findElement(By.css('#formLogin > p')).getText();
if (elementText !== expectedWelcomeBackText) {
throw new Error(`Expected: "${expectedWelcomeBackText}"; Actual: "${elementText}"`);
}
console.log('Passed: Welcome Back! text matched as expected');
}
},
//Welcome back text color -gray
{
description: 'Validate Welcome back text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('#formLogin > p')).getCssValue('color');
if (elementStyle !== 'rgba(117, 117, 117, 1)') {
throw new Error(`Welcome back text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Welcome back text color matched as expected');
}
},
//Welcome back icon
{
description: 'Verify Welcome back icon is present',
action: async () => {
const expectedWelcomeBackIcon = await driver.wait(until.elementLocated(By.css('p > img')), 5000).catch(() => false);
if (!expectedWelcomeBackIcon) {
throw new Error('Welcome back icon not found');
}
console.log('Passed: Welcome back icon present');
}
},
//Login title text
{
description: 'Validate Login title text',
action: async () => {
const elementText = await driver.findElement(By.css('h2:nth-child(4)')).getText();
if (elementText !== expectedLoginTitleText) {
throw new Error(`Expected: "${expectedLoginTitleText}"; Actual: "${elementText}"`);
}
console.log('Passed: Login title text matched as expected');
}
},
//Login title text color -navy blue
{
description: 'Validate Login title text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2:nth-child(4)')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Login title text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Login title text color matched as expected');
}
},
//Login title text font
{
description: 'Validate Login title text font size',
action: async () => {
const elementStyle = await driver.findElement(By.css('h2:nth-child(4)')).getCssValue('font-size');
if (elementStyle !== '32px') {
throw new Error(`Login title text font-size did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Login title text font-size matched as expected');
}
},
//Username label text
{
description: 'Validate Username label text',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getText();
if (elementText !== expectedUsernameLabel) {
throw new Error(`Expected: "${expectedUsernameLabel}"; Actual: "${elementText}"`);
}
console.log('Passed: Username label text matched as expected');
}
},
//Username label text color -navy blue
{
description: 'Validate Username label text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(5) > label')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Username label text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Username label text color matched as expected');
}
},
//Username textbox placeholder
{
description: 'Validate Username placeholder text',
action: async () => {
const elementValue = await driver.findElement(By.css('.form-control:nth-child(2)')).getAttribute('placeholder');
if (elementValue !== expectedUsernamePlaceholder) {
throw new Error(`Username placeholder text Expected: "${expectedUsernamePlaceholder}"; Actual: "${elementValue}"`);
}
console.log('Passed: Username placeholder text matched as expected');
}
},
//Password label text
{
description: 'Validate Password label text',
action: async () => {
const elementText = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getText();
if (elementText !== expectedPasswordLabel) {
throw new Error(`Expected: "${expectedPasswordLabel}"; Actual: "${elementText}"`);
}
console.log('Passed: Password label text matched as expected');
}
},
//Password label text color -navy blue
{
description: 'Validate Password label text color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.form-group:nth-child(6) > label')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Password label text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Password label text color matched as expected');
}
},
//Password textbox placeholder
{
description: 'Validate Password placeholder text',
action: async () => {
const elementValue = await driver.findElement(By.css('.passfield')).getAttribute('placeholder');
if (elementValue !== expectedPasswordPlaceholder) {
throw new Error(`Password placeholder text Expected: "${expectedPasswordPlaceholder}"; Actual: "${elementValue}"`);
}
console.log('Passed: Password placeholder text matched as expected');
}
},
//Forgot password text link color -navy blue
{
description: 'Validate Forgot Password link text color',
action: async () => {
const elementStyle = await driver.findElement(By.linkText('Forgot Password?')).getCssValue('color');
if (elementStyle !== 'rgba(40, 39, 90, 1)') {
throw new Error(`Forgot password link text color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Forgot password link text color matched as expected');
}
},
//Login button text (alt to .getText)
{
description: 'Validate Login button text',
action: async () => {
const elementText = await driver.findElement(By.css('.login')).getAttribute('value');
if (elementText !== expectedLoginButtonText) {
throw new Error(`Expected: "${expectedLoginButtonText}"; Actual: "${elementText}"`);
}
console.log('Passed: Login button text matched as expected');
}
},
//Login button background color -teal
{
description: 'Validate Login button background color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.login')).getCssValue('background-color');
if (elementStyle !== 'rgba(48, 200, 172, 1)') {
throw new Error(`Login button background color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Login button background color matched as expected');
}
},
//Don't have an account? text
{
description: 'Validate Dont have account text',
action: async () => {
const elementText = await driver.findElement(By.css('p:nth-child(1)')).getText();
if (elementText !== expectedDontHaveAccountText) {
throw new Error(`Expected: "${expectedDontHaveAccountText}"; Actual: "${elementText}"`);
}
console.log('Passed: Dont have an account text matched as expected');
}
},
//Free trial button text
{
description: 'Validate Free trial button text',
action: async () => {
const elementText = await driver.findElement(By.css('.btn > span')).getText();
if (elementText !== expectedFreeTrialButtonText) {
throw new Error(`Expected: "${expectedFreeTrialButtonText}"; Actual: "${elementText}"`);
}
console.log('Passed: Free trial button text matched as expected');
}
},
//Free trial button background color -white
{
description: 'Validate Free trial button background color',
action: async () => {
const elementStyle = await driver.findElement(By.css('.btn > span')).getCssValue('background-color');
if (elementStyle !== 'rgba(0, 0, 0, 0)') {
throw new Error(`Free trial button background color did not match; Actual: "${elementStyle}"`);
}
console.log('Passed: Free trial button background color matched as expected');
}
},
//EdGate copyright image
{
description: 'Verify EdGate copyright image is present',
action: async () => {
const expectedEdGateCopyright = await driver.wait(until.elementLocated(By.css('.logincopyright > img')), 5000).catch(() => false);
if (!expectedEdGateCopyright) {
throw new Error('EdGate copyright not found');
}
console.log('Passed: EdGate copyright image present');
}
},
];
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
const json_data = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
json_data.push([stepIndex, stepDescription, status, timestamp, screenshotPath]);
return XLSX.utils.aoa_to_sheet(json_data);
};
const takeScreenshot = async (driver, stepIndex, stepDescription) => {
const screenshot = await driver.takeScreenshot();
const dir = path.join('screenshots', 'landingPage');
const screenshotFileName = `step_${stepIndex}_${stepDescription.replace(/\s+/g, '_')}.png`;
const screenshotPath = path.join(dir, screenshotFileName);
fs.writeFileSync(screenshotPath, screenshot, 'base64');
return screenshotPath;
};
const clearOldResults = () => {
//Remove old screenshots
const screenshotDir = path.join('screenshots', 'landingPage');
if (fs.existsSync(screenshotDir)) {
fs.rmSync(screenshotDir, { recursive: true, force: true });
}
fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file
if (fs.existsSync('landingPageResults.xlsx')) {
fs.unlinkSync('landingPageResults.xlsx');
}
};
try {
//Initialize workbook and worksheet
clearOldResults();
//Initialize workbook and worksheet
workbook = XLSX.utils.book_new();
worksheet = XLSX.utils.aoa_to_sheet([
['Step Number', 'Step Description', 'Status', 'Timestamp', 'Screenshot']
]);
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
//Log test start time
worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, '');
let allStepsPassed = true;
for (const step of steps) {
const stepIndex = steps.indexOf(step) + 1;
const timestamp = new Date().toISOString();
try {
//Screenshot of failed step
await step.action();
//Log a successful step with no screenshot
worksheet = logStep(
worksheet,
step.description,
'Passed',
stepIndex,
timestamp,
null //No screenshot for passed steps
);
} catch (error) {
//Only take screenshot if the step fails
const screenshotPath = await takeScreenshot(
driver,
stepIndex,
`${step.description}_Failed`
);
worksheet = logStep(
worksheet,
step.description,
'Failed',
stepIndex,
timestamp,
screenshotPath
);
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
testStatus = 'Failed';
allStepsPassed = false;
}
}
//Script completed
const expectedEdGateCopyright = await driver.wait(until.elementLocated(By.css('.logincopyright > img')), 5000).catch(() => false);
if (expectedEdGateCopyright && allStepsPassed) {
console.log('PASSED: ExACT Login Page(ExACT_landingPage); All test steps completed successfully');
testStatus = 'Passed';
} else {
console.log('FAILED: ExACT Login Page(ExACT_landingPage); One or more test steps failed');
testStatus = 'Failed';
}
//Log test end time
const endTime = new Date().toISOString();
worksheet = logStep(worksheet, 'Test End', testStatus, '', endTime, '');
//Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'landingPageResults.xlsx');
} finally {
await driver.quit();
}
})();
}
export default ExACT_landingPage;

View File

@@ -36,7 +36,7 @@ const expectedAuthenticationText = 'Authentication Failed. Please check the user
const expectedUsername = 'JuanIsThe BestAdmin';
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://correlation.edgate.com/exact/login.php') },
{ description: 'Expand browser', action: async () => await driver.manage().window().maximize() },
//RIGHT PANEL

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,977 @@
import { Builder, By, Key, until, Select, Browser } from 'selenium-webdriver';
import { Options as ChromeOptions } from 'selenium-webdriver/chrome.js';
import fs, { link } from 'fs';
import XLSX from 'xlsx';
import path from 'path';
const uploadSubmitAResourcePage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: Upload - Submit A Resource Page(uploadSubmitAResourcePage); Initiated</h2>');
(async function example() {
let driver = await new Builder()
.forBrowser('chrome')
.setChromeOptions(
new ChromeOptions()
.addArguments('--disable-features=MediaRouter')
.addArguments('--disable-extensions')
.addArguments('--disable-background-networking')
.addArguments('--log-level=3')
)
.build();
let testStatus = 'Failed';
let workbook;
let worksheet;
const startTime = new Date().toISOString();
const steps = [
{ description: 'Navigate to ExACT Landing Page', action: async () => await driver.navigate().to('https://correlation.edgate.com/exact/login.php') },
{ description: 'Expand browser', action: async () => await driver.manage().window().maximize() },
//Login
{
description: 'Login',
action: async () => {
const multipleChecks = 'Log In';
console.log('------------->| UPLOAD - SUBMIT A RESOURCE PAGE |<-------------');
const errors = [];
await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan');
await driver.findElement(By.css('.passfield')).sendKeys('Edgate1!');
await driver.findElement(By.css('.login')).click();
console.log('----->| NEXT ACTION: Entered credentials and logged in');
//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 for the dashboard container to exist in DOM
await driver.wait(
until.elementLocated(By.css('.gap-idle-wrap > img')),
30000,
'Dashboard image did not appear within 30 seconds'
);
//Wait for it to be: visible
await driver.wait(async () => {
try {
const img = await driver.findElement(By.css('.gap-idle-wrap > img'));
return await img.isDisplayed();
} catch (e) {
return false;
}
}, 30000, 'Dashboard image did not become visible within 30 seconds');
//Wait for any loading spinners to disappear
await driver.wait(async () => {
try {
const spinners = await driver.findElements(By.css('.spinner-border'));
for (const spinner of spinners) {
if (await spinner.isDisplayed()) return false;
}
return true;
} catch (e) {
return true;
}
}, 30000, 'Loading spinners did not disappear within 30 seconds');
//Wait for the slowest resource to complete
await driver.wait(async () => {
const completed = await driver.executeScript(`
const entries = performance.getEntriesByType('resource');
return entries.some(entry =>
entry.name.includes('content_sets.php') &&
entry.responseEnd > 0
);
`);
return completed;
}, 30000, 'My Content widget (content_sets.php) did not complete loading within 30 seconds');
console.log('Passed: My Content widget (content_sets.php) loaded successfully - Dashboard fully loaded');
//Final sleep to allow any remaining dynamic content to settle
await driver.sleep(2000);
console.log('Passed: ExACT Dashboard loaded successfully');
if (errors.length > 0) {
if (errors.length > 1) {
errors.unshift(`${multipleChecks} - Multiple validation checks did not pass`);
}
throw new Error(errors.join('\n'));
}
}
},
//Dashboard title
{
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
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
//text
if (elementText === 'Correlation Dashboard') {
console.log('Passed: Dashboard title text matched as expected');
} else {
errors.push(`Expected: "Correlation Dashboard"; Actual: "${elementText}"`);
}
//font
if (elementFont === `"DM Serif Display", serif`) {
console.log('Passed: Dashboard title font-family matched as expected');
} else {
errors.push(`Expected: Dashboard title font-family "DM Serif Display, serif"; Actual: ${elementFont}`);
}
//size
if (elementSize === '32px') {
console.log('Passed: Dashboard title text font-size matched as expected');
} else {
errors.push(`Expected: Dashboard title text font-size "32px"; Actual: "${elementSize}"`);
}
//color
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Dashboard title text color matched as expected');
} else {
errors.push(`Expected: Dashboard title text color: "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`);
}
//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'));
}
}
},
//NEXT ACTION
{
description: 'Click Upload navigation link',
action: async () => {
await driver.findElement(By.linkText('Upload')).click();
console.log('----->| NEXT ACTION: Clicked Upload navigation link');
//Wait for page readyState
await driver.wait(async () => {
const readyState = await driver.executeScript('return document.readyState');
return readyState === 'complete';
}, 30000, 'Align page did not fully load within 30 seconds');
//Wait until the element exists in the DOM
const uploadTitle = await driver.wait(
until.elementLocated(By.css('h2')),
30000
);
//Wait until it becomes visible
await driver.wait(
until.elementIsVisible(uploadTitle),
30000
);
}
},
//Upload page title
{
description: 'Upload page title text, size, and color',
action: async () => {
const multipleChecks = 'Upload page title';
const element = await driver.findElement(By.css('h2'));
//Get text, font, size, and color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
//text
if (elementText === 'Upload') {
console.log('Passed: Upload page title text matched as expected');
} else {
errors.push(`Expected: "Upload"; Actual: "${elementText}"`);
}
//font
if (elementFont === `"DM Serif Display", serif`) {
console.log('Passed: Upload page title font-family matched as expected');
} else {
errors.push(`Expected: Upload page title font-family "DM Serif Display, serif"; Actual: ${elementFont}`);
}
//size
if (elementSize === '32px') {
console.log('Passed: Upload page title text font-size matched as expected');
} else {
errors.push(`Expected: Upload page title text font-size "32px"; Actual: "${elementSize}"`);
}
//color
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Upload page title text color matched as expected');
} else {
errors.push(`Expected: Upload page title text color: "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`);
}
//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'));
}
}
},
//Submit A Resource tab
{
description: 'Submit A Resource tab title text, size, color, and background color',
action: async () => {
const multipleChecks = 'Submit A Resource tab title';
const element = await driver.findElement(By.linkText('Submit A Resource'));
//Get text, font, size, color, and background color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
const elementBgColor = await element.getCssValue('background-color');
//Track all errors
const errors = [];
//element text
if (elementText === 'Submit A Resource') {
console.log('Passed: Submit A Resource tab title text matched as expected');
} else {
errors.push(`Expected: "Submit A Resource"; Actual: "${elementText}"`);
}
//element font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Submit A Resource tab title font-family matched as expected');
} else {
errors.push(`Expected: Submit A Resource tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
}
//element size
if (elementSize === '15px') {
console.log('Passed: Submit A Resource tab title text font-size matched as expected');
} else {
errors.push(`Expected: Submit A Resource tab title text font-size "15px"; Actual: "${elementSize}"`);
}
//element color
if (elementColor === 'rgba(255, 255, 255, 1)') {
console.log('Passed: Submit A Resource tab title text color matched as expected');
} else {
errors.push(`Expected: Submit A Resource tab title text color: "rgba(255, 255, 255, 1)"; Actual: "${elementColor}"`);
}
//element background color
if (elementBgColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Submit A Resource tab title background color matched as expected');
} else {
errors.push(`Expected: Submit A Resource tab title background color: "rgba(40, 39, 90, 1)"; Actual: "${elementBgColor}"`);
}
//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'));
}
}
},
//Batch Upload tab
{
description: 'Batch Upload tab title text, size, color, and background color',
action: async () => {
const multipleChecks = 'Batch Upload tab title';
const element = await driver.findElement(By.linkText('Batch Upload'));
//Get text, font, size, color, and background color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
const elementBgColor = await element.getCssValue('background-color');
//Track all errors
const errors = [];
//element text
if (elementText === 'Batch Upload') {
console.log('Passed: Batch Upload tab title text matched as expected');
} else {
errors.push(`Expected: "Batch Upload"; Actual: "${elementText}"`);
}
//element font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Batch Upload tab title font-family matched as expected');
} else {
errors.push(`Expected: Batch Upload tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
}
//element size
if (elementSize === '15px') {
console.log('Passed: Batch Upload tab title text font-size matched as expected');
} else {
errors.push(`Expected: Batch Upload tab title text font-size "15px"; Actual: "${elementSize}"`);
}
//element color
if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Batch Upload tab title text color matched as expected');
} else {
errors.push(`Expected: Batch Upload tab title text color: "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`);
}
//element background color
if (elementBgColor === 'rgba(0, 0, 0, 0)') {
console.log('Passed: Batch Upload tab title background color matched as expected');
} else {
errors.push(`Expected: Batch Upload tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`);
}
//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'));
}
}
},
//Import Alignments tab
{
description: 'Import Alignments tab title text, size, color, and background color',
action: async () => {
const multipleChecks = 'Import Alignments tab title';
const element = await driver.findElement(By.linkText('Import Alignments'));
//Get text, font, size, color, and background color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
const elementBgColor = await element.getCssValue('background-color');
//Track all errors
const errors = [];
//element text
if (elementText === 'Import Alignments') {
console.log('Passed: Import Alignments tab title text matched as expected');
} else {
errors.push(`Expected: "Import Alignments"; Actual: "${elementText}"`);
}
//element font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Import Alignments tab title font-family matched as expected');
} else {
errors.push(`Expected: Import Alignments tab title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
}
//element size
if (elementSize === '15px') {
console.log('Passed: Import Alignments tab title text font-size matched as expected');
} else {
errors.push(`Expected: Import Alignments tab title text font-size "15px"; Actual: "${elementSize}"`);
}
//element color
if (elementColor === 'rgba(182, 186, 181, 1)') {
console.log('Passed: Import Alignments tab title text color matched as expected');
} else {
errors.push(`Expected: Import Alignments tab title text color: "rgba(182, 186, 181, 1)"; Actual: "${elementColor}"`);
}
//element background color
if (elementBgColor === 'rgba(0, 0, 0, 0)') {
console.log('Passed: Import Alignments tab title background color matched as expected');
} else {
errors.push(`Expected: Import Alignments tab title background color: "rgba(0, 0, 0, 0)"; Actual: "${elementBgColor}"`);
}
//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'));
}
}
},
//Widget sub-title
{
description: 'Widget sub-title text, size, and color',
action: async () => {
const multipleChecks = 'Widget sub-title';
const element = await driver.findElement(By.css('.chooser-intro'));
//Get text, font, size, and color
const elementText = await element.getText();
const elementFont = await element.getCssValue('font-family');
const elementSize = await element.getCssValue('font-size');
const elementColor = await element.getCssValue('color');
//Track all errors
const errors = [];
//text
if (elementText === `Choose how you'd like to add content to the system`) {
console.log('Passed: Widget sub-title text matched as expected');
} else {
errors.push(`Expected: "Choose how you'd like to add content to the system"; Actual: "${elementText}"`);
}
//font
if (elementFont === 'Poppins, sans-serif') {
console.log('Passed: Widget sub-title font-family matched as expected');
} else {
errors.push(`Expected: Widget sub-title font-family "Poppins, sans-serif"; Actual: ${elementFont}`);
}
//size
if (elementSize === '13px') {
console.log('Passed: Widget sub-title text font-size matched as expected');
} else {
errors.push(`Expected: Widget sub-title text font-size "13px"; Actual: "${elementSize}"`);
}
//color
if (elementColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Widget sub-title text color matched as expected');
} else {
errors.push(`Expected: Widget sub-title text color: "rgba(40, 39, 90, 1)"; Actual: "${elementColor}"`);
}
//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'));
}
}
},
//Enter Manually header and icon
{
description: 'Enter Manually header and icon',
action: async () => {
const multipleChecks = 'Enter Manually header and icon';
const elementIcon = await driver.findElement(By.css('.glyphicon-pencil'));
const element = await driver.findElement(By.css('.chooser-card:nth-child(1) > h4'));
//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: Enter Manually pencil icon was displayed as expected');
} else {
errors.push('Expected: Enter Manually pencil icon was not displayed');
}
//text
if (elementText === 'Enter Manually') {
console.log('Passed: Enter Manually text matched as expected');
} else {
errors.push(`Expected: "Enter Manually"; Actual: "${elementText}"`);
}
//font-family
if (elementTextFont === "Poppins, sans-serif") {
console.log('Passed: Enter Manually text font matched as expected');
} else {
errors.push(`Expected: Enter Manually text font "Poppins, sans-serif"; Actual: ${elementTextFont}`);
}
//font size
if (elementTextSize === '24px') {
console.log('Passed: Enter Manually text font-size matched as expected');
} else {
errors.push(`Expected: Enter Manually text font-size "24px"; Actual: "${elementTextSize}"`);
}
//color
if (elementTextColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Enter Manually text color matched as expected');
} else {
errors.push(`Expected: Enter Manually text color: "rgba(40, 39, 90, 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'));
}
}
},
//Enter Manually Select button
{
description: 'Enter Manually Select button',
action: async () => {
const multipleChecks = 'Enter Manually Select button';
const element = await driver.findElement(By.css('#chooseManualBtn'));
//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 = [];
//text
if (elementText === 'Select') {
console.log('Passed: Enter Manually Select button text matched as expected');
} else {
errors.push(`Expected: Enter Manually "Select"; Actual: "${elementText}"`);
}
//font-family
if (elementTextFont === "Poppins, sans-serif") {
console.log('Passed: Enter Manually Select button text font matched as expected');
} else {
errors.push(`Expected: Enter Manually Select button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`);
}
//font size
if (elementTextSize === '13px') {
console.log('Passed: Enter Manually Select button text font-size matched as expected');
} else {
errors.push(`Expected: Enter Manually Select button text font-size "13px"; Actual: "${elementTextSize}"`);
}
//color
if (elementTextColor === 'rgba(255, 255, 255, 1)') {
console.log('Passed: Enter Manually Select button text color matched as expected');
} else {
errors.push(`Expected: Enter Manually Select button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`);
}
//button color
if (elementButtonColor === 'rgba(48, 200, 172, 1)') {
console.log('Passed: Enter Manually Select button background color matched as expected');
} else {
errors.push(`Expected: Enter Manually Select 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'));
}
}
},
//Extract from Source header and icon
{
description: 'Extract from Source header and icon',
action: async () => {
const multipleChecks = 'Extract from Source header and icon';
const elementIcon = await driver.findElement(By.css('.chooser-icon > .glyphicon-file'));
const element = await driver.findElement(By.css('.chooser-card:nth-child(2) > h4'));
//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: Extract from Source file icon was displayed as expected');
} else {
errors.push('Expected: Extract from Source file icon was not displayed');
}
//text
if (elementText === 'Extract from Source') {
console.log('Passed: Extract from Source text matched as expected');
} else {
errors.push(`Expected: "Extract from Source"; Actual: "${elementText}"`);
}
//font-family
if (elementTextFont === "Poppins, sans-serif") {
console.log('Passed: Extract from Source text font matched as expected');
} else {
errors.push(`Expected: Extract from Source text font "Poppins, sans-serif"; Actual: ${elementTextFont}`);
}
//font size
if (elementTextSize === '24px') {
console.log('Passed: Extract from Source text font-size matched as expected');
} else {
errors.push(`Expected: Extract from Source text font-size "24px"; Actual: "${elementTextSize}"`);
}
//color
if (elementTextColor === 'rgba(40, 39, 90, 1)') {
console.log('Passed: Extract from Source text color matched as expected');
} else {
errors.push(`Expected: Extract from Source text color: "rgba(40, 39, 90, 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'));
}
}
},
//Extract from Source Select button
{
description: 'Extract from Source Select button',
action: async () => {
const multipleChecks = 'Extract from Source Select button';
const element = await driver.findElement(By.css('#chooseExtractBtn'));
//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 = [];
//text
if (elementText === 'Select') {
console.log('Passed: Extract from Source Select button text matched as expected');
} else {
errors.push(`Expected: Extract from Source "Select"; Actual: "${elementText}"`);
}
//font-family
if (elementTextFont === "Poppins, sans-serif") {
console.log('Passed: Extract from Source Select button text font matched as expected');
} else {
errors.push(`Expected: Extract from Source Select button text font "Poppins, sans-serif"; Actual: ${elementTextFont}`);
}
//font size
if (elementTextSize === '13px') {
console.log('Passed: Extract from Source Select button text font-size matched as expected');
} else {
errors.push(`Expected: Extract from Source Select button text font-size "13px"; Actual: "${elementTextSize}"`);
}
//color
if (elementTextColor === 'rgba(255, 255, 255, 1)') {
console.log('Passed: Extract from Source Select button text color matched as expected');
} else {
errors.push(`Expected: Extract from Source Select button text color: "rgba(255, 255, 255, 1)"; Actual: "${elementTextColor}"`);
}
//button color
if (elementButtonColor === 'rgba(48, 200, 172, 1)') {
console.log('Passed: Extract from Source Select button background color matched as expected');
} else {
errors.push(`Expected: Extract from Source Select 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'));
}
}
},
//FOOTER
//EdGate Copyright Logo
{
description: 'EdGate Copyright Logo',
action: async () => {
const multipleChecks = 'EdGate Copyright Logo';
const element = await driver.findElement(By.css('footer .pull-right > a'));
const elementLogo = await element.findElement(By.css('img'));
const expectedHref = 'https://www.edgate.com/';
//Track all errors
const errors = [];
//icon present
if (await elementLogo.isDisplayed()) {
console.log('Passed: EdGate Copyright Logo was displayed as expected');
} else {
errors.push('Expected: EdGate Copyright Logo was not displayed');
}
//href - browser resolves the link with a trailing slash, so remove it before comparing
const actualHref = await element.getAttribute('href');
if (actualHref && actualHref === expectedHref) {
console.log('Passed: EdGate Copyright Logo href matched as expected');
} else {
errors.push(`Expected: EdGate Copyright Logo href to be: "https://www.edgate.com/"; actual: "${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'));
}
}
},
//NEXT ACTION
{
description: 'Log Out',
action: async () => {
const multipleChecks = 'Log Out';
//Track all errors
const errors = [];
await driver.findElement(By.css('#navbarDropdown > span')).click();
await driver.sleep(2000);
await driver.findElement(By.linkText('Log Out')).click();
console.log('----->| NEXT ACTION: Clicked User Profile and Logged Out');
//Wait until the element exists in the DOM
const exactLogo = await driver.wait(
until.elementLocated(By.css('.logo')),
30000
);
//Wait until it becomes visible
await driver.wait(
until.elementIsVisible(exactLogo),
30000
);
//Wait for page to load completely
await driver.wait(async () => {
const readyState = await driver.executeScript('return document.readyState');
return readyState === 'complete';
}, 30000, 'ExACT Langing page did not fully load within 30 seconds');
console.log('Passed: ExACT Landing Page loaded successfully');
//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'));
}
}
},
];
const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, screenshotPath) => {
const json_data = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
json_data.push([stepIndex, stepDescription, status, timestamp, screenshotPath]);
return XLSX.utils.aoa_to_sheet(json_data);
};
const takeScreenshot = async (driver, stepIndex, stepDescription) => {
const screenshot = await driver.takeScreenshot();
const dir = path.join('screenshots', 'uploadSubmitAResourcePage');
const screenshotFileName = `step_${stepIndex}_${stepDescription.replace(/\s+/g, '_')}.png`;
const screenshotPath = path.join(dir, screenshotFileName);
fs.writeFileSync(screenshotPath, screenshot, 'base64');
return screenshotPath;
};
const resultsFile = path.join('results', 'uploadSubmitAResourcePage.xlsx');
const clearOldResults = () => {
//Remove old screenshots
const screenshotDir = path.join('screenshots', 'uploadSubmitAResourcePage');
if (fs.existsSync(screenshotDir)) {
fs.rmSync(screenshotDir, { recursive: true, force: true });
}
fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file
if (fs.existsSync(resultsFile)) {
fs.unlinkSync(resultsFile);
}
fs.mkdirSync('results', { recursive: true });
};
try {
//Initialize workbook and worksheet
clearOldResults();
//Initialize workbook and worksheet
workbook = XLSX.utils.book_new();
worksheet = XLSX.utils.aoa_to_sheet([
['Step Number', 'Step Description', 'Status', 'Timestamp', 'Screenshot']
]);
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
//Log test start time
worksheet = logStep(worksheet, 'Test Start', 'Started', '', startTime, '');
let allStepsPassed = true;
const failedSteps = []; //Track failed steps
for (const step of steps) {
const stepIndex = steps.indexOf(step) + 1;
const timestamp = new Date().toISOString();
try {
//Screenshot of failed step
await step.action();
//Log a successful step with no screenshot
worksheet = logStep(
worksheet,
step.description,
'Passed',
stepIndex,
timestamp,
null //No screenshot for passed steps
);
} catch (error) {
//Only take screenshot if the step fails
const screenshotPath = await takeScreenshot(
driver,
stepIndex,
`${step.description}_Failed`
);
worksheet = logStep(
worksheet,
step.description,
'Failed',
stepIndex,
timestamp,
screenshotPath
);
console.error(`Step ${stepIndex} FAILED: ${error.message}`);
failedSteps.push(`Step ${stepIndex}: ${step.description} - ${error.message}`); //Track failed step
testStatus = 'Failed';
allStepsPassed = false;
}
}
if (allStepsPassed) {
console.log('------------->| THE END |<-------------');
console.log('PASSED: Upload - Submit A Resource Page(uploadSubmitAResourcePage); All test steps completed successfully');
testStatus = 'Passed';
} else {
console.log('------------->| THE END |<-------------');
console.log('FAILED: Upload - Submit A Resource Page(uploadSubmitAResourcePage); One or more test steps failed');
console.log('FAILED STEPS:');
failedSteps.forEach(step => console.error(` ✗ ${step}`));
testStatus = 'Failed';
}
//Log test end time
const endTime = new Date().toISOString();
worksheet = logStep(worksheet, 'Test End', testStatus, '', endTime, '');
//Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, resultsFile);
} finally {
await driver.quit();
}
})();
}
export default uploadSubmitAResourcePage;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff