diff --git a/.github/workflows/deploy-and-e2e.yml b/.github/workflows/deploy-and-e2e.yml index 2c2308e5c..c55bacdcd 100644 --- a/.github/workflows/deploy-and-e2e.yml +++ b/.github/workflows/deploy-and-e2e.yml @@ -138,11 +138,7 @@ jobs: - uses: actions/upload-artifact@v4 if: always() && steps.check-specs.outputs.has_spec_files == 'true' with: - name: >- - playwright-report- - ${{ github.event.inputs.core-image-tag || needs.get-core-commit.outputs.latest_commit_sha }}- - ${{ github.event.inputs.countryconfig-image-tag || needs.get-country-config-commit.outputs.short_sha }}- - ${{ matrix.test_dir }} + name: playwright-report-${{github.event.inputs.core-image-tag || needs.get-core-commit.outputs.latest_commit_sha}}-${{github.event.inputs.countryconfig-image-tag || needs.get-country-config-commit.outputs.short_sha}}-${{matrix.test_dir}} path: playwright-report/ retention-days: 30 diff --git a/e2e/testcases/birth/helpers.ts b/e2e/testcases/birth/helpers.ts index d3a38e290..bd4dd6d76 100644 --- a/e2e/testcases/birth/helpers.ts +++ b/e2e/testcases/birth/helpers.ts @@ -108,7 +108,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { birthDate: details.child.birthDate || format( - subDays(new Date(), Math.ceil(50 * Math.random())), + subDays(new Date(), 11 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), identifier: [] @@ -162,7 +162,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { familyName: details.mother.familyName } ], - ageOfIndividualInYears: details.mother.age || random(20, 100), + ageOfIndividualInYears: details.mother.age || random(50, 100), nationality: ['FAR'], identifier: [ { @@ -227,7 +227,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { birthDate: details.father.birthDate || format( - subYears(new Date(), 16 + Math.ceil(10 * Math.random())), + subYears(new Date(), 36 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), nationality: ['FAR'], @@ -277,7 +277,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { } ], birthDate: format( - subYears(new Date(), 16 + Math.ceil(10 * Math.random())), + subYears(new Date(), 36 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), nationality: ['FAR'], diff --git a/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts index c81742d77..dc5658aaa 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts @@ -34,7 +34,7 @@ test.describe('1. Correct record - 1', () => { familyName: faker.name.firstName('female'), gender: 'Female', birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random())), + subDays(new Date(), Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), birthLocation: 'Tembwe Rural Health Centre', diff --git a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts index 55c174979..9d717f130 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts @@ -20,7 +20,7 @@ import { fetchDeclaration } from '../birth/helpers' import { BirthDeclaration, BirthInputDetails } from '../birth/types' -import { format, parseISO, subDays } from 'date-fns' +import { format, parseISO, subYears } from 'date-fns' import { CREDENTIALS } from '../../constants' test.describe.serial('Correct record - 2', () => { @@ -34,7 +34,7 @@ test.describe.serial('Correct record - 2', () => { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), + subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), diff --git a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts index e3782a59e..e91bbbb93 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts @@ -31,7 +31,7 @@ test.describe.serial(' Correct record - 3', () => { const updatedMotherDetails = { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), - age: random(20, 100), + age: random(20, 45), email: faker.internet.email(), nationality: 'Nauru', id: faker.random.numeric(10), diff --git a/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts index 462ced7ed..86e339be2 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts @@ -21,7 +21,7 @@ import { fetchDeclaration } from '../birth/helpers' import { BirthDeclaration, BirthInputDetails } from '../birth/types' -import { format, subDays } from 'date-fns' +import { format, subYears } from 'date-fns' import { CREDENTIALS } from '../../constants' test.describe.serial(' Correct record - 4', () => { @@ -34,7 +34,7 @@ test.describe.serial(' Correct record - 4', () => { firstNames: faker.name.firstName('male'), familyName: faker.name.firstName('male'), birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), + subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), diff --git a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts index 862ddc1da..65a7cd968 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts @@ -34,7 +34,7 @@ test.describe.serial(' Correct record - 5', () => { familyName: faker.name.firstName('female'), gender: 'Female', birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random())), + subDays(new Date(), Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), placeOfBirth: 'Other', diff --git a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts index 892bc3ce3..01d1c2b9b 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts @@ -18,7 +18,7 @@ import { fetchDeclaration } from '../birth/helpers' import { BirthDeclaration, BirthInputDetails } from '../birth/types' -import { format, subDays } from 'date-fns' +import { format, subYears } from 'date-fns' import { CREDENTIALS } from '../../constants' test.describe.serial(' Correct record - 6', () => { @@ -31,7 +31,7 @@ test.describe.serial(' Correct record - 6', () => { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), + subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), diff --git a/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts index 41502a21a..3cbb2f0c5 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts @@ -32,7 +32,7 @@ test.describe.serial(' Correct record - 7', () => { const updatedMotherDetails = { firstNames: faker.name.firstName('male'), familyName: faker.name.firstName('male'), - age: random(20, 100), + age: random(20, 45), email: faker.internet.email(), nationality: 'Nauru', id: faker.random.numeric(10), diff --git a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts index 40cc78e8e..24eb14351 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts @@ -18,7 +18,7 @@ import { fetchDeclaration } from '../birth/helpers' import { BirthDeclaration, BirthInputDetails } from '../birth/types' -import { format, subDays } from 'date-fns' +import { format, subYears } from 'date-fns' import { CREDENTIALS } from '../../constants' test.describe.serial(' Correct record - 8', () => { @@ -31,7 +31,7 @@ test.describe.serial(' Correct record - 8', () => { firstNames: faker.name.firstName('male'), familyName: faker.name.firstName('male'), birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), + subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), diff --git a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts index 7b7748570..c73b0d924 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts @@ -18,7 +18,7 @@ import { fetchDeclaration } from '../birth/helpers' import { BirthDeclaration, BirthInputDetails } from '../birth/types' -import { format, subDays } from 'date-fns' +import { format, subYears } from 'date-fns' import { CREDENTIALS } from '../../constants' test.describe.serial(' Correct record - 9', () => { @@ -31,7 +31,7 @@ test.describe.serial(' Correct record - 9', () => { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), birthDate: format( - subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), + subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), diff --git a/e2e/testcases/correction-death/correct-death-record-10.spec.ts b/e2e/testcases/correction-death/correct-death-record-10.spec.ts index f9f613d3f..0f2ac71a5 100644 --- a/e2e/testcases/correction-death/correct-death-record-10.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-10.spec.ts @@ -30,7 +30,7 @@ test.describe('10. Correct record - 10', () => { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), gender: 'Female', - age: random(20, 100), + age: random(20, 45), nationality: 'Canada', id: faker.random.numeric(10), idType: 'Passport', diff --git a/e2e/testcases/correction-death/correct-death-record-14.spec.ts b/e2e/testcases/correction-death/correct-death-record-14.spec.ts index 2f4f7526d..365bfd748 100644 --- a/e2e/testcases/correction-death/correct-death-record-14.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-14.spec.ts @@ -27,7 +27,7 @@ test.describe.serial(' Correct record - 14', () => { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), gender: 'Female', - age: random(20, 100), + age: random(20, 45), nationality: 'Canada', id: faker.random.numeric(10), idType: 'Passport', diff --git a/e2e/testcases/correction-death/correct-death-record-18.spec.ts b/e2e/testcases/correction-death/correct-death-record-18.spec.ts index 2fc22c5ce..e2323638c 100644 --- a/e2e/testcases/correction-death/correct-death-record-18.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-18.spec.ts @@ -26,7 +26,7 @@ test.describe.serial(' Correct record - 18', () => { firstNames: faker.name.firstName('female'), familyName: faker.name.firstName('female'), gender: 'Female', - age: random(20, 100), + age: random(20, 45), nationality: 'Canada', id: faker.random.numeric(10), idType: 'Passport', diff --git a/e2e/testcases/death/helpers.ts b/e2e/testcases/death/helpers.ts index c5a000219..13e532551 100644 --- a/e2e/testcases/death/helpers.ts +++ b/e2e/testcases/death/helpers.ts @@ -39,7 +39,7 @@ const declaration = { familyName: faker.name.lastName('male') + generateRandomSuffix() }, gender: 'male', - age: random(20, 100), + age: random(50, 100), nationality: 'FAR', identifier: { type: 'NATIONAL_ID',