Skip to content

Commit

Permalink
refactor: record correction - 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jamil314 committed Jun 11, 2024
1 parent f78e0b7 commit c836461
Showing 1 changed file with 55 additions and 49 deletions.
104 changes: 55 additions & 49 deletions e2e/testcases/applications/correction/correct-record-3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,63 +87,69 @@ test.describe.serial(' Correct record - 3', () => {
.fetchBirthRegistration as BirthDeclaration
})

test('3.1 Print > Ready to issue', async () => {
await login(page, 'f.katongo', 'test')
await createPIN(page)

await page.getByPlaceholder('Search for a tracking ID').fill(trackingId)
await page.getByPlaceholder('Search for a tracking ID').press('Enter')
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

await page.getByRole('button', { name: 'Print', exact: true }).click()
test.describe('3.1 Print > Ready to issue', async () => {
test('3.1.1 Print', async () => {
await login(page, 'f.katongo', 'test')
await createPIN(page)

await page.getByPlaceholder('Search for a tracking ID').fill(trackingId)
await page.getByPlaceholder('Search for a tracking ID').press('Enter')
await page.locator('#ListItemAction-0-icon').click()
await page.locator('#name_0').click()

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

await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
await page.getByRole('button', { name: 'Yes, print certificate' }).click()
await page.getByRole('button', { name: 'Print', exact: true }).click()
})

await page.getByLabel('Print in advance').check()
await page.getByRole('button', { name: 'Continue' }).click()
await page.getByRole('button', { name: 'Yes, print certificate' }).click()
await page.getByRole('button', { name: 'Print', exact: true }).click()
test('3.1.2 Ready to issue', async () => {
await page.getByRole('button', { name: 'Ready to issue' }).click()

await page.getByRole('button', { name: 'Ready to issue' }).click()
/*
* Expected result: should
* - be navigated to ready to isssue tab
* - include the declaration in this tab
*/
expect(page.url().includes('registration-home/readyToIssue'))
await expect(page.locator('#navigation_outbox')).not.toContainText('1', {
timeout: 1000 * 30
})

/*
* Expected result: should
* - be navigated to ready to isssue tab
* - include the declaration in this tab
*/
expect(page.url().includes('registration-home/readyToIssue'))
await expect(page.locator('#navigation_outbox')).not.toContainText('1', {
timeout: 1000 * 30
await expect(
page.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
).toBeVisible()
})

await expect(
page.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
).toBeVisible()

await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()
test('3.1.3 Record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show correct record button
*/
await expect(
page.getByRole('button', { name: 'Correct record', exact: true })
).toBeVisible()
/*
* Expected result: should show correct record button
*/
await expect(
page.getByRole('button', { name: 'Correct record', exact: true })
).toBeVisible()

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

test('3.2 Correction requester: child', async () => {
Expand Down

0 comments on commit c836461

Please sign in to comment.