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
16 changes: 16 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,9 @@ export class PayAdminPage {
this.page = page
this.ammount = page.locator('[id="amount"]')
this.code = page.locator('[id="code"]')
this.distributionCode = page.getByText('Distribution Code')
this.distributionCodeName = page.locator('[id="name"]')
this.distributionClientCode = page.locator('[id="client"]')
this.description = page.locator('[id="description"]')
this.comments = page.locator('[id="comments"]')
this.saveButton = page.locator('[class="btn btn-primary"]')
Expand Down Expand Up @@ -65,4 +68,17 @@ export class PayAdminPage {
await this.saveButton.click({timeout: 10000})
await expect(this.successMessage).toBeVisible({ timeout: 10000 })
}

async createDistributionCode() {
//TODO- will update later to use env variable for url
await this.page.goto(process.env.FEECODEURL)
await this.createLink.click({timeout: 10000})
await this.distributionCodeName.fill('anish test automation', {timeout: 10000})
await this.distributionClientCode.fill('220', {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 })
}


}
8 changes: 8 additions & 0 deletions test-automation/tests/pay-admin-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ test.describe.serial('Pay Admin Tests', () => {
await loginPage.loginWithIDIR(process.env.TEST_USERNAME_IDIR, process.env.TEST_PASSWORD_IDIR)
await payAdminPage.createCorpType()
})

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