Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ce6aa0f
add edit role to all revelant roles
cibelius Dec 10, 2025
b246c08
fix translation
cibelius Dec 10, 2025
071381f
bring back editing tests
cibelius Dec 10, 2025
c8eaee8
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 10, 2025
13c0516
Merge remote-tracking branch 'origin/develop' into ocrvs-10939
cibelius Dec 10, 2025
8ef4ff6
fix tests
cibelius Dec 10, 2025
a9e3830
Merge remote-tracking branch 'origin/develop' into ocrvs-10939
cibelius Dec 10, 2025
8e98e08
Merge branch 'develop' into ocrvs-10939
cibelius Dec 10, 2025
9116adc
Merge remote-tracking branch 'origin/develop' into ocrvs-10939
cibelius Dec 10, 2025
018187b
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 10, 2025
e5ff22c
fix tests
cibelius Dec 11, 2025
1b4e333
Merge remote-tracking branch 'origin/develop' into ocrvs-10939
cibelius Dec 11, 2025
c7272ee
Merge branch 'develop' into ocrvs-10939
cibelius Dec 11, 2025
4476e4f
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 11, 2025
f41014b
asserts
cibelius Dec 11, 2025
1a5d200
add translations
cibelius Dec 11, 2025
84b9a0a
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 11, 2025
3223416
update roles snapshot
cibelius Dec 11, 2025
b8ce888
add french translation
cibelius Dec 12, 2025
89cb71f
assert comment
cibelius Dec 12, 2025
c5db938
fix tests
cibelius Dec 12, 2025
d148959
improve test case
cibelius Dec 12, 2025
bbd6ea5
switch user to local registrar
cibelius Dec 12, 2025
0d205b4
add validate flag config to declare action
cibelius Dec 12, 2025
e92fd9c
update toolkit
cibelius Dec 12, 2025
8e8bf1d
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 12, 2025
5213109
remove duplicate test
cibelius Dec 12, 2025
679587c
add missing translations
cibelius Dec 12, 2025
6bba337
remove validate request
cibelius Dec 12, 2025
9a9cc1a
remove validate requests
cibelius Dec 12, 2025
0126b2a
fix tests
cibelius Dec 12, 2025
709215b
Merge pull request #1181 from opencrvs/ocrvs-11271
Nil20 Dec 12, 2025
c664fe1
Merge remote-tracking branch 'origin/develop' into ocrvs-10939
cibelius Dec 13, 2025
74904df
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 13, 2025
5a0bad2
Merge remote-tracking branch 'origin/develop' into ocrvs-10939
cibelius Dec 13, 2025
a7f156f
fix merge conflict issue
cibelius Dec 13, 2025
a40aa20
fix test
cibelius Dec 13, 2025
7dc5239
upgrade toolkit
cibelius Dec 15, 2025
2ecca1c
Merge remote-tracking branch 'upstream/ocrvs-10939' into ocrvs-10939
cibelius Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,13 @@ export async function switchEventTab(page: Page, tab: 'Audit' | 'Record') {
/** Assert whether a button on the action menu exists and is enabled/disabled */
export async function validateActionMenuButton(
page: Page,
action: 'Declare' | 'Notify' | 'Approve declaration' | 'Register',
action:
| 'Declare'
| 'Notify'
| 'Approve declaration'
| 'Register'
| 'Declare with edits'
| 'Register with edits',
isEnabled = true
) {
await page.getByRole('button', { name: 'Action', exact: true }).click()
Expand All @@ -616,14 +622,22 @@ export async function selectDeclarationAction(
| 'Register'
| 'Reject'
| 'Delete declaration'
| 'Save & Exit',
| 'Save & Exit'
| 'Declare with edits'
| 'Register with edits',
confirm = true
) {
await page.getByRole('button', { name: 'Action', exact: true }).click()
await page.getByText(action, { exact: true }).click()

if (confirm) {
await page.getByRole('button', { name: action, exact: true }).click()
const confirmBtn = page.getByRole('button', { name: 'Confirm' })

if ((await confirmBtn.count()) > 0) {
await confirmBtn.click()
} else {
await page.getByRole('button', { name: action, exact: true }).click()
}
}
}

Expand Down
29 changes: 22 additions & 7 deletions e2e/testcases/action-menu/action-menu-options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { login, getToken } from '../../helpers'
import { CREDENTIALS } from '../../constants'
import { createDeclaration, Declaration } from '../test-data/birth-declaration'
import { ActionType } from '@opencrvs/toolkit/events'
import { selectAction } from '../../utils'

async function getActionMenuOptions(page: Page, declaration: Declaration) {
const childName = `${declaration['child.name'].firstname} ${declaration['child.name'].surname}`
Expand Down Expand Up @@ -32,8 +33,8 @@ test.describe('Action menu options', () => {

test.beforeAll(async () => {
const token = await getToken(
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
CREDENTIALS.FIELD_AGENT.USERNAME,
CREDENTIALS.FIELD_AGENT.PASSWORD
)
const res = await createDeclaration(token, undefined, ActionType.DECLARE)
declaration = res.declaration
Expand All @@ -43,8 +44,20 @@ test.describe('Action menu options', () => {
await login(page, CREDENTIALS.REGISTRATION_AGENT)
await page.getByRole('button', { name: 'Ready for review' }).click()
const options = await getActionMenuOptions(page, declaration)
expect(options).toStrictEqual(['Assign', 'Validate', 'Archive', 'Reject'])
expect(options).toStrictEqual(['Assign', 'Validate', 'Archive', 'Reject'])
expect(options).toStrictEqual([
'Assign',
'Validate',
'Archive',
'Reject',
'Edit'
])
expect(options).toStrictEqual([
'Assign',
'Validate',
'Archive',
'Reject',
'Edit'
])
})

test('Local Registrar', async () => {
Expand All @@ -56,20 +69,21 @@ test.describe('Action menu options', () => {
'Register',
'Archive',
'Reject',
'Edit',
'Escalate'
])
})
})

test.describe('Event status: VALIDATED', async () => {
test.describe('Declared and validated', async () => {
let declaration: Declaration

test.beforeAll(async () => {
const token = await getToken(
CREDENTIALS.LOCAL_REGISTRAR.USERNAME,
CREDENTIALS.LOCAL_REGISTRAR.PASSWORD
)
const res = await createDeclaration(token, undefined, ActionType.VALIDATE)
const res = await createDeclaration(token, undefined, ActionType.DECLARE)
declaration = res.declaration
})

Expand All @@ -78,10 +92,11 @@ test.describe('Action menu options', () => {
await page.getByRole('button', { name: 'Ready for review' }).click()
const options = await getActionMenuOptions(page, declaration)
expect(options).toStrictEqual([
'Unassign',
'Assign',
'Register',
'Archive',
'Reject',
'Edit',
'Escalate'
])
})
Expand Down
10 changes: 8 additions & 2 deletions e2e/testcases/application/4a-validate-require-update-FA.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ test.describe

const row = getRowByTitle(page, formatV2ChildName(declaration))

await row.getByRole('button', { name: 'Review' }).click()
await row.getByRole('button', { name: 'Edit' }).click()

await selectDeclarationAction(page, 'Declare')
await page.getByTestId('change-button-child.name').click()
await page
.getByTestId('text__surname')
.fill(faker.person.lastName('female'))
await page.getByRole('button', { name: 'Back to review' }).click()

await selectDeclarationAction(page, 'Declare with edits')

// Should redirect back to requires update workqueue
await expect(page.locator('#content-name')).toHaveText('Requires updates')
Expand Down
14 changes: 9 additions & 5 deletions e2e/testcases/application/4b-validate-require-update-RA.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test.describe
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
)
const res = await createDeclaration(token, undefined, ActionType.VALIDATE)
const res = await createDeclaration(token, undefined, ActionType.DECLARE)
declaration = res.declaration
eventId = res.eventId

Expand Down Expand Up @@ -101,13 +101,17 @@ test.describe
)
})

test('4.4 Click Review -action', async () => {
test('4.4 Click Edit -action', async () => {
await ensureAssigned(page)
await selectAction(page, 'Review')
await selectAction(page, 'Edit')
})

test('4.5 Complete validate action', async () => {
await selectDeclarationAction(page, 'Validate')
test('4.5 Complete declare with edits action', async () => {
await page.getByTestId('change-button-child.weightAtBirth').click()
await page.getByTestId('number__child____weightAtBirth').fill('2.6')
await page.getByRole('button', { name: 'Back to review' }).click()

await selectDeclarationAction(page, 'Declare with edits')

// Should redirect back to requires update workqueue
await expect(page.locator('#content-name')).toHaveText('Requires updates')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { login, getToken } from '../../helpers'
import { CREDENTIALS, SAFE_WORKQUEUE_TIMEOUT_MS } from '../../constants'
import { createDeclaration, Declaration } from '../test-data/birth-declaration'
import { formatV2ChildName } from '../birth/helpers'
import { ensureAssigned, expectInUrl, selectAction } from '../../utils'
import { expectInUrl, selectAction } from '../../utils'

test.describe.serial('6 Validate Ready to print tab', () => {
let page: Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe.serial('7 Validate Sent for approval tab', () => {
CREDENTIALS.REGISTRATION_AGENT.USERNAME,
CREDENTIALS.REGISTRATION_AGENT.PASSWORD
)
const res = await createDeclaration(token, undefined, ActionType.VALIDATE)
const res = await createDeclaration(token, undefined, ActionType.DECLARE)
declaration = res.declaration
eventId = res.eventId

Expand Down
7 changes: 3 additions & 4 deletions e2e/testcases/application/workqueue-flow-1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { assertRecordInWorkqueue, fillDate } from '../birth/helpers'
import { getRowByTitle } from '../print-certificate/birth/helpers'

// FA Notifies => RA Validates => LR Registers => LR Prints

test.describe.serial('1. Workqueue flow - 1', () => {
let page: Page
const declaration = {
Expand Down Expand Up @@ -148,7 +147,7 @@ test.describe.serial('1. Workqueue flow - 1', () => {
})
})

test.describe('1.2 Validate by RA', async () => {
test.describe('1.2 Declare and validate by RA', async () => {
test('1.2.1 Verify workqueue', async () => {
await login(page, CREDENTIALS.REGISTRATION_AGENT)

Expand Down Expand Up @@ -262,8 +261,8 @@ test.describe.serial('1. Workqueue flow - 1', () => {
await page.getByRole('button', { name: 'Back to review' }).click()
})

test('1.2.6 Validate', async () => {
await selectDeclarationAction(page, 'Validate')
test('1.2.6 Declare', async () => {
await selectDeclarationAction(page, 'Declare')

await ensureOutboxIsEmpty(page)

Expand Down
54 changes: 37 additions & 17 deletions e2e/testcases/application/workqueue-flow-3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,16 @@ test.describe.serial('3. Workqueue flow - 3', () => {
})
.click()

await expect(page.getByText('Rejected')).toBeVisible()

await ensureAssigned(page)
await selectAction(page, 'Review')
await page.getByRole('button', { name: 'Action' }).click()
await expect(page.getByText('Reject')).not.toBeVisible()
await expect(page.getByText('Reject', { exact: true })).not.toBeVisible()
await expect(page.getByText('Review', { exact: true })).not.toBeVisible()
await page.getByRole('button', { name: 'Action' }).click()
})

test('3.2.4 Unassign', async () => {
await page.goBack()
await selectAction(page, 'Unassign')
await page.getByRole('button', { name: 'Unassign', exact: true }).click()
await expect(page.getByText('Not assigned')).toBeVisible()
Expand All @@ -245,11 +247,11 @@ test.describe.serial('3. Workqueue flow - 3', () => {
]
})
})
test('3.3.2 Go to review', async () => {
test('3.3.2 Go to edit', async () => {
await assignFromWorkqueue(page, childName)

await getRowByTitle(page, childName)
.getByRole('button', { name: 'Review' })
.getByRole('button', { name: 'Edit' })
.click()
})

Expand All @@ -259,8 +261,6 @@ test.describe.serial('3. Workqueue flow - 3', () => {
.getByRole('button', { name: 'Change all' })
.click()

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

await page.locator('#informant____relation').click()
await page
.getByText(declaration.informantType, {
Expand Down Expand Up @@ -336,12 +336,19 @@ test.describe.serial('3. Workqueue flow - 3', () => {
await page.locator('#father____addressSameAs_YES').click()
})

test('3.3.6 Declare', async () => {
test('3.3.6 Fill up informant comment & signature', async () => {
await continueForm(page, 'Back to review')
await expect(page.getByRole('dialog')).not.toBeVisible()

await selectDeclarationAction(page, 'Declare')
await page.locator('#review____comment').fill(faker.lorem.sentence())
await page.getByRole('button', { name: 'Sign', exact: true }).click()
await drawSignature(page, 'review____signature_canvas_element', false)
await page
.locator('#review____signature_modal')
.getByRole('button', { name: 'Apply' })
.click()
})

test('3.3.6 Declare with edits', async () => {
await selectDeclarationAction(page, 'Declare with edits')
await ensureOutboxIsEmpty(page)
})

Expand Down Expand Up @@ -453,7 +460,7 @@ test.describe.serial('3. Workqueue flow - 3', () => {
})
})
})
test.describe('3.6 Re-validate by RA', async () => {
test.describe('3.6 Re-declare with edits by RA', async () => {
test('3.6.1 Login with RA', async () => {
await login(page, CREDENTIALS.REGISTRATION_AGENT, true)

Expand All @@ -473,16 +480,29 @@ test.describe.serial('3. Workqueue flow - 3', () => {
})
})

test('3.6.2 Re-validate', async () => {
test('3.6.2 Go to edit', async () => {
await page.getByText('Requires updates').click()

await assignFromWorkqueue(page, childName)
await getRowByTitle(page, childName)
.getByRole('button', { name: 'Review' })
.getByRole('button', { name: 'Edit' })
.click()
})

await selectAction(page, 'Validate')
await page.getByRole('button', { name: 'Validate' }).click()
test('3.6.3 Change informant email', async () => {
await page
.getByTestId('accordion-Accordion_informant')
.getByRole('button', { name: 'Change all' })
.click()

await page.locator('#informant____email').fill(faker.internet.email())

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

test('3.6.4 Re-declare with edits', async () => {
await selectDeclarationAction(page, 'Declare with edits')

await assertRecordInWorkqueue({
page,
Expand Down
Loading
Loading