Skip to content

Commit

Permalink
fix: correction-death
Browse files Browse the repository at this point in the history
  • Loading branch information
jamil314 committed Sep 30, 2024
1 parent 033bba0 commit 77ae8ea
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 33 deletions.
51 changes: 40 additions & 11 deletions e2e/testcases/correction-death/correct-death-record-10.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,14 @@ test.describe('10. Correct record - 10', () => {
test('10.1.1 Validate record audit page', async ({ page }) => {
/*
* Expected result: should
* - See in header deceased's name and correct record option
* - See in header deceased's name and action button
* - Navigate to record audit page
* - See status, event, trackingId, BRN, DOB, Place of birth, Informant contact
* - See status, event, trackingId, BRN, DOB, Place of death, Informant contact
*/
await expect(
page.getByText(formatName(declaration.deceased.name[0]))
).toBeVisible()
await expect(
page.getByRole('button', { name: 'Correct record' })
).toBeVisible()
await expect(page.getByRole('button', { name: 'Action' })).toBeVisible()

expect(page.url().includes('record-audit')).toBeTruthy()

Expand All @@ -114,14 +112,25 @@ test.describe('10. Correct record - 10', () => {
)}
`)
).toBeVisible()
// await expect(page.getByText(`Place of birth${}`)).toBeVisible()
await expect(
page.getByText(
'Place of deathKalela Health Post, Afue, Sulaka, Farajaland'
)
).toBeVisible()
await expect(
page.getByText(declaration.registration.contactEmail)
).toBeVisible()
})

test('10.1.2 Validate correction requester page', async ({ page }) => {
await page.getByRole('button', { name: 'Correct record' }).click()
await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()

/*
* Expected result: should
Expand All @@ -135,7 +144,14 @@ test.describe('10. Correct record - 10', () => {
test('10.1.3 Validate identity verification page for Informant (SPOUSE)', async ({
page
}) => {
await page.getByRole('button', { name: 'Correct record' }).click()
await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()

await page.getByLabel('Informant (SPOUSE)').check()
await page.getByRole('button', { name: 'Continue' }).click()
Expand Down Expand Up @@ -204,7 +220,14 @@ test.describe('10. Correct record - 10', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Correct record' }).click()
await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()

await page.getByLabel('Informant (SPOUSE)').check()
await page.getByRole('button', { name: 'Continue' }).click()
Expand Down Expand Up @@ -926,8 +949,14 @@ test.describe('10. Correct record - 10', () => {
})

test('10.2.6.2 Correction review', async () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Review correction request/
})
.click()
/*
* Expected result: should show
* - Submitter
Expand Down
20 changes: 16 additions & 4 deletions e2e/testcases/correction-death/correct-death-record-11.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ test.describe.serial(' Correct record - 11', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Print certified copy/
})
.click()
await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
await page.getByRole('button', { name: 'No, make correction' }).click()
Expand Down Expand Up @@ -465,8 +471,14 @@ test.describe.serial(' Correct record - 11', () => {
})

test('11.8.2 Correction review', async () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Review correction request/
})
.click()
/*
* Expected result: should show
* - Submitter
Expand Down
34 changes: 28 additions & 6 deletions e2e/testcases/correction-death/correct-death-record-12.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,14 @@ test.describe.serial(' Correct record - 12', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Print certified copy/
})
.click()
await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
await page.getByRole('button', { name: 'Yes, print certificate' }).click()
Expand Down Expand Up @@ -149,12 +155,22 @@ test.describe.serial(' Correct record - 12', () => {
/*
* Expected result: should show correct record button
*/
await page.getByRole('button', { name: 'Action', exact: true }).click()
await expect(
page.getByRole('button', { name: 'Correct record', exact: true })
page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
).toBeVisible()

await page
.getByRole('button', { name: 'Correct record', exact: true })
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()
})
})
Expand Down Expand Up @@ -866,8 +882,14 @@ test.describe.serial(' Correct record - 12', () => {
})

test('12.8.2 Correction review', async () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Review correction request/
})
.click()
/*
* Expected result: should show
* - Submitter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,13 @@ test.describe.serial(' Correct record - 13', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.getByRole('button', { name: 'Correct record', exact: true })
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ test.describe.serial(' Correct record - 14', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()
await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Print certified copy/
})
.click()

await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
Expand Down
18 changes: 14 additions & 4 deletions e2e/testcases/correction-death/correct-death-record-15.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ test.describe.serial(' Correct record - 15', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Print certified copy/
})
.click()
await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
await page.getByRole('button', { name: 'Yes, print certificate' }).click()
Expand All @@ -109,9 +115,13 @@ test.describe.serial(' Correct record - 15', () => {
/*
* Expected result: should show correct record button
*/

await page.getByRole('button', { name: 'Action' }).click()
await page
.getByRole('button', { name: 'Correct record', exact: true })
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ test.describe.serial(' Correct record - 16', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Action' }).click()
await page
.getByRole('button', { name: 'Correct record', exact: true })
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ test.describe.serial(' Correct record - 17', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()
await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Print certified copy/
})
.click()

await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
Expand Down
18 changes: 14 additions & 4 deletions e2e/testcases/correction-death/correct-death-record-18.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
createPIN,
expectAddress,
expectOutboxToBeEmpty,
formatDateTo_ddMMMMyyyy,
formatName,
getToken,
goBackToReview,
Expand Down Expand Up @@ -82,7 +81,14 @@ test.describe.serial(' Correct record - 18', () => {
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()
await page.getByRole('button', { name: 'Action' }).click()
await page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Print certified copy/
})
.click()

await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
Expand Down Expand Up @@ -113,9 +119,13 @@ test.describe.serial(' Correct record - 18', () => {
/*
* Expected result: should show correct record button
*/

await page.getByRole('button', { name: 'Action' }).click()
await page
.getByRole('button', { name: 'Correct record', exact: true })
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: /Correct Record/
})
.click()
})
})
Expand Down

0 comments on commit 77ae8ea

Please sign in to comment.