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
15 changes: 15 additions & 0 deletions test-automation/pages/pay-admin-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class PayAdminPage {
this.page = page
this.ammount = page.locator('[id="amount"]')
this.code = page.locator('[id="code"]')
this.description = page.locator('[id="description"]')
this.comments = page.locator('[id="comments"]')
this.saveButton = page.locator('[class="btn btn-primary"]')
this.feeSchedule = page.getByText('Fee Schedule')
Expand All @@ -26,6 +27,8 @@ export class PayAdminPage {
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')
this.corpTypeLink = page.getByRole('link', { name: 'Corp Type' })
this.successMessage = page.getByText('Record was successfully created.')


}
Expand All @@ -50,4 +53,16 @@ export class PayAdminPage {
await this.gstAddedToStatutoryFeesFlag.click({timeout: 10000})
await this.gstAddedToServicesFeesFlag.click({timeout: 10000})
}

async createCorpType() {
//TODO- will update later to use env variable for url
await this.page.goto(process.env.FEECODEURL)
await this.corpTypeLink.click({timeout: 10000})
await this.createLink.click({timeout: 10000})
await this.code.fill('220')
await this.description.fill('anish test automation', {timeout: 10000})
await this.comments.fill('anish test automation comments', {timeout: 10000})
await this.saveButton.click({timeout: 10000})
await expect(this.successMessage).toBeVisible({ timeout: 10000 })
}
}
10 changes: 9 additions & 1 deletion test-automation/tests/pay-admin-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@ test.describe.serial('Pay Admin Tests', () => {
await payAdminPage.createFeeCode()
})

test.use({ storageState: { cookies: [], origins: [] } })
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()
})

test('validate pay admin functionality-create corp type', 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 (IDIR)
await loginPage.loginWithIDIR(process.env.TEST_USERNAME_IDIR, process.env.TEST_PASSWORD_IDIR)
await payAdminPage.createCorpType()
})
})
Loading