Skip to content

Commit

Permalink
Merge branch 'configurable-roles' into qa-configurable-roles-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Nil20 committed Nov 27, 2024
2 parents dfe3de8 + 839103b commit d1d5910
Show file tree
Hide file tree
Showing 79 changed files with 1,789 additions and 1,777 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-and-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
run: npx playwright test ./e2e/testcases/${{ matrix.test_dir }}
env:
DOMAIN: '${{ vars.DOMAIN }}'
continue-on-error: true

- uses: actions/upload-artifact@v4
if: steps.check-specs.outputs.has_spec_files == 'true'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
run: npx playwright test ./e2e/testcases/${{ matrix.test_dir }}
env:
DOMAIN: '${{ vars.DOMAIN }}'
continue-on-error: true

- uses: actions/upload-artifact@v4
if: steps.check-specs.outputs.has_spec_files == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ build
src/features/employees/tmp/login-details.json
src/tests/locations.json


graphql.schema.json

*.tar.gz
.secrets
.env*
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"apollographql.vscode-apollo"
]
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

## 1.7.0 Release candidate

### New features

- Update the translations for System user add/edit form, `Last name` to `User's surname` and `First name` to `User's first name` to make them less confusing for system users [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830)

### Bug fixes

- Protect individual certificate endpoint with token
- Kibana disk space alerts now work regardless of your disk device names. Alerts listen devices mounted both to `/` and `/data` (encrypted data partition)
- "Publish release" pipeline now correctly uses the "Branch to build from" value as the branch to be tagged. Previously it tried tagging "master". "Release tag" is also now used as the release version as is instead of it being read from `package.json`.
- Backup process now doesn't require internet connection to download docker images thus working more reliably when internet connections are unreliable. Previously non-active images were cleaned nightly, now we only do it as part of deployment. [#7896](https://github.com/opencrvs/opencrvs-core/issues/7896)
- We make sure that the automatic cleanup job only runs before deployment (instead of cron schedule cleanup).

### Breaking changes

Expand All @@ -15,6 +21,7 @@
### Improvements

- Auth token, ip address, remote address, mobile number, email redacted/masked from server log
- Optimised deployment times by making docker images download in parallel.
- Country alpha3 ISO code now is derived from variables to the Docker Compose files and don't need to be hard coded

### Infrastructure breaking changes
Expand All @@ -25,6 +32,7 @@

- **Major new feature** Description
- Misc new feature
- Add constant.humanName to allow coutries to have custom ordering on thier full name e.g start with `lastName` or `firstName` [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830)

### New content keys requiring translation

Expand Down Expand Up @@ -116,6 +124,7 @@ INSERT CSV ROWS IN ENGLISH ONLY

- Github pipeline dedicated for reading secrets and variables from other environments now checks if GH_TOKEN is still valid before attempting other operations
- Remove unnecessary UI dividers that add in various sections of the declaration forms(e.g the Death, Birth and Marriage forms) [#244](https://github.com/opencrvs/opencrvs-countryconfig/pull/244)
- Update template transformer for fields `informantType` and `otherInformantType` that fixes the bug of unavailability of these template fields [#5952](https://github.com/opencrvs/opencrvs-countryconfig/pull/5952)

## 1.5.2 (https://github.com/opencrvs/opencrvs-countryconfig/compare/v1.5.1...v1.5.2)

Expand Down
8 changes: 8 additions & 0 deletions apollo.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"client": {
"service": {
"name": "@opencrvs/gateway",
"url": "http://localhost:7070/graphql"
}
}
}
2 changes: 0 additions & 2 deletions e2e/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,6 @@ export type Registration = {
informantType?: Maybe<Scalars['String']>
informantsSignature?: Maybe<Scalars['String']>
informantsSignatureURI?: Maybe<Scalars['String']>
mosipAid?: Maybe<Scalars['String']>
otherInformantType?: Maybe<Scalars['String']>
page?: Maybe<Scalars['String']>
paperFormID?: Maybe<Scalars['String']>
Expand Down Expand Up @@ -2039,7 +2038,6 @@ export type RegistrationInput = {
informantType?: InputMaybe<Scalars['String']>
informantsSignature?: InputMaybe<Scalars['String']>
location?: InputMaybe<LocationInput>
mosipAid?: InputMaybe<Scalars['String']>
otherInformantType?: InputMaybe<Scalars['String']>
page?: InputMaybe<Scalars['String']>
paperFormID?: InputMaybe<Scalars['String']>
Expand Down
27 changes: 26 additions & 1 deletion e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function validateSectionButtons(page: Page) {
await expect(page.getByText('Continue', { exact: true })).toBeVisible()
await expect(page.getByText('Exit', { exact: true })).toBeVisible()
await expect(page.getByText('Save & Exit', { exact: true })).toBeVisible()
await expect(page.locator('#eventToggleMenuToggleButton')).toBeVisible()
await expect(page.locator('#eventToggleMenu-dropdownMenu')).toBeVisible()
}

export const uploadImage = async (
Expand Down Expand Up @@ -346,3 +346,28 @@ export const generateRandomSuffix = () => {

return randomConsonant + randomVowel
}

type ActionMenuOptions =
| 'Correct record'
| 'Print certified copy'
| 'Review declaration'
| 'Update declaration'
| 'Review correction request'
| 'View record'

export const getAction = (page: Page, option: ActionMenuOptions) => {
return page
.locator('#action-dropdownMenu')
.getByRole('listitem')
.filter({
hasText: new RegExp(option)
})
}

export const assignRecord = async (page: Page) => {
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()
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { expect, test, type Page } from '@playwright/test'
import { createPIN, getToken, login } from '../../helpers'
import {
assignRecord,
createPIN,
getAction,
getToken,
login
} from '../../helpers'
import faker from '@faker-js/faker'
import { createDeclaration } from '../birth/helpers'
import TEST_DATA_1 from '../birth/data/1-both-mother-and-father.json'
Expand Down Expand Up @@ -64,37 +70,40 @@ test.describe
/*
* Expected result: should
* - Navigate to record audit page
* - Not show correct recort optoin
* - Print button should be disabled
* - Correct record option should be disabled
* - Print option should be disabled
*/
await expect(
page.getByRole('button', { name: 'Correct record' })
).not.toBeVisible()
await expect(
page.getByRole('button', { name: 'Print', exact: true })
).toBeDisabled()
await page.getByRole('button', { name: 'Action' }).first().click()

await expect(getAction(page, 'Correct record')).toHaveAttribute('disabled')

await expect(getAction(page, 'Print certified copy')).toHaveAttribute(
'disabled'
)

expect(page.url().includes('record-audit'))
})

test('17.2 Click download > click assign', async () => {
await page.getByLabel('Assign record').click()
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await assignRecord(page)
await page.getByRole('button', { name: 'Action' }).first().click()

/*
* Expected result: should
* - Show correct recort optoin
* - Print button should not be disabled
* - Correct record option should not be disabled
* - Print option should not be disabled
*/
await expect(
page.getByRole('button', { name: 'Correct record' })
).toBeVisible()
await expect(
page.getByRole('button', { name: 'Print', exact: true })
).not.toBeDisabled()
await expect(getAction(page, 'Correct record')).not.toHaveAttribute(
'disabled'
)

await expect(getAction(page, 'Print certified copy')).not.toHaveAttribute(
'disabled'
)
})

test('17.3 Click "Correct record"', async () => {
await page.getByRole('button', { name: 'Correct record' }).click()
await getAction(page, 'Correct record').click()

/*
* Expected result: should show correct record page
Expand Down
48 changes: 34 additions & 14 deletions e2e/testcases/birth/1-birth-event-declaration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ test.describe('1. Birth event declaration', () => {
page.getByRole('button', { name: 'Save & Exit' })
).toBeVisible()

await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await expect(
page.getByRole('button', { name: 'Delete declaration' })
page
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
).toBeVisible()
})

Expand Down Expand Up @@ -157,9 +160,12 @@ test.describe('1. Birth event declaration', () => {
page.getByRole('button', { name: 'Save & Exit' })
).toBeVisible()

await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await expect(
page.getByRole('button', { name: 'Delete declaration' })
page
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
).toBeVisible()
})

Expand Down Expand Up @@ -199,9 +205,12 @@ test.describe('1. Birth event declaration', () => {
await expect(
page.getByRole('button', { name: 'Save & Exit' })
).toBeVisible()
await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await expect(
page.getByRole('button', { name: 'Delete declaration' })
page
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
).toBeVisible()
})

Expand Down Expand Up @@ -257,9 +266,12 @@ test.describe('1. Birth event declaration', () => {
await expect(
page.getByRole('button', { name: 'Save & Exit' })
).toBeVisible()
await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await expect(
page.getByRole('button', { name: 'Delete declaration' })
page
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
).toBeVisible()
})

Expand Down Expand Up @@ -300,9 +312,12 @@ test.describe('1. Birth event declaration', () => {
await expect(
page.getByRole('button', { name: 'Save & Exit' })
).toBeVisible()
await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await expect(
page.getByRole('button', { name: 'Delete declaration' })
page
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
).toBeVisible()
})

Expand Down Expand Up @@ -343,9 +358,12 @@ test.describe('1. Birth event declaration', () => {
await expect(
page.getByRole('button', { name: 'Save & Exit' })
).toBeVisible()
await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await expect(
page.getByRole('button', { name: 'Delete declaration' })
page
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
).toBeVisible()
})

Expand Down Expand Up @@ -489,9 +507,11 @@ test.describe('1. Birth event declaration', () => {
await page.getByLabel('Birth').click()
await page.getByRole('button', { name: 'Continue' }).click()

await page.locator('#eventToggleMenuToggleButton').click()
await page.locator('#eventToggleMenu-dropdownMenu').click()
await page
.getByRole('button', { name: 'Delete declaration', exact: true })
.locator('#eventToggleMenu-dropdownMenu')
.getByRole('listitem')
.filter({ hasText: 'Delete declaration' })
.click()
})

Expand Down
22 changes: 12 additions & 10 deletions e2e/testcases/birth/8-validate-declaration-review-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
login,
expectTextWithChangeLink,
formatDateObjectTo_ddMMMMyyyy,
expectOutboxToBeEmpty
expectOutboxToBeEmpty,
getAction,
assignRecord
} from '../../helpers'
import faker from '@faker-js/faker'
import { CREDENTIALS } from '../../constants'
Expand Down Expand Up @@ -867,8 +869,8 @@ test.describe.serial('8. Validate declaration review page', () => {
*/
expect(page.url().includes('registration-home')).toBeTruthy()

await page.getByRole('button', { name: 'Sent for review' }).click()
await expectOutboxToBeEmpty(page)
await page.getByRole('button', { name: 'Sent for review' }).click()
/*
* Expected result: The declaration should be in sent for review
*/
Expand All @@ -894,9 +896,9 @@ test.describe.serial('8. Validate declaration review page', () => {
name: `${declaration.child.name.firstNames} ${declaration.child.name.familyName}`
})
.click()
await page.getByLabel('Assign record').click()
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await page.getByRole('button', { name: 'Review', exact: true }).click()
await assignRecord(page)
await page.getByRole('button', { name: 'Action' }).first().click()
await getAction(page, 'Review declaration').click()
})
test('8.2.1.1 Verify information added on previous pages', async () => {
/*
Expand Down Expand Up @@ -1120,8 +1122,8 @@ test.describe.serial('8. Validate declaration review page', () => {
*/
expect(page.url().includes('registration-home')).toBeTruthy()

await page.getByRole('button', { name: 'Sent for approval' }).click()
await expectOutboxToBeEmpty(page)
await page.getByRole('button', { name: 'Sent for approval' }).click()

/*
* Expected result: The declaration should be in sent for approval
Expand All @@ -1148,9 +1150,9 @@ test.describe.serial('8. Validate declaration review page', () => {
name: `${declaration.child.name.firstNames} ${declaration.child.name.familyName}`
})
.click()
await page.getByLabel('Assign record').click()
await page.getByRole('button', { name: 'Assign', exact: true }).click()
await page.getByRole('button', { name: 'Review', exact: true }).click()
await assignRecord(page)
await page.getByRole('button', { name: 'Action' }).first().click()
await getAction(page, 'Review declaration').click()
})
test('8.3.1.1 Verify information added on previous pages', async () => {
/*
Expand Down Expand Up @@ -1398,8 +1400,8 @@ test.describe.serial('8. Validate declaration review page', () => {
*/
expect(page.url().includes('registration-home')).toBeTruthy()

await page.getByRole('button', { name: 'Ready to print' }).click()
await expectOutboxToBeEmpty(page)
await page.getByRole('button', { name: 'Ready to print' }).click()

/*
* Expected result: The declaration should be in Ready to print
Expand Down
Loading

0 comments on commit d1d5910

Please sign in to comment.