diff --git a/test-automation/fixtures.js b/test-automation/fixtures.js index 2232e3bd..a25c5d6e 100644 --- a/test-automation/fixtures.js +++ b/test-automation/fixtures.js @@ -26,6 +26,7 @@ import { StatementsPage } from './pages/statements-page.js' import { BcrosAccountCreationPage } from './pages/bcros-account-creation-page.js' import { ManageEFTPaymentsPage } from './pages/manage-eft-payments-page.js' import { StaffReviewPage } from './pages/staff-review-page.js' +import { PayAdminPage } from './pages/pay-admin-page.js' import { EditProfilePage } from './pages/edit-profile-page.js' const test = base.extend({ @@ -63,6 +64,9 @@ const test = base.extend({ staffReviewPage: async ({ page }, use) => { await use(new StaffReviewPage(page)) }, + payAdminPage: async ({ page }, use) => { + await use(new PayAdminPage(page)) + }, editProfilePage: async ({ page }, use) => { await use(new EditProfilePage(page)) } diff --git a/test-automation/pages/pay-admin-page.js b/test-automation/pages/pay-admin-page.js new file mode 100644 index 00000000..0a282c2b --- /dev/null +++ b/test-automation/pages/pay-admin-page.js @@ -0,0 +1,34 @@ +/** + * ============================================================================ + * Pay Admin Page - Page Object Model + * ============================================================================ + * + * File: pages/pay-admin-page.js + * Purpose: Encapsulates Pay Admin page interactions and selectors + * author: Anish Batra + * Created: June 26, 2026 + * + * Description: + * This page object provides methods and locators for the Pay Admin page. + * It follows the Page Object Model (POM) pattern for maintainable test code. + * ============================================================================ + */ +export class PayAdminPage { + constructor(page) { + this.page = page + this.ammount = page.locator('[id="amount"]') + this.code = page.locator('[id="code"]') + this.comments = page.locator('[id="comments"]') + this.saveButton = page.locator('[class="btn btn-primary"]') + } + + async createFeeCode() { + //TODO- will update later to use env variable for url + await this.page.goto(process.env.FEECODEURL) + await this.code.fill('220') + await this.ammount.fill('100') + await expect(this.comments).toBeVisible({ timeout: 10000 }) + await this.comments.fill('Test comments', {timeout: 10000}) + await this.saveButton.click({timeout: 10000}) + } +} \ No newline at end of file diff --git a/test-automation/tests/pay-admin-page.spec.js b/test-automation/tests/pay-admin-page.spec.js new file mode 100644 index 00000000..5cb6b8bd --- /dev/null +++ b/test-automation/tests/pay-admin-page.spec.js @@ -0,0 +1,30 @@ +/** + * ============================================================================ + * Staff Review Page Tests + * ============================================================================ + * + * File: tests/pay-admin-page.spec.js + * Purpose: End-to-end regression tests for Pay Admin page + * Created: June 26, 2026 + * author: Anish Batra + * Tagged: @regression (runs in npm run e2e:regression:test) + * + * Description: + * This test suite validates the pay admin functionality including: + * - Page navigation and URL verification + * - Element visibility (deactivate button) + * ============================================================================ + */ + +import { test } from '../fixtures.js' + +test.describe.serial('Pay Admin Tests', () => { + test.use({ storageState: { cookies: [], origins: [] } }) + test('validate pay admin functionality-create fee code', async ({ page, payAdminPage , loginPage }) => { + console.log('Test: Current URL before navigation:', page.url()) + console.log('Test: Cookies loaded:', (await page.context().cookies()).length) + // use credentials for Pay admin + await loginPage.loginWithIDIR(process.env.TEST_USERNAME_IDIR, process.env.TEST_PASSWORD_IDIR) + await payAdminPage.createFeeCode() + }) +}) \ No newline at end of file