Skip to content

Commit

Permalink
Merge pull request #1092 from opencrvs/fix/add-test-case-for-changes-…
Browse files Browse the repository at this point in the history
…to-review-declaration
  • Loading branch information
makelicious authored Aug 20, 2024
2 parents b3d0b3d + dd4f664 commit 95d381a
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 63 deletions.
49 changes: 43 additions & 6 deletions e2e/testcases/birth/8-validate-declaration-review-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ test.describe.serial('8. Validate declaration review page', () => {
})

test.describe('8.1.1 Navigate to declaration preview page', async () => {
test('8.1.1.1 Verify informations added in previous pages', async () => {
test('8.1.1.1 Verify information added on previous pages', async () => {
goToSection(page, 'preview')

/*
Expand Down Expand Up @@ -975,7 +975,7 @@ test.describe.serial('8. Validate declaration review page', () => {
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await page.getByRole('button', { name: 'Review', exact: true }).click()
})
test('8.2.1.1 Verify informations added in previous pages', async () => {
test('8.2.1.1 Verify information added on previous pages', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -1304,7 +1304,7 @@ test.describe.serial('8. Validate declaration review page', () => {
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await page.getByRole('button', { name: 'Review', exact: true }).click()
})
test('8.3.1.1 Verify informations added in previous pages', async () => {
test('8.3.1.1 Verify information added on previous pages', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -1576,9 +1576,33 @@ test.describe.serial('8. Validate declaration review page', () => {
)
})

test.describe('8.3.2 Click any "Change" link', async () => {
test.skip('Skipped for now', async () => {})
const newFamilyNameForChild = faker.name.lastName('male')

test("8.3.2.1 Update child's family name", async () => {
await page
.locator('#child-content #Full')
.getByRole('button', { name: 'Change' })
.click()

await page.getByRole('button', { name: 'Continue' }).click()

await page.locator('#familyNameEng').fill(newFamilyNameForChild)

await page.getByRole('button', { name: 'Back to review' }).click()
})

test("8.3.2.2 Review child's changed family name", async () => {
await expect(
page.locator('#child-content #Full [data-test-id="row-value-Full"]')
).toContainText(
`${declaration.child.name.firstNames} ${declaration.child.name.familyName}
${declaration.child.name.firstNames} ${newFamilyNameForChild}`,
{
useInnerText: true // makes line break intentional
}
)
})

test.describe('8.3.3 Validate supporting document', async () => {
test.skip('Skipped for now', async () => {})
})
Expand Down Expand Up @@ -1613,9 +1637,22 @@ test.describe.serial('8. Validate declaration review page', () => {
*/
await expect(
page.getByRole('button', {
name: `${declaration.child.name.firstNames} ${declaration.child.name.familyName}`
name: `${declaration.child.name.firstNames} ${newFamilyNameForChild}`
})
).toBeVisible()

expect(
page
.locator('div')
.filter({
has: page.getByRole('button', {
name: `${declaration.child.name.firstNames} ${newFamilyNameForChild}`
})
})
.filter({
hasText: /seconds ago/ // should match the registration time
})
).toHaveCount(1)
})
})
})
6 changes: 3 additions & 3 deletions e2e/testcases/birth/declarations/birth-declaration-1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test.describe.serial('1. Birth declaration case - 1', () => {
await page.close()
})

test.describe('1.1 Declaratin started by FA', async () => {
test.describe('1.1 Declaration started by FA', async () => {
test.beforeAll(async () => {
await login(page, 'k.bwalya', 'test')
await createPIN(page)
Expand Down Expand Up @@ -254,7 +254,7 @@ test.describe.serial('1. Birth declaration case - 1', () => {
goToSection(page, 'preview')
})

test('1.1.6 Verify informations in preview page', async () => {
test('1.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -549,7 +549,7 @@ test.describe.serial('1. Birth declaration case - 1', () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()
})

test('1.2.2 Verify informations in review page', async () => {
test('1.2.2 Verify information on review page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/birth/declarations/birth-declaration-10.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test.describe.serial('10. Birth declaration case - 10', () => {
goToSection(page, 'preview')
})

test('10.1.6 Verify informations in preview page', async () => {
test('10.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -207,7 +207,7 @@ test.describe.serial('10. Birth declaration case - 10', () => {
await page.getByRole('button', { name: 'Update', exact: true }).click()
})

test('10.2.2 Verify informations in preview page', async () => {
test('10.2.2 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
6 changes: 3 additions & 3 deletions e2e/testcases/birth/declarations/birth-declaration-2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test.describe.serial('2. Birth declaration case - 2', () => {
await page.close()
})

test.describe('2.1 Declaratin started by FA', async () => {
test.describe('2.1 Declaration started by FA', async () => {
test.beforeAll(async () => {
await login(page, 'k.bwalya', 'test')
await createPIN(page)
Expand Down Expand Up @@ -302,7 +302,7 @@ test.describe.serial('2. Birth declaration case - 2', () => {
goToSection(page, 'preview')
})

test('2.1.6 Verify informations in preview page', async () => {
test('2.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -608,7 +608,7 @@ test.describe.serial('2. Birth declaration case - 2', () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()
})

test('2.2.2 Verify informations in review page', async () => {
test('2.2.2 Verify information on review page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
6 changes: 3 additions & 3 deletions e2e/testcases/birth/declarations/birth-declaration-3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test.describe.serial('3. Birth declaration case - 3', () => {
await page.close()
})

test.describe('3.1 Declaratin started by RA', async () => {
test.describe('3.1 Declaration started by RA', async () => {
test.beforeAll(async () => {
await login(page, 'f.katongo', 'test')
await createPIN(page)
Expand Down Expand Up @@ -407,7 +407,7 @@ test.describe.serial('3. Birth declaration case - 3', () => {
goToSection(page, 'preview')
})

test('3.1.7 Verify informations in preview page', async () => {
test('3.1.7 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -778,7 +778,7 @@ test.describe.serial('3. Birth declaration case - 3', () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()
})

test('3.2.2 Verify informations in review page', async () => {
test('3.2.2 Verify information on review page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
6 changes: 3 additions & 3 deletions e2e/testcases/birth/declarations/birth-declaration-4.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ test.describe.serial('4. Birth declaration case - 4', () => {
await page.close()
})

test.describe('4.1 Declaratin started by RA', async () => {
test.describe('4.1 Declaration started by RA', async () => {
test.beforeAll(async () => {
await login(page, 'f.katongo', 'test')
await createPIN(page)
Expand Down Expand Up @@ -374,7 +374,7 @@ test.describe.serial('4. Birth declaration case - 4', () => {
goToSection(page, 'preview')
})

test('4.1.6 Verify informations in preview page', async () => {
test('4.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -741,7 +741,7 @@ test.describe.serial('4. Birth declaration case - 4', () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()
})

test('4.2.2 Verify informations in review page', async () => {
test('4.2.2 Verify information on review page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/birth/declarations/birth-declaration-5.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test.describe.serial('5. Birth declaration case - 5', () => {
await page.close()
})

test.describe('5.1 Declaratin started by Local Registrar', async () => {
test.describe('5.1 Declaration started by Local Registrar', async () => {
test.beforeAll(async () => {
await login(page, 'k.mweene', 'test')
await createPIN(page)
Expand Down Expand Up @@ -299,7 +299,7 @@ test.describe.serial('5. Birth declaration case - 5', () => {
goToSection(page, 'preview')
})

test('5.1.6 Verify informations in preview page', async () => {
test('5.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/birth/declarations/birth-declaration-6.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test.describe.serial('6. Birth declaration case - 6', () => {
await page.close()
})

test.describe('6.1 Declaratin started by National Registrar', async () => {
test.describe('6.1 Declaration started by National Registrar', async () => {
test.beforeAll(async () => {
await login(page, 'j.musonda', 'test')
await createPIN(page)
Expand Down Expand Up @@ -309,7 +309,7 @@ test.describe.serial('6. Birth declaration case - 6', () => {
goToSection(page, 'preview')
})

test('6.1.6 Verify informations in preview page', async () => {
test('6.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/birth/declarations/birth-declaration-7.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ test.describe.serial('7. Birth declaration case - 7', () => {
goToSection(page, 'preview')
})

test('7.1.7 Verify informations in preview page', async () => {
test('7.1.7 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down Expand Up @@ -254,7 +254,7 @@ test.describe.serial('7. Birth declaration case - 7', () => {
await page.getByRole('button', { name: 'Update', exact: true }).click()
})

test('7.2.2 Verify informations in preview page', async () => {
test('7.2.2 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's First Name
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/birth/declarations/birth-declaration-8.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test.describe.serial('8. Birth declaration case - 8', () => {
goToSection(page, 'preview')
})

test('8.1.6 Verify informations in preview page', async () => {
test('8.1.6 Verify information on preview page', async () => {
/*
* Expected result: should require
* - Child's First Name
Expand Down Expand Up @@ -274,7 +274,7 @@ test.describe.serial('8. Birth declaration case - 8', () => {
await page.getByRole('button', { name: 'Update', exact: true }).click()
})

test('8.2.2 Verify informations in preview page', async () => {
test('8.2.2 Verify information on preview page', async () => {
/*
* Expected result: should require
* - Child's First Name
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/birth/declarations/birth-declaration-9.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test.describe.serial('9. Birth declaration case - 9', () => {
goToSection(page, 'preview')
})

test('9.1.6 Verify informations in preview page', async () => {
test('9.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's Family Name
Expand Down Expand Up @@ -205,7 +205,7 @@ test.describe.serial('9. Birth declaration case - 9', () => {
await page.getByRole('button', { name: 'Update', exact: true }).click()
})

test('9.2.2 Verify informations in preview page', async () => {
test('9.2.2 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Child's Family Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test.describe.serial('8. Validate declaration review page', () => {
})

test.describe('8.1.1 Navigate to declaration preview page', async () => {
test('8.1.1.1 Verify informations added in previous pages', async () => {
test('8.1.1.1 Verify information added on previous pages', async () => {
goToSection(page, 'preview')

/*
Expand Down Expand Up @@ -737,7 +737,7 @@ test.describe.serial('8. Validate declaration review page', () => {
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await page.getByRole('button', { name: 'Review', exact: true }).click()
})
test('8.2.1.1 Verify informations added in previous pages', async () => {
test('8.2.1.1 Verify information added on previous pages', async () => {
/*
* Expected result: should include
* - Deceased's First Name
Expand Down Expand Up @@ -1274,7 +1274,7 @@ test.describe.serial('8. Validate declaration review page', () => {
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await page.getByRole('button', { name: 'Review', exact: true }).click()
})
test('8.3.1.1 Verify informations added in previous pages', async () => {
test('8.3.1.1 Verify information added on previous pages', async () => {
/*
* Expected result: should include
* - Deceased's First Name
Expand Down
6 changes: 3 additions & 3 deletions e2e/testcases/death/declaration/death-declaration-1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe.serial('1. Death declaration case - 1', () => {
await page.close()
})

test.describe('1.1 Declaratin started by FA', async () => {
test.describe('1.1 Declaration started by FA', async () => {
test.beforeAll(async () => {
await login(page, 'k.bwalya', 'test')
await createPIN(page)
Expand Down Expand Up @@ -209,7 +209,7 @@ test.describe.serial('1. Death declaration case - 1', () => {
goToSection(page, 'preview')
})

test('1.1.6 Verify informations in preview page', async () => {
test('1.1.6 Verify information on preview page', async () => {
/*
* Expected result: should include
* - Deceased's First Name
Expand Down Expand Up @@ -547,7 +547,7 @@ test.describe.serial('1. Death declaration case - 1', () => {
await page.getByRole('button', { name: 'Review', exact: true }).click()
})

test('1.2.2 Verify informations in review page', async () => {
test('1.2.2 Verify information on review page', async () => {
/*
* Expected result: should include
* - Deceased's First Name
Expand Down
6 changes: 3 additions & 3 deletions e2e/testcases/death/declaration/death-declaration-10.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test.describe.serial('10. Death declaration case - 10', () => {
await page.close()
})

test.describe('10.1 Declaratin started by FA', async () => {
test.describe('10.1 Declaration started by FA', async () => {
test.beforeAll(async () => {
await login(page, 'k.bwalya', 'test')
await createPIN(page)
Expand Down Expand Up @@ -60,7 +60,7 @@ test.describe.serial('10. Death declaration case - 10', () => {
goToSection(page, 'preview')
})

test('10.1.5 Verify informations in preview page', async () => {
test('10.1.5 Verify information on preview page', async () => {
/*
* Expected result: should require
* - Deceased's First Name
Expand Down Expand Up @@ -295,7 +295,7 @@ test.describe.serial('10. Death declaration case - 10', () => {
await page.getByRole('button', { name: 'Update', exact: true }).click()
})

test('10.2.2 Verify informations in review page', async () => {
test('10.2.2 Verify information on review page', async () => {
/*
* Expected result: should require
* - Deceased's First Name
Expand Down
Loading

0 comments on commit 95d381a

Please sign in to comment.