Skip to content

Commit

Permalink
amend: validated correction in record audit
Browse files Browse the repository at this point in the history
  • Loading branch information
jamil314 committed Jun 13, 2024
1 parent 9408cc2 commit b8d8f91
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 6 deletions.
31 changes: 30 additions & 1 deletion e2e/testcases/applications/correction/correct-record-1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,6 @@ test.describe('1. Correct record - 1', () => {
timeout: 1000 * 30
}
)

await expect(
page.getByText(
updatedChildDetails.firstNames +
Expand All @@ -926,6 +925,36 @@ test.describe('1. Correct record - 1', () => {
)
).toBeVisible()
})
test('1.2.6.4 Validate history in record audit', async () => {
await page
.getByText(
updatedChildDetails.firstNames +
' ' +
updatedChildDetails.familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Correction requested
* - Correction approved
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Correction requested' })
).toBeVisible()

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Correction approved' })
).toBeVisible()
})
})
})
})
45 changes: 43 additions & 2 deletions e2e/testcases/applications/correction/correct-record-2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,10 +929,15 @@ test.describe.serial(' Correct record - 2', () => {
).toBeVisible()
})

test('2.8.3 Approve correction', async () => {
await page.getByRole('button', { name: 'Approve', exact: true }).click()
test('2.8.3 Reject correction', async () => {
await page.getByRole('button', { name: 'Reject', exact: true }).click()
await page
.locator('#rejectionRaisonOfCorrection')
.fill('Wrong information')
await page.getByRole('button', { name: 'Confirm', exact: true }).click()

await page.waitForTimeout(500)

/*
* Expected result: should
* - be navigated to ready to print tab
Expand All @@ -951,5 +956,41 @@ test.describe.serial(' Correct record - 2', () => {
)
).toBeVisible()
})

test('2.8.4 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Correction requested
* - Correction rejected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Correction requested' })
).toBeVisible()

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Correction rejected' })
).toBeVisible()
})
})
})
36 changes: 36 additions & 0 deletions e2e/testcases/applications/correction/correct-record-3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,5 +975,41 @@ test.describe.serial(' Correct record - 3', () => {
)
).toBeVisible()
})

test('3.8.4 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Correction requested
* - Correction approved
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Correction requested' })
).toBeVisible()

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Correction approved' })
).toBeVisible()
})
})
})
28 changes: 28 additions & 0 deletions e2e/testcases/applications/correction/correct-record-4.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,4 +772,32 @@ test.describe.serial(' Correct record - 4', () => {
)
).toBeVisible()
})
test('4.8 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Record corrected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Record corrected' })
).toBeVisible()
})
})
33 changes: 30 additions & 3 deletions e2e/testcases/applications/correction/correct-record-5.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,37 @@ test.describe.serial(' Correct record - 5', () => {

await expect(
page.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
updatedChildDetails.firstNames + ' ' + updatedChildDetails.familyName
)
).toBeVisible()
})
test.skip('5.8 Validate history in record audit', async () => {
await page
.getByText(
updatedChildDetails.firstNames + ' ' + updatedChildDetails.familyName
)
.click()

await page.getByLabel('Assign record').click()

if (await page.getByText('Unassign record?', { exact: true }).isVisible())
await page.getByRole('button', { name: 'Cancel', exact: true }).click()
else if (
await page
.getByRole('button', { name: 'Assign', exact: true })
.isVisible()
)
await page.getByRole('button', { name: 'Assign', exact: true }).click()

/*
* Expected result: should show in task history
* - Record corrected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Record corrected' })
).toBeVisible()
})
})
28 changes: 28 additions & 0 deletions e2e/testcases/applications/correction/correct-record-6.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,4 +794,32 @@ test.describe.serial(' Correct record - 6', () => {
)
).toBeVisible()
})
test('6.8 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Record corrected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Record corrected' })
).toBeVisible()
})
})
28 changes: 28 additions & 0 deletions e2e/testcases/applications/correction/correct-record-7.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,4 +785,32 @@ test.describe.serial(' Correct record - 7', () => {
)
).toBeVisible()
})
test('7.8 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Record corrected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Record corrected' })
).toBeVisible()
})
})
31 changes: 31 additions & 0 deletions e2e/testcases/applications/correction/correct-record-8.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,4 +760,35 @@ test.describe.serial(' Correct record - 8', () => {
)
).toBeVisible()
})
test.skip('8.8 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

await page.getByLabel('Assign record').click()

if (await page.getByText('Unassign record?', { exact: true }).isVisible())
await page.getByRole('button', { name: 'Cancel', exact: true }).click()
else if (
await page
.getByRole('button', { name: 'Assign', exact: true })
.isVisible()
)
await page.getByRole('button', { name: 'Assign', exact: true }).click()

/*
* Expected result: should show in task history
* - Record corrected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Record corrected' })
).toBeVisible()
})
})
28 changes: 28 additions & 0 deletions e2e/testcases/applications/correction/correct-record-9.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,4 +797,32 @@ test.describe.serial(' Correct record - 9', () => {
)
).toBeVisible()
})
test('9.8 Validate history in record audit', async () => {
await page
.getByText(
declaration.child.name[0].firstNames +
' ' +
declaration.child.name[0].familyName
)
.click()

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

/*
* Expected result: should show in task history
* - Record corrected
*/

await expect(
page
.locator('#listTable-task-history')
.getByRole('button', { name: 'Record corrected' })
).toBeVisible()
})
})

0 comments on commit b8d8f91

Please sign in to comment.