Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2e Fix collision #1170

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions .github/workflows/deploy-and-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions e2e/testcases/birth/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/correction-birth/correct-birth-record-2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/correction-birth/correct-birth-record-4.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/correction-birth/correct-birth-record-6.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/correction-birth/correct-birth-record-8.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcases/correction-birth/correct-birth-record-9.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion e2e/testcases/death/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading