diff --git a/e2e/testcases/applications/correction/correct-record-1.spec.ts b/e2e/testcases/applications/correction/correct-record-1.spec.ts index bb29b537a..67459d911 100644 --- a/e2e/testcases/applications/correction/correct-record-1.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-1.spec.ts @@ -917,7 +917,6 @@ test.describe('1. Correct record - 1', () => { timeout: 1000 * 30 } ) - await expect( page.getByText( updatedChildDetails.firstNames + @@ -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() + }) }) }) }) diff --git a/e2e/testcases/applications/correction/correct-record-2.spec.ts b/e2e/testcases/applications/correction/correct-record-2.spec.ts index 9343767c3..4eef57556 100644 --- a/e2e/testcases/applications/correction/correct-record-2.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-2.spec.ts @@ -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 @@ -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() + }) }) }) diff --git a/e2e/testcases/applications/correction/correct-record-3.spec.ts b/e2e/testcases/applications/correction/correct-record-3.spec.ts index c5081d6f0..896b05511 100644 --- a/e2e/testcases/applications/correction/correct-record-3.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-3.spec.ts @@ -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() + }) }) }) diff --git a/e2e/testcases/applications/correction/correct-record-4.spec.ts b/e2e/testcases/applications/correction/correct-record-4.spec.ts index a0a451490..ab8bd5600 100644 --- a/e2e/testcases/applications/correction/correct-record-4.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-4.spec.ts @@ -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() + }) }) diff --git a/e2e/testcases/applications/correction/correct-record-5.spec.ts b/e2e/testcases/applications/correction/correct-record-5.spec.ts index 9d7bdcb29..ac485b3ec 100644 --- a/e2e/testcases/applications/correction/correct-record-5.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-5.spec.ts @@ -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() + }) }) diff --git a/e2e/testcases/applications/correction/correct-record-6.spec.ts b/e2e/testcases/applications/correction/correct-record-6.spec.ts index ea7abcce1..74d2c12d7 100644 --- a/e2e/testcases/applications/correction/correct-record-6.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-6.spec.ts @@ -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() + }) }) diff --git a/e2e/testcases/applications/correction/correct-record-7.spec.ts b/e2e/testcases/applications/correction/correct-record-7.spec.ts index 44dfcf321..2bbe045af 100644 --- a/e2e/testcases/applications/correction/correct-record-7.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-7.spec.ts @@ -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() + }) }) diff --git a/e2e/testcases/applications/correction/correct-record-8.spec.ts b/e2e/testcases/applications/correction/correct-record-8.spec.ts index 76fcea73b..a4638331b 100644 --- a/e2e/testcases/applications/correction/correct-record-8.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-8.spec.ts @@ -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() + }) }) diff --git a/e2e/testcases/applications/correction/correct-record-9.spec.ts b/e2e/testcases/applications/correction/correct-record-9.spec.ts index 8fe54a1e2..6805b8ceb 100644 --- a/e2e/testcases/applications/correction/correct-record-9.spec.ts +++ b/e2e/testcases/applications/correction/correct-record-9.spec.ts @@ -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() + }) })