Skip to content

Commit c6d2d70

Browse files
committed
fix v1 tests
1 parent 2151bec commit c6d2d70

File tree

56 files changed

+10
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+10
-91
lines changed

e2e/helpers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ import fetch from 'node-fetch'
1414

1515
export async function login(page: Page, username: string, password: string) {
1616
const token = await getToken(username, password)
17-
await page.goto(`${CLIENT_URL}?token=${token}`)
17+
await page.goto(`${CLIENT_URL}?token=${token}&V2_EVENTS=false`)
1818

1919
await expect(
2020
page.locator('#appSpinner').or(page.locator('#pin-input'))
2121
).toBeVisible()
22+
23+
await createPIN(page)
24+
25+
// Navigate to v1 frontpage
26+
await page.goto(`${CLIENT_URL}/registration-home`)
2227
return token
2328
}
2429

e2e/testcases/applications/17-validate-user-can-correct-a-record-from-audit-record-page.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ test.describe
6464
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
6565
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
6666
)
67-
await createPIN(page)
6867

6968
await page.getByRole('button', { name: 'Ready to print' }).click()
7069
await page.locator('#name_0').click()

e2e/testcases/birth/1-birth-event-declaration.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ test.describe('1. Birth event declaration', () => {
2323
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
2424
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
2525
)
26-
await createPIN(page)
2726
await page.click('#header_new_event')
2827
await expect(page.getByText('New Declaration')).toBeVisible()
2928
await expect(page.getByText('Event type')).toBeVisible()
@@ -441,7 +440,6 @@ test.describe('1. Birth event declaration', () => {
441440
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
442441
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
443442
)
444-
await createPIN(page)
445443
await page.click('#header_new_event')
446444
await page.getByLabel('Birth').click()
447445
await page.getByRole('button', { name: 'Continue' }).click()
@@ -502,7 +500,6 @@ test.describe('1. Birth event declaration', () => {
502500
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
503501
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
504502
)
505-
await createPIN(page)
506503
await page.click('#header_new_event')
507504
await page.getByLabel('Birth').click()
508505
await page.getByRole('button', { name: 'Continue' }).click()

e2e/testcases/birth/2-validate-the-child-details-page.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from '@playwright/test'
2-
import { createPIN, goToSection, login } from '../../helpers'
2+
import { goToSection, login } from '../../helpers'
33
import { CREDENTIALS } from '../../constants'
44

55
test.describe("2. Validate the child's details page", () => {
@@ -9,7 +9,6 @@ test.describe("2. Validate the child's details page", () => {
99
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
1010
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
1111
)
12-
await createPIN(page)
1312

1413
await page.click('#header_new_event')
1514

e2e/testcases/birth/declarations/birth-declaration-1.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ test.describe.serial('1. Birth declaration case - 1', () => {
9393
CREDENTIALS.FIELD_AGENT.USERNAME,
9494
CREDENTIALS.FIELD_AGENT.PASSWORD
9595
)
96-
await createPIN(page)
96+
9797
await page.click('#header_new_event')
9898
await page.getByLabel('Birth').click()
9999
await page.getByRole('button', { name: 'Continue' }).click()
@@ -520,7 +520,6 @@ test.describe.serial('1. Birth declaration case - 1', () => {
520520
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
521521
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
522522
)
523-
await createPIN(page)
524523
await page.getByRole('button', { name: 'Ready for review' }).click()
525524

526525
await expect(

e2e/testcases/birth/declarations/birth-declaration-10.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ test.describe.serial('10. Birth declaration case - 10', () => {
4545
CREDENTIALS.FIELD_AGENT.USERNAME,
4646
CREDENTIALS.FIELD_AGENT.PASSWORD
4747
)
48-
await createPIN(page)
4948
await page.click('#header_new_event')
5049
await page.getByLabel('Birth').click()
5150
await page.getByRole('button', { name: 'Continue' }).click()
@@ -218,7 +217,6 @@ test.describe.serial('10. Birth declaration case - 10', () => {
218217
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
219218
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
220219
)
221-
await createPIN(page)
222220
await page.getByRole('button', { name: 'In Progress' }).click()
223221
await page.getByRole('button', { name: 'Field Agents' }).click()
224222

e2e/testcases/birth/declarations/birth-declaration-2.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ test.describe.serial('2. Birth declaration case - 2', () => {
108108
CREDENTIALS.FIELD_AGENT.USERNAME,
109109
CREDENTIALS.FIELD_AGENT.PASSWORD
110110
)
111-
await createPIN(page)
112111
await page.click('#header_new_event')
113112
await page.getByLabel('Birth').click()
114113
await page.getByRole('button', { name: 'Continue' }).click()
@@ -565,7 +564,6 @@ test.describe.serial('2. Birth declaration case - 2', () => {
565564
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
566565
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
567566
)
568-
await createPIN(page)
569567
await page.getByRole('button', { name: 'Ready for review' }).click()
570568

571569
await expect(

e2e/testcases/birth/declarations/birth-declaration-3.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ test.describe.serial('3. Birth declaration case - 3', () => {
127127
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
128128
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
129129
)
130-
await createPIN(page)
131130
await page.click('#header_new_event')
132131
await page.getByLabel('Birth').click()
133132
await page.getByRole('button', { name: 'Continue' }).click()
@@ -751,7 +750,6 @@ test.describe.serial('3. Birth declaration case - 3', () => {
751750
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
752751
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
753752
)
754-
await createPIN(page)
755753
await page.getByRole('button', { name: 'Ready for review' }).click()
756754

757755
await expect(

e2e/testcases/birth/declarations/birth-declaration-4.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ test.describe.serial('4. Birth declaration case - 4', () => {
127127
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
128128
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
129129
)
130-
await createPIN(page)
131130
await page.click('#header_new_event')
132131
await page.getByLabel('Birth').click()
133132
await page.getByRole('button', { name: 'Continue' }).click()
@@ -670,7 +669,6 @@ test.describe.serial('4. Birth declaration case - 4', () => {
670669
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
671670
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
672671
)
673-
await createPIN(page)
674672
await page.getByRole('button', { name: 'Ready for review' }).click()
675673

676674
await expect(

e2e/testcases/birth/declarations/birth-declaration-5.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ test.describe.serial('5. Birth declaration case - 5', () => {
103103
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
104104
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
105105
)
106-
await createPIN(page)
107106
await page.click('#header_new_event')
108107
await page.getByLabel('Birth').click()
109108
await page.getByRole('button', { name: 'Continue' }).click()

0 commit comments

Comments
 (0)