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 @@ -24,6 +24,7 @@ import { TransactionsPage } from './pages/transactions-page.js'
import { GovmAccountCreationPage } from './pages/govm-account-creation-page.js'
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'

const test = base.extend({
loginPage: async ({ page }, use) => {
Expand Down Expand Up @@ -53,6 +54,9 @@ const test = base.extend({
},
bcrosAccountCreationPage: async ({ page }, use) => {
await use(new BcrosAccountCreationPage(page))
},
manageEFTPaymentsPage: async ({ page }, use) => {
await use(new ManageEFTPaymentsPage(page))
}
})

Expand Down
58 changes: 58 additions & 0 deletions test-automation/pages/manage-eft-payments-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* ============================================================================
* Manage EFT Payments Page - Page Object Model
* ============================================================================
*
* File: pages/manage-eft-payments-page.js
* Purpose: Encapsulates Manage EFT Payments page interactions and selectors
* author: Anish Batra
* Created: May 01, 2026
*
* Description:
* This page object provides methods and locators for the Manage EFT Payments page.
* It follows the Page Object Model (POM) pattern for maintainable test code.
* ============================================================================
*/

import { expect } from '@playwright/test'

export class ManageEFTPaymentsPage {
constructor(page) {
this.page = page
this.manageEFTPaymentsButton = page.getByText('Manage EFT Payments')
this.bankShortNameFilterInput = page.locator('[placeholder="Bank Short Name"]')
this.viewDetailsButton = page.getByText(' View Details ')
this.unlinkAccountButton = page.getByText('Unlink Account')
this.unlinkAccountConfirmationText = page.getByText(' The link with this account will be removed. ')
this.confirmButton = page.getByText(' Confirm ')
this.linkToAccountButton = page.getByText(' Link to Account ')
this.accountID = page.locator('[class="v-select__selections"]>input')
this.arrowWithApplyPaymentButton = page.locator('[class="more-actions"]')
this.selectAccountToLink = page.locator('[role="option"]')
this.linkAccountButtonOnConfirmationPopup = page.getByText(' Link Account ')
this.cancelPaymentButton = page.getByText(' Cancel Payment ')
}

async accountUnlinkAndLink() {
await this.manageEFTPaymentsButton.click({timeout: 60000})
await this.page.waitForTimeout(8000)
await this.bankShortNameFilterInput.first().pressSequentially('KENLI013')
await this.page.waitForTimeout(5000) // wait for filter to apply
await this.viewDetailsButton.click({timeout: 60000})
await this.arrowWithApplyPaymentButton.click({timeout: 60000})
await this.unlinkAccountButton.click({timeout: 60000})
await expect(this.unlinkAccountConfirmationText).toBeVisible({timeout: 60000})
await this.confirmButton.click({timeout: 60000})
await this.linkToAccountButton.click({timeout: 60000})
await this.accountID.click({timeout: 60000})
await this.accountID.fill('2955')
await this.selectAccountToLink.click({timeout: 60000})
await this.page.waitForTimeout(2000)
await this.linkAccountButtonOnConfirmationPopup.click({timeout: 60000})
await expect(this.page.locator('tbody').first()).toContainText('2955',{timeout: 60000})
await this.cancelPaymentButton.click({timeout: 60000})
await this.page.waitForTimeout(3000)
await this.confirmButton.click({timeout: 60000})
await this.page.waitForTimeout(2000)
}
}
33 changes: 33 additions & 0 deletions test-automation/tests/manage-eft-payments.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* ============================================================================
* Manage EFT Payments Page Tests
* ============================================================================
*
* File: tests/manage-eft-payments.spec.js
* Purpose: End-to-end regression tests for Manage EFT Payments page
* Created: May 01, 2026
* author: Anish Batra
* Tagged: @regression (runs in npm run e2e:regression:test)
*
* Description:
* This test suite validates the Manage EFT Payments page functionality including:
* - Page navigation and URL verification
* - Element visibility (deactivate button)
* ============================================================================
*/

import { test } from '../fixtures.js'

test.describe('Manage EFT Payments Page Tests', () => {

//use login type as idir to run this test
test.use({ storageState: { cookies: [], origins: [] } }) // clears saved cookies
// eslint-disable-next-line max-len
test('should validate account linkage and unlink for EFT Payments correctly', async ({ page, loginPage, manageEFTPaymentsPage }) => {
console.log('Test: Current URL before navigation:', page.url())
console.log('Test: Cookies loaded:', (await page.context().cookies()).length)
await page.goto(process.env.EFT_PAYMENTS_URL,{timeout: 180000})
await loginPage.loginWithIDIR('<Use Test IDIR Username>','<Use Test IDIR Password>')
await manageEFTPaymentsPage.accountUnlinkAndLink()
})
})
Loading