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

View File

@@ -5,8 +5,8 @@ import XLSX from 'xlsx';
import path from 'path';
import { error } from 'console';
const ExACT_landingPage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: EGATE LANDING PAGE: ExACT Login Page (ExACT_landingPage) | Initiated</h2>');
const exactLandingPage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: ExACT Landing Page(exactLandingPage) | Initiated</h2>');
(async function example() {
let driver = await new Builder()
.forBrowser('chrome')
@@ -1189,31 +1189,31 @@ const steps = [
const errors = [];
//text
if (elementText === 'Already Have an account? Sign In') {
console.log('Passed: Already Have an account? Sign In text matched as expected');
if (elementText === 'Already have an account? Sign In') {
console.log('Passed: Already have an account? Sign In text matched as expected');
} 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
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 {
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
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 {
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
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 {
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
@@ -4817,6 +4817,8 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath;
};
const resultsFile = path.join('results', 'exactLandingPageResults.xlsx');
const clearOldResults = () => {
//Remove old screenshots
const screenshotDir = path.join('screenshots', 'landingPage');
@@ -4826,9 +4828,10 @@ const clearOldResults = () => {
fs.mkdirSync(screenshotDir, { recursive: true });
//Remove old Excel file
if (fs.existsSync('landingPageResults.xlsx')) {
fs.unlinkSync('landingPageResults.xlsx');
if (fs.existsSync(resultsFile)) {
fs.unlinkSync(resultsFile);
}
fs.mkdirSync('results', { recursive: true });
};
try {
@@ -4889,11 +4892,11 @@ try {
if (allStepsPassed) {
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';
} else {
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:');
failedSteps.forEach(step => console.error(` ✗ ${step}`));
testStatus = 'Failed';
@@ -4905,11 +4908,11 @@ try {
//Write the updated worksheet back to the workbook and save it
workbook.Sheets['Sheet1'] = worksheet;
XLSX.writeFile(workbook, 'landingPageResults.xlsx');
XLSX.writeFile(workbook, resultsFile);
} finally {
await driver.quit();
}
})();
}
export default ExACT_landingPage;
export default exactLandingPage;