Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test-automation/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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))
}
Expand Down
34 changes: 34 additions & 0 deletions test-automation/pages/pay-admin-page.js
Original file line number Diff line number Diff line change
@@ -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})
}
}
30 changes: 30 additions & 0 deletions test-automation/tests/pay-admin-page.spec.js
Original file line number Diff line number Diff line change
@@ -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()
})
})
Loading