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
40 changes: 40 additions & 0 deletions test-automation/pages/manage-eft-payments-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ export class ManageEFTPaymentsPage {
this.selectAccountToLink = page.locator('[role="option"]')
this.linkAccountButtonOnConfirmationPopup = page.getByText(' Link Account ')
this.cancelPaymentButton = page.getByText(' Cancel Payment ')
this.initiateRefundButton = page.getByText(' Initiate Refund ')
this.issueACheckButton = page.getByText('Issue a cheque')
this.nextButton = page.getByText('Next')
this.refundAmountInput = page.locator('[data-test="refundAmount"]')
this.streetAddressInput = page.locator('[id="street-address-1"]')
this.firstAddressOption = page.getByText('1st-290 Dupuis St')
this.emailInput = page.locator('[data-test="email"]')
this.entityNameInput = page.locator('[data-test="entityName"]')
this.refundReasonInput = page.locator('[data-test="staffComment"]')
this.submitRefundRequestButton = page.getByText('Submit Refund Request')
this.declineButton = page.getByText(' Decline ')
this.declineBtnOnConfirmationPopup = page.locator('[data-test="btn-confirm-confirmation-dialog"]')
}

async accountUnlinkAndLink() {
Expand All @@ -55,4 +67,32 @@ export class ManageEFTPaymentsPage {
await this.confirmButton.click({timeout: 60000})
await this.page.waitForTimeout(2000)
}

async initiateRefund() {
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.initiateRefundButton.click({timeout: 60000})
await this.issueACheckButton.click({timeout: 60000})
await this.nextButton.click({timeout: 60000})
await this.refundAmountInput.fill('5')
await this.page.waitForTimeout(1000)
await this.streetAddressInput.fill('1 street')
await this.page.waitForTimeout(1000)
await this.page.keyboard.press('Space')
await this.page.waitForTimeout(1000)
await this.firstAddressOption.click({timeout: 10000})
await this.page.waitForTimeout(1000)
await this.emailInput.fill('anish@test.com')
await this.entityNameInput.fill('anishTestEntity')
await this.refundReasonInput.fill('Test Refund')
await this.submitRefundRequestButton.click({timeout: 60000})
await this.page.waitForTimeout(2000)
await expect(this.declineButton).toBeVisible({timeout: 60000})
await this.declineButton.click({timeout: 60000})
await this.declineBtnOnConfirmationPopup.click({timeout: 60000})
await this.page.waitForTimeout(2000)
}
}
33 changes: 33 additions & 0 deletions test-automation/tests/eft-initiate-refund.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-refund.spec.js
* Purpose: End-to-end regression tests for Manage EFT Refund page
* Created: May 06, 2026
* author: Anish Batra
* Tagged: @regression (runs in npm run e2e:regression:test)
*
* Description:
* This test suite validates the Manage EFT Refund page functionality including:
* - Page navigation and URL verification
* - Element visibility (deactivate button)
* ============================================================================
*/

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

test.describe('Manage EFT Refund 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 EFT Refund(using Check) 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.initiateRefund()
})
})
Loading