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
19 changes: 19 additions & 0 deletions test-automation/pages/pay-admin-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ export class PayAdminPage {
this.code = page.locator('[id="code"]')
this.comments = page.locator('[id="comments"]')
this.saveButton = page.locator('[class="btn btn-primary"]')
this.feeSchedule = page.getByText('Fee Schedule')
this.createLink = page.getByRole('link', { name: 'Create' })
this.variableFeeFlag = page.getByText('Variable Fee Flag')
this.showOnPriceListFlag = page.getByText('Show on Price List')
this.gstAddedToStatutoryFeesFlag = page.getByText('GST Added to Statutory Fees')
this.gstAddedToServicesFeesFlag = page.getByText('GST Added to Services Fees')


}

async createFeeCode() {
Expand All @@ -31,4 +39,15 @@ export class PayAdminPage {
await this.comments.fill('Test comments', {timeout: 10000})
await this.saveButton.click({timeout: 10000})
}

async validateFeeSchedule() {
//TODO- will update later to use env variable for url
await this.page.goto(process.env.FEECODEURL)
await this.feeSchedule.click({timeout: 10000})
await this.createLink.click({timeout: 10000})
await this.variableFeeFlag.click({timeout: 10000})
await this.showOnPriceListFlag.click({timeout: 10000})
await this.gstAddedToStatutoryFeesFlag.click({timeout: 10000})
await this.gstAddedToServicesFeesFlag.click({timeout: 10000})
}
}
9 changes: 9 additions & 0 deletions test-automation/tests/pay-admin-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@ test.describe.serial('Pay Admin Tests', () => {
await loginPage.loginWithIDIR(process.env.TEST_USERNAME_IDIR, process.env.TEST_PASSWORD_IDIR)
await payAdminPage.createFeeCode()
})

test.use({ storageState: { cookies: [], origins: [] } })
test('validate pay admin functionality-validate fee schedule', 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.validateFeeSchedule()
})
})
Loading