Added and Completed Approve tabs

This commit is contained in:
jhuerta
2026-11-05 18:33:20 -08:00
parent 8a64b6ddfe
commit 57e89b6b53
10 changed files with 4648 additions and 16 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,8 +4,8 @@ import fs, { link } from 'fs';
import XLSX from 'xlsx';
import path from 'path';
const approvePage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: Approve Page(approvePage): Initiated</h2>');
const approvePendingAlignmentsPage = (req, res) => {
res.send('<h2>ExACT Automated Test Script: Approve - Pending Alignments Page(approvePendingAlignmentsPage): Initiated</h2>');
(async function example() {
let driver = await new Builder()
.forBrowser('chrome')
@@ -40,7 +40,7 @@ const steps = [
action: async () => {
const multipleChecks = 'Log In';
console.log('------------->| APPROVE PAGE |<-------------');
console.log('------------->| APPROVE - CONTENT SUBMISSIONS PAGE |<-------------');
const errors = [];
await driver.findElement(By.css('.form-control:nth-child(2)')).sendKeys('exact_juan');
@@ -180,17 +180,17 @@ const steps = [
await driver.wait(async () => {
const readyState = await driver.executeScript('return document.readyState');
return readyState === 'complete';
}, 30000, 'Approve page did not fully load within 30 seconds');
}, 30000, 'Pending Alignments page did not fully load within 30 seconds');
//Wait until the element exists in the DOM
const approvePage = await driver.wait(
until.elementLocated(By.css('h2')),
const tabDefaultText = await driver.wait(
until.elementLocated(By.css('#tabs-2 b')),
30000
);
//Wait until it becomes visible
await driver.wait(
until.elementIsVisible(approvePage),
until.elementIsVisible(tabDefaultText),
30000
);
}
@@ -1046,7 +1046,7 @@ const logStep = (worksheet, stepDescription, status, stepIndex, timestamp, scree
const takeScreenshot = async (driver, stepIndex, stepDescription) => {
const screenshot = await driver.takeScreenshot();
const dir = path.join('screenshots', 'approvePage');
const dir = path.join('screenshots', 'approvePendingAlignmentsPage');
const screenshotFileName = `step_${stepIndex}_${stepDescription.replace(/\s+/g, '_')}.png`;
const screenshotPath = path.join(dir, screenshotFileName);
@@ -1054,11 +1054,11 @@ const takeScreenshot = async (driver, stepIndex, stepDescription) => {
return screenshotPath;
};
const resultsFile = path.join('results', 'approvePageResults.xlsx');
const resultsFile = path.join('results', 'approvePendingAlignmentsPageResults.xlsx');
const clearOldResults = () => {
//Remove old screenshots
const screenshotDir = path.join('screenshots', 'approvePage');
const screenshotDir = path.join('screenshots', 'approvePendingAlignmentsPage');
if (fs.existsSync(screenshotDir)) {
fs.rmSync(screenshotDir, { recursive: true, force: true });
}
@@ -1133,11 +1133,11 @@ try {
if (allStepsPassed) {
console.log('------------->| THE END |<-------------');
console.log('PASSED: Approve Page(approvePage); All test steps completed successfully');
console.log('PASSED: Approve - Pending Alignments Page(approvePendingAlignmentsPage); All test steps completed successfully');
testStatus = 'Passed';
} else {
console.log('------------->| THE END |<-------------');
console.log('FAILED: Approve Page(approvePage); One or more test steps failed');
console.log('FAILED: Approve - Pending Alignments Page(approvePendingAlignmentsPage); One or more test steps failed');
console.log('FAILED STEPS:');
failedSteps.forEach(step => console.error(` ✗ ${step}`));
testStatus = 'Failed';
@@ -1156,4 +1156,4 @@ try {
})();
}
export default approvePage;
export default approvePendingAlignmentsPage;

File diff suppressed because it is too large Load Diff