Skip to content

Commit

Permalink
Merge branch 'release-v1.3.2' of github.com:opencrvs/opencrvs-farajal…
Browse files Browse the repository at this point in the history
…and into infra-improvements
  • Loading branch information
rikukissa committed Jan 9, 2024
2 parents c3a9b09 + e841f1d commit 08aec94
Show file tree
Hide file tree
Showing 26 changed files with 810 additions and 420 deletions.
28 changes: 25 additions & 3 deletions cypress/integration/birth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/

import faker from "@faker-js/faker"
import faker from '@faker-js/faker'

context('Birth Integration Test', () => {
beforeEach(() => {
Expand All @@ -30,7 +30,18 @@ context('Birth Integration Test', () => {
cy.login('fieldWorker')
cy.createPin()
cy.verifyLandingPageVisible()
cy.enterMaximumInput({ informantType, motherDoB, motherFirstNames, motherFamilyName, fatherDoB, fatherFirstNames, fatherFamilyName, informantFirstNames, informantFamilyName, informantDoB })
cy.enterMaximumInput({
informantType,
motherDoB,
motherFirstNames,
motherFamilyName,
fatherDoB,
fatherFirstNames,
fatherFamilyName,
informantFirstNames,
informantFamilyName,
informantDoB
})
cy.submitDeclaration()
cy.logout()
})
Expand Down Expand Up @@ -81,7 +92,18 @@ context('Birth Integration Test', () => {
cy.login('registrar')
cy.createPin()
cy.verifyLandingPageVisible()
cy.enterMaximumInput({ informantType, motherDoB, motherFirstNames, motherFamilyName, fatherDoB, fatherFirstNames, fatherFamilyName, informantFirstNames, informantFamilyName, informantDoB })
cy.enterMaximumInput({
informantType,
motherDoB,
motherFirstNames,
motherFamilyName,
fatherDoB,
fatherFirstNames,
fatherFamilyName,
informantFirstNames,
informantFamilyName,
informantDoB
})
//register declaration
cy.get('#registerDeclarationBtn').click()
cy.get('#submit_confirm').click()
Expand Down
146 changes: 76 additions & 70 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,14 @@ Cypress.Commands.add('declareDeclarationWithMinimumInput', () => {
)
cy.get('#childBirthDate-yyyy').type('2018')
cy.selectOption('#placeOfBirth', 'Private_Home', 'Residential address')
cy.selectOption('#country', 'Farajaland', 'Farajaland')
cy.selectOption('#state', 'Pualula', 'Pualula')
cy.selectOption('#district', 'Embe', 'Embe')
cy.selectOption('#countryPlaceofbirth', 'Farajaland', 'Farajaland')
cy.selectOption('#statePlaceofbirth', 'Pualula', 'Pualula')
cy.selectOption('#districtPlaceofbirth', 'Embe', 'Embe')
cy.goToNextFormSection()

// SELECT INFORMANT
cy.selectOption('#informantType', 'Mother', 'Mother')
cy.wait(500)
cy.get('#registrationPhone').type('07' + getRandomNumbers(8))
cy.goToNextFormSection()

Expand All @@ -323,9 +324,9 @@ Cypress.Commands.add('declareDeclarationWithMinimumInput', () => {
cy.get('#motherBirthDate-dd').type('23')
cy.get('#motherBirthDate-mm').type('10')
cy.get('#motherBirthDate-yyyy').type('1969')
cy.selectOption('#countryPrimary-form-input', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.selectOption('#countryPrimaryMother', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryMother', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryMother', 'Embe', 'Embe')
cy.goToNextFormSection()

// FATHER DETAILS
Expand Down Expand Up @@ -474,21 +475,21 @@ Cypress.Commands.add('enterMaximumInput', (options) => {
cy.selectOption('#birthType', 'Single', 'Single')
cy.get('#weightAtBirth').type('1.5')
cy.selectOption('#placeOfBirth', 'Private_Home', 'Residential address')
cy.selectOption('#country', 'Farajaland', 'Farajaland')
cy.selectOption('#countryPlaceofbirth', 'Farajaland', 'Farajaland')
cy.selectOption(
'#state',
'#statePlaceofbirth',
options?.eventLocationLevel1 || 'Pualula',
options?.eventLocationLevel1 || 'Pualula'
)
cy.selectOption(
'#district',
'#districtPlaceofbirth',
options?.eventLocationLevel2 || 'Embe',
options?.eventLocationLevel2 || 'Embe'
)
cy.get('#cityUrbanOption').type('My city')
cy.get('#addressLine3UrbanOption').type('My residential area')
cy.get('#addressLine2UrbanOption').type('My street')
cy.get('#numberUrbanOption').type('40')
cy.get('#cityPlaceofbirth').type('My city')
cy.get('#addressLine1UrbanOptionPlaceofbirth').type('My residential area')
cy.get('#addressLine2UrbanOptionPlaceofbirth').type('My street')
cy.get('#addressLine3UrbanOptionPlaceofbirth').type('40')
cy.goToNextFormSection()

// SELECT INFORMANT
Expand All @@ -497,6 +498,7 @@ Cypress.Commands.add('enterMaximumInput', (options) => {
options?.informantType || 'Grandfather',
options?.informantType || 'Grandfather'
)
cy.wait(500)
cy.get('#registrationPhone').type('07' + getRandomNumbers(8))
cy.get('#registrationEmail').type('axonishere@gmail.com')

Expand All @@ -510,12 +512,11 @@ Cypress.Commands.add('enterMaximumInput', (options) => {
cy.get('#informantBirthDate-yyyy').type(informantDoBSplit.yyyy || '1975')
cy.selectOption('#nationality', 'Farajaland', 'Farajaland')
cy.get('#informantID').type(getRandomNumbers(10))
cy.selectOption('#countryPrimary-form-input', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.goToNextFormSection()
cy.selectOption('#countryPrimaryInformant', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryInformant', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryInformant', 'Embe', 'Embe')
}

cy.goToNextFormSection()
// MOTHER DETAILS
cy.get('#iD').type(getRandomNumbers(10))
cy.get('#motherBirthDate-dd').type(motherDoBSplit?.dd || '23')
Expand All @@ -530,14 +531,14 @@ Cypress.Commands.add('enterMaximumInput', (options) => {
cy.get('#multipleBirth').type('2')
cy.get('#occupation').type('Lawyer')
cy.selectOption('#educationalAttainment', 'PRIMARY_ISCED_1', 'Primary')
cy.selectOption('#countryPrimary-form-input', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.get('#cityUrbanOptionPrimary').type('My town')
cy.get('#addressLine3UrbanOptionPrimary').type('My residental area')

cy.get('#addressLine2UrbanOptionPrimary').type('My street')
cy.get('#numberUrbanOptionPrimary').type('40')
cy.selectOption('#countryPrimaryMother', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryMother', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryMother', 'Embe', 'Embe')
cy.get('#cityPrimaryMother').type('My town')
cy.get('#addressLine1UrbanOptionPrimaryMother').type('My residental area')

cy.get('#addressLine2UrbanOptionPrimaryMother').type('My street')
cy.get('#addressLine3UrbanOptionPrimaryMother').type('40')
cy.goToNextFormSection()

// FATHER DETAILS
Expand All @@ -552,13 +553,13 @@ Cypress.Commands.add('enterMaximumInput', (options) => {
cy.get('#occupation').type('Lawyer')
cy.selectOption('#educationalAttainment', 'PRIMARY_ISCED_1', 'Primary')
cy.get('#primaryAddressSameAsOtherPrimary_false').click()
cy.selectOption('#countryPrimary', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.get('#cityUrbanOptionPrimary').type('My town')
cy.get('#addressLine3UrbanOptionPrimary').type('My residential area')
cy.get('#addressLine2UrbanOptionPrimary').type('My street')
cy.get('#numberUrbanOptionPrimary').type('40')
cy.selectOption('#countryPrimaryFather', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryFather', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryFather', 'Embe', 'Embe')
cy.get('#cityPrimaryFather').type('My town')
cy.get('#addressLine1UrbanOptionPrimaryFather').type('My residential area')
cy.get('#addressLine2UrbanOptionPrimaryFather').type('My street')
cy.get('#addressLine2UrbanOptionPrimaryFather').type('40')
cy.goToNextFormSection()

// DOCUMENTS
Expand Down Expand Up @@ -611,9 +612,9 @@ Cypress.Commands.add('declareDeathDeclarationWithMinimumInput', (options) => {
cy.get('#deceasedBirthDate-mm').type('06')
cy.get('#deceasedBirthDate-yyyy').type('1988')
cy.selectOption('#gender', 'Male', 'Male')
cy.selectOption('#countryPrimary', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.selectOption('#countryPrimaryDeceased', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryDeceased', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryDeceased', 'Embe', 'Embe')
cy.goToNextFormSection()
// EVENT DETAILS

Expand All @@ -624,6 +625,7 @@ Cypress.Commands.add('declareDeathDeclarationWithMinimumInput', (options) => {
// MANNER OF DEATH
cy.selectOption('#mannerOfDeath', '', 'Natural causes')
cy.get('#causeOfDeathEstablished').click()
cy.wait(500)
cy.selectOption('#causeOfDeathMethod', '', 'Physician')
cy.selectOption('#placeOfDeath', '', "Deceased's usual place of residence")

Expand All @@ -634,6 +636,7 @@ Cypress.Commands.add('declareDeathDeclarationWithMinimumInput', (options) => {
options?.informantType || 'Spouse',
options?.informantType || 'Spouse'
)
cy.wait(500)
cy.get('#informantID').type('9123456781')
cy.get('#informantBirthDate-dd').type('16')
cy.get('#informantBirthDate-mm').type('06')
Expand Down Expand Up @@ -708,14 +711,14 @@ Cypress.Commands.add('enterDeathMaximumInput', (options) => {
options?.deceasedGender || 'Male',
options?.deceasedGender || 'Male'
)
cy.selectOption('#countryPrimary', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.get('#cityUrbanOptionPrimary').type('My town')
cy.get('#addressLine3UrbanOptionPrimary').type('My residential area')
cy.get('#addressLine2UrbanOptionPrimary').type('My street')
cy.get('#numberUrbanOptionPrimary').type('40')
cy.get('#postcodePrimary').type('9000')
cy.selectOption('#countryPrimaryDeceased', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryDeceased', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryDeceased', 'Embe', 'Embe')
cy.get('#cityPrimaryDeceased').type('My town')
cy.get('#addressLine1UrbanOptionPrimaryDeceased').type('My residential area')
cy.get('#addressLine2UrbanOptionPrimaryDeceased').type('My street')
cy.get('#addressLine3UrbanOptionPrimaryDeceased').type('40')
cy.get('#postalCodePrimaryDeceased').type('9000')
cy.goToNextFormSection()
// EVENT DETAILS
cy.get('#deathDate-dd').type('18')
Expand All @@ -725,25 +728,26 @@ Cypress.Commands.add('enterDeathMaximumInput', (options) => {
// CAUSE OF DEATH DETAILS
cy.selectOption('#mannerOfDeath', '', 'Homicide')
cy.get('#causeOfDeathEstablished').click()
cy.wait(500)
cy.selectOption('#causeOfDeathMethod', '', 'Physician')
cy.selectOption('#placeOfDeath', '', 'Other')

cy.selectOption('#country', 'Farajaland', 'Farajaland')
cy.selectOption('#countryPlaceofdeath', 'Farajaland', 'Farajaland')
cy.selectOption(
'#state',
'#statePlaceofdeath',
options?.eventLocationLevel1 || 'Pualula',
options?.eventLocationLevel1 || 'Pualula'
)
cy.selectOption(
'#district',
'#districtPlaceofdeath',
options?.eventLocationLevel2 || 'Embe',
options?.eventLocationLevel2 || 'Embe'
)
cy.get('#cityUrbanOption').type('My city')
cy.get('#addressLine3UrbanOption').type('My residential area')
cy.get('#addressLine2UrbanOption').type('My street')
cy.get('#numberUrbanOption').type('40')
cy.get('#postalCode').type('9000')
cy.get('#cityPlaceofdeath').type('My city')
cy.get('#addressLine1UrbanOptionPlaceofdeath').type('My residential area')
cy.get('#addressLine2UrbanOptionPlaceofdeath').type('My street')
cy.get('#addressLine3UrbanOptionPlaceofdeath').type('40')
cy.get('#postalCodePlaceofdeath').type('9000')

cy.goToNextFormSection()
// INFORMANT DETAILS
Expand All @@ -752,6 +756,7 @@ Cypress.Commands.add('enterDeathMaximumInput', (options) => {
options?.informantType || 'Spouse',
options?.informantType || 'Spouse'
)
cy.wait(500)
cy.get('#registrationPhone').type('07' + getRandomNumbers(8))
cy.get('#registrationEmail').type('axonishere@gmail.com')
cy.get('#firstNamesEng').type(options?.informantFirstNames || 'Alom')
Expand All @@ -762,11 +767,11 @@ Cypress.Commands.add('enterDeathMaximumInput', (options) => {
cy.selectOption('#nationality', 'Farajaland', 'Farajaland')
cy.get('#informantID').type(getRandomNumbers(10))
cy.get('#primaryAddressSameAsOtherPrimary_false').click()
cy.selectOption('#countryPrimary-form-input', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.get('#cityUrbanOptionPrimary').type('My town')
cy.get('#postcodePrimary').type('9000')
cy.selectOption('#countryPrimaryInformant', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryInformant', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryInformant', 'Embe', 'Embe')
cy.get('#cityPrimaryInformant').type('My town')
cy.get('#postalCodePrimaryInformant').type('9000')
cy.goToNextFormSection()
cy.goToNextFormSection()
})
Expand All @@ -792,17 +797,18 @@ Cypress.Commands.add('someoneElseJourney', () => {
cy.selectOption('#birthType', 'Single', 'Single')
cy.get('#weightAtBirth').type('1.5')
cy.selectOption('#placeOfBirth', 'Private_Home', 'Residential address')
cy.selectOption('#country', 'Farajaland', 'Farajaland')
cy.selectOption('#state', 'Pualula', 'Pualula')
cy.selectOption('#district', 'Embe', 'Embe')
cy.get('#cityUrbanOption').type('My city')
cy.get('#addressLine3UrbanOption').type('My residential area')
cy.get('#addressLine2UrbanOption').type('My street')
cy.get('#numberUrbanOption').type('40')
cy.selectOption('#countryPlaceofbirth', 'Farajaland', 'Farajaland')
cy.selectOption('#statePlaceofbirth', 'Pualula', 'Pualula')
cy.selectOption('#districtPlaceofbirth', 'Embe', 'Embe')
cy.get('#cityPlaceofbirth').type('My city')
cy.get('#addressLine1UrbanOptionPlaceofbirth').type('My residential area')
cy.get('#addressLine2UrbanOptionPlaceofbirth').type('My street')
cy.get('#addressLine3UrbanOptionPlaceofbirth').type('40')
cy.goToNextFormSection()

// SELECT INFORMANT
cy.selectOption('#informantType', 'Someone else', 'Someone else')
cy.wait(500)
cy.get('#otherInformantType').type('Someone else')
cy.get('#registrationPhone').type('07' + getRandomNumbers(8))
cy.get('#registrationEmail').type('axonishere@gmail.com')
Expand All @@ -815,9 +821,9 @@ Cypress.Commands.add('someoneElseJourney', () => {
cy.get('#informantBirthDate-yyyy').type('1975')
cy.selectOption('#nationality', 'Farajaland', 'Farajaland')
cy.get('#informantID').type('1234567111')
cy.selectOption('#countryPrimary-form-input', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.selectOption('#countryPrimaryInformant', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryInformant', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryInformant', 'Embe', 'Embe')
cy.goToNextFormSection()

// MOTHER DETAILS
Expand All @@ -828,9 +834,9 @@ Cypress.Commands.add('someoneElseJourney', () => {
cy.get('#motherBirthDate-yyyy').type('1975')
cy.get('#firstNamesEng').type('Agnes')
cy.get('#familyNameEng').type('Aktar')
cy.selectOption('#countryPrimary-form-input', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimary', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimary', 'Embe', 'Embe')
cy.selectOption('#countryPrimaryMother', 'Farajaland', 'Farajaland')
cy.selectOption('#statePrimaryMother', 'Pualula', 'Pualula')
cy.selectOption('#districtPrimaryMother', 'Embe', 'Embe')
cy.goToNextFormSection()

// FATHER DETAILS
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"@octokit/core": "4.2.1",
"@types/bcryptjs": "^2.4.2",
"@types/google-libphonenumber": "^7.4.23",
"@types/hapi__inert": "5.2.1",
"@types/handlebars": "^4.1.0",
"@types/hapi__inert": "^5.2.3",
"@types/jsonwebtoken": "^8.5.8",
"@types/libsodium-wrappers": "^0.7.10",
"@types/react-intl": "^3.0.0",
Expand Down Expand Up @@ -74,7 +74,7 @@
"@types/code": "^4.0.3",
"@types/csv2json": "^1.4.0",
"@types/dotenv": "^6.1.0",
"@types/fhir": "^0.0.30",
"@types/fhir": "0.0.30",
"@types/geojson": "^7946.0.4",
"@types/hapi-pino": "^6.3.0",
"@types/hapi__boom": "^9.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/api/application/application-config-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const defaultApplicationConfig = {
MARRIAGE_REGISTRATION: true,
DATE_OF_BIRTH_UNKNOWN: false,
INFORMANT_SIGNATURE: true,
INFORMANT_SIGNATURE_REQUIRED: true,
INFORMANT_SIGNATURE_REQUIRED: false,
USER_NOTIFICATION_DELIVERY_METHOD: 'email', // or 'sms', or '' ... You can use 'sms' for WhatsApp
INFORMANT_NOTIFICATION_DELIVERY_METHOD: 'email', // or 'sms', or '' ... You can use 'sms' for WhatsApp
SIGNATURE_REQUIRED_FOR_ROLES: ['LOCAL_REGISTRAR', 'NATIONAL_REGISTRAR']
Expand Down
Loading

0 comments on commit 08aec94

Please sign in to comment.