Cleaned file structure

This commit is contained in:
jhuerta
2026-10-27 14:35:16 -07:00
parent d536166028
commit 2e3a67438e
11 changed files with 23 additions and 20 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
import express from 'express'; import express from 'express';
import ExACT_landingPage from './tests/ExACT_landingPage.js'; import exactLandingPage from './tests/exactLandingPage.js';
//import ExACT_login from './tests/ExACT_login.js'; //import ExACT_login from './tests/ExACT_login.js';
//DASHBOARDS //DASHBOARDS
@@ -47,7 +47,7 @@ app.get('/', (req, res) => {
<div style="text-align:center; color:#001; font-size:15px; ">(Click the corresponding link to execute the desired script)</div> <div style="text-align:center; color:#001; font-size:15px; ">(Click the corresponding link to execute the desired script)</div>
<h1 style="text-align:center; color:#055a8c; font-size:20px; ">EDGATE LANDING PAGE</h1> <h1 style="text-align:center; color:#055a8c; font-size:20px; ">EDGATE LANDING PAGE</h1>
<div style="padding:3px;"><strong><a href='/ExACT_landingPage' target='_blank'>ExACT Landing Page</a></strong></div> <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> <h1 style="text-align:center; color:#055a8c; font-size:20px; ">DASHBOARD</h1>
<div style="padding:3px;"><strong><a href='/correlationsDashboard' target='_blank'>Correlations Dashboard</a></strong></div> <div style="padding:3px;"><strong><a href='/correlationsDashboard' target='_blank'>Correlations Dashboard</a></strong></div>
@@ -93,7 +93,7 @@ app.get('/', (req, res) => {
}) })
//EXACT LANDING //EXACT LANDING
app.get('/ExACT_landingPage', ExACT_landingPage); app.get('/exactLandingPage', exactLandingPage);
//Login //Login
//app.get('/ExACT_login', ExACT_login); //app.get('/ExACT_login', ExACT_login);

Binary file not shown.

Binary file not shown.

View File

@@ -5,8 +5,8 @@ import XLSX from 'xlsx';
import path from 'path'; import path from 'path';
import { error } from 'console'; import { error } from 'console';
const ExACT_landingPage = (req, res) => { const exactLandingPage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: EGATE LANDING PAGE: ExACT Login Page (ExACT_landingPage) | Initiated</h2>'); res.send('<h2>ExACT Automated Test Script: ExACT Landing Page(exactLandingPage) | Initiated</h2>');
(async function example() { (async function example() {
let driver = await new Builder() let driver = await new Builder()
.forBrowser('chrome') .forBrowser('chrome')
@@ -1189,31 +1189,31 @@ const steps = [
const errors = []; const errors = [];
//text //text
if (elementText === 'Already Have an account? Sign In') { if (elementText === 'Already have an account? Sign In') {
console.log('Passed: Already Have an account? Sign In text matched as expected'); console.log('Passed: Already have an account? Sign In text matched as expected');
} else { } else {
errors.push(`Expected: "Already Have an account? Sign In"; Actual: "${elementText}"`); errors.push(`Expected: "Already have an account? Sign In"; Actual: "${elementText}"`);
} }
//font-family //font-family
if (elementFont === "Poppins, sans-serif") { if (elementFont === "Poppins, sans-serif") {
console.log('Passed: Already Have an account? Sign In text font matched as expected'); console.log('Passed: Already have an account? Sign In text font matched as expected');
} else { } else {
errors.push(`Expected: Already Have an account? Sign In text font "Poppins, sans-serif"; Actual: ${elementFont}`); errors.push(`Expected: Already have an account? Sign In text font "Poppins, sans-serif"; Actual: ${elementFont}`);
} }
//color //color
if (elementColor === 'rgba(32, 32, 32, 1)') { if (elementColor === 'rgba(32, 32, 32, 1)') {
console.log('Passed: Already Have an account? Sign In color matched as expected'); console.log('Passed: Already have an account? Sign In color matched as expected');
} else { } else {
errors.push(`Expected: Already Have an account? Sign In color "rgba(32, 32, 32, 1)"; Actual: "${elementColor}"`); errors.push(`Expected: Already have an account? Sign In color "rgba(32, 32, 32, 1)"; Actual: "${elementColor}"`);
} }
//font size //font size
if (elementSize === '12px') { if (elementSize === '12px') {
console.log('Passed: Already Have an account? Sign In text font-size matched as expected'); console.log('Passed: Already have an account? Sign In text font-size matched as expected');
} else { } else {
errors.push(`Expected: Already Have an account? Sign In text font-size "12px"; Actual: "${elementSize}"`); errors.push(`Expected: Already have an account? Sign In text font-size "12px"; Actual: "${elementSize}"`);
} }
//Throw summary if any validation failed //Throw summary if any validation failed
@@ -4817,6 +4817,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath; return screenshotPath;
}; };
const resultsFile = path.join('results', 'exactLandingPageResults.xlsx');
const clearOldResults = () => { const clearOldResults = () => {
//Remove old screenshots //Remove old screenshots
const screenshotDir = path.join('screenshots', 'landingPage'); const screenshotDir = path.join('screenshots', 'landingPage');
@@ -4826,9 +4828,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true }); fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file //Remove old Excel file
if (fs.existsSync('landingPageResults.xlsx')) { if (fs.existsSync(resultsFile)) {
fs.unlinkSync('landingPageResults.xlsx'); fs.unlinkSync(resultsFile);
} }
fs.mkdirSync('results', { recursive: true });
}; };
try { try {
@@ -4889,11 +4892,11 @@ try {
if (allStepsPassed) { if (allStepsPassed) {
console.log('------------->| THE END |<-------------'); console.log('------------->| THE END |<-------------');
console.log('PASSED: EDGATE LANDING PAGE - ExACT Landing Page (ExACT_landingPage); All test steps completed successfully'); console.log('PASSED: ExACT Landing Page(exactLandingPage); All test steps completed successfully');
testStatus = 'Passed'; testStatus = 'Passed';
} else { } else {
console.log('------------->| THE END |<-------------'); console.log('------------->| THE END |<-------------');
console.log('FAILED: EDGATE LANDING PAGE - ExACT Landing Page (ExACT_landingPage); One or more test steps failed'); console.log('FAILED: ExACT Landing Page(exactLandingPage); One or more test steps failed');
console.log('FAILED STEPS:'); console.log('FAILED STEPS:');
failedSteps.forEach(step => console.error(` ✗ ${step}`)); failedSteps.forEach(step => console.error(` ✗ ${step}`));
testStatus = 'Failed'; testStatus = 'Failed';
@@ -4905,11 +4908,11 @@ try {
//Write the updated worksheet back to the workbook and save it //Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet; workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'landingPageResults.xlsx'); XLSX.writeFile(workbook, resultsFile);
} finally { } finally {
await driver.quit(); await driver.quit();
} }
})(); })();
} }
export default ExACT_landingPage; export default exactLandingPage;