diff --git a/e2e/constants.ts b/e2e/constants.ts index d7f9b874..48727832 100644 --- a/e2e/constants.ts +++ b/e2e/constants.ts @@ -1,8 +1,24 @@ export const DOMAIN = process.env.DOMAIN || 'farajaland-dev.opencrvs.org' -export const LOGIN_URL = 'https://login.' + DOMAIN -export const AUTH_URL = 'https://auth.' + DOMAIN -export const CLIENT_URL = 'https://register.' + DOMAIN -export const GATEWAY_HOST = 'https://gateway.' + DOMAIN + +export const LOGIN_URL = + process.env.NODE_ENV === 'development' + ? 'http://localhost:3020' + : 'https://login.' + DOMAIN + +export const AUTH_URL = + process.env.NODE_ENV === 'development' + ? 'http://localhost:4040' + : 'https://auth.' + DOMAIN + +export const CLIENT_URL = + process.env.NODE_ENV === 'development' + ? 'http://localhost:3000' + : 'https://register.' + DOMAIN + +export const GATEWAY_HOST = + process.env.NODE_ENV === 'development' + ? 'http://localhost:7070' + : 'https://gateway.' + DOMAIN /* * This timeout is to ensure that all previous actions have been completed diff --git a/e2e/gateway.ts b/e2e/gateway.ts index 3cde02b1..f9a55ef8 100644 --- a/e2e/gateway.ts +++ b/e2e/gateway.ts @@ -18,11 +18,18 @@ export type Scalars = { Int: number Float: number Date: any + DateTime: any FieldValue: any Map: any PlainDate: any } +export type Action = + | CreateAction + | DeclareAction + | NotifyAction + | RegisterAction + export type AdditionalIdWithCompositionId = { __typename?: 'AdditionalIdWithCompositionId' compositionId: Scalars['String'] @@ -105,7 +112,7 @@ export type AdvancedSeachParameters = { deceasedIdentifier?: Maybe declarationJurisdictionId?: Maybe declarationLocationId?: Maybe - event?: Maybe + event?: Maybe eventCountry?: Maybe eventLocationId?: Maybe eventLocationLevel1?: Maybe @@ -113,6 +120,7 @@ export type AdvancedSeachParameters = { eventLocationLevel3?: Maybe eventLocationLevel4?: Maybe eventLocationLevel5?: Maybe + eventLocationLevel6?: Maybe fatherDoB?: Maybe fatherDoBEnd?: Maybe fatherDoBStart?: Maybe @@ -135,6 +143,7 @@ export type AdvancedSeachParameters = { nationalId?: Maybe registrationNumber?: Maybe registrationStatuses?: Maybe>> + timePeriodFrom?: Maybe trackingId?: Maybe } @@ -171,7 +180,7 @@ export type AdvancedSearchParametersInput = { deceasedIdentifier?: InputMaybe declarationJurisdictionId?: InputMaybe declarationLocationId?: InputMaybe - event?: InputMaybe + event?: InputMaybe eventCountry?: InputMaybe eventLocationId?: InputMaybe eventLocationLevel1?: InputMaybe @@ -179,6 +188,7 @@ export type AdvancedSearchParametersInput = { eventLocationLevel3?: InputMaybe eventLocationLevel4?: InputMaybe eventLocationLevel5?: InputMaybe + eventLocationLevel6?: InputMaybe fatherDoB?: InputMaybe fatherDoBEnd?: InputMaybe fatherDoBStart?: InputMaybe @@ -208,44 +218,12 @@ export type AdvancedSearchParametersInput = { recordId?: InputMaybe registrationNumber?: InputMaybe registrationStatuses?: InputMaybe>> + timePeriodFrom?: InputMaybe trackingId?: InputMaybe } -export type ApplicationConfiguration = { - __typename?: 'ApplicationConfiguration' - APPLICATION_NAME?: Maybe - BIRTH?: Maybe - COUNTRY_LOGO?: Maybe - CURRENCY?: Maybe - DATE_OF_BIRTH_UNKNOWN?: Maybe - DEATH?: Maybe - FEATURES?: Maybe - FIELD_AGENT_AUDIT_LOCATIONS?: Maybe - INFORMANT_NOTIFICATION_DELIVERY_METHOD?: Maybe - INFORMANT_SIGNATURE_REQUIRED?: Maybe - LOGIN_BACKGROUND?: Maybe - MARRIAGE?: Maybe - NID_NUMBER_PATTERN?: Maybe - PHONE_NUMBER_PATTERN?: Maybe - USER_NOTIFICATION_DELIVERY_METHOD?: Maybe -} - -export type ApplicationConfigurationInput = { - APPLICATION_NAME?: InputMaybe - BIRTH?: InputMaybe - COUNTRY_LOGO?: InputMaybe - CURRENCY?: InputMaybe - DATE_OF_BIRTH_UNKNOWN?: InputMaybe - DEATH?: InputMaybe - FEATURES?: InputMaybe - FIELD_AGENT_AUDIT_LOCATIONS?: InputMaybe - INFORMANT_NOTIFICATION_DELIVERY_METHOD?: InputMaybe - INFORMANT_SIGNATURE_REQUIRED?: InputMaybe - LOGIN_BACKGROUND?: InputMaybe - MARRIAGE?: InputMaybe - NID_NUMBER_PATTERN?: InputMaybe - PHONE_NUMBER_PATTERN?: InputMaybe - USER_NOTIFICATION_DELIVERY_METHOD?: InputMaybe +export type ApproveCorrectionActionInput = { + data: Array } export type AssignmentData = { @@ -254,7 +232,7 @@ export type AssignmentData = { firstName?: Maybe lastName?: Maybe officeName?: Maybe - userId?: Maybe + practitionerId?: Maybe } export type Attachment = { @@ -312,14 +290,6 @@ export type AvatarInput = { type: Scalars['String'] } -export type Birth = { - __typename?: 'Birth' - FEE?: Maybe - LATE_REGISTRATION_TARGET?: Maybe - PRINT_IN_ADVANCE?: Maybe - REGISTRATION_TARGET?: Maybe -} - export type BirthEventSearchSet = EventSearchSet & { __typename?: 'BirthEventSearchSet' childGender?: Maybe @@ -341,26 +311,6 @@ export type BirthEventSearchSet = EventSearchSet & { type?: Maybe } -export type BirthFee = { - __typename?: 'BirthFee' - DELAYED?: Maybe - LATE?: Maybe - ON_TIME?: Maybe -} - -export type BirthFeeInput = { - DELAYED?: InputMaybe - LATE?: InputMaybe - ON_TIME?: InputMaybe -} - -export type BirthInput = { - FEE?: InputMaybe - LATE_REGISTRATION_TARGET?: InputMaybe - PRINT_IN_ADVANCE?: InputMaybe - REGISTRATION_TARGET?: InputMaybe -} - export type BirthRegResultSet = { __typename?: 'BirthRegResultSet' results?: Maybe>> @@ -430,53 +380,29 @@ export type BookmarkedSeachItem = { export type Certificate = { __typename?: 'Certificate' + certificateTemplateId?: Maybe collector?: Maybe - data?: Maybe hasShowedVerifiedDocument?: Maybe payments?: Maybe>> } export type CertificateInput = { + certificateTemplateId?: InputMaybe collector?: InputMaybe - data?: InputMaybe hasShowedVerifiedDocument?: InputMaybe payments?: InputMaybe>> } -export type CertificateSvg = { - __typename?: 'CertificateSVG' - event: Event - id: Scalars['ID'] - status: CertificateStatus - svgCode: Scalars['String'] - svgDateCreated: Scalars['String'] - svgDateUpdated: Scalars['String'] - svgFilename: Scalars['String'] - user: Scalars['String'] -} - -export type CertificateSvgInput = { - event: Event - id?: InputMaybe - status: CertificateStatus - svgCode: Scalars['String'] - svgDateCreated?: InputMaybe - svgDateUpdated?: InputMaybe - svgFilename: Scalars['String'] - user: Scalars['String'] -} - -export enum CertificateStatus { - Active = 'ACTIVE', - Inactive = 'INACTIVE' -} - export type CertificationMetric = { __typename?: 'CertificationMetric' eventType: Scalars['String'] total: Scalars['Float'] } +export type CertifyActionInput = { + data: Array +} + export type Comment = { __typename?: 'Comment' comment?: Maybe @@ -502,6 +428,11 @@ export type ComparisonInput = { nin?: InputMaybe> } +export type ConfirmRegistrationInput = { + identifiers?: InputMaybe> + registrationNumber: Scalars['String'] +} + export type ContactPoint = { __typename?: 'ContactPoint' system?: Maybe @@ -546,6 +477,7 @@ export type CorrectionPaymentInput = { export type CorrectionRejectionInput = { reason: Scalars['String'] + timeLoggedMS: Scalars['Int'] } export type CorrectionValueInput = { @@ -555,15 +487,12 @@ export type CorrectionValueInput = { section: Scalars['String'] } -export type CountryLogo = { - __typename?: 'CountryLogo' - file?: Maybe - fileName?: Maybe -} - -export type CountryLogoInput = { - file?: InputMaybe - fileName?: InputMaybe +export type CreateAction = { + __typename?: 'CreateAction' + createdAt: Scalars['DateTime'] + createdBy: Scalars['String'] + data: Array + type: Scalars['String'] } export type CreatedIds = { @@ -573,24 +502,6 @@ export type CreatedIds = { trackingId?: Maybe } -export type Currency = { - __typename?: 'Currency' - isoCode?: Maybe - languagesAndCountry?: Maybe>> -} - -export type CurrencyInput = { - isoCode?: InputMaybe - languagesAndCountry?: InputMaybe>> -} - -export type Death = { - __typename?: 'Death' - FEE?: Maybe - PRINT_IN_ADVANCE?: Maybe - REGISTRATION_TARGET?: Maybe -} - export type DeathEventSearchSet = EventSearchSet & { __typename?: 'DeathEventSearchSet' dateOfDeath?: Maybe @@ -602,23 +513,6 @@ export type DeathEventSearchSet = EventSearchSet & { type?: Maybe } -export type DeathFee = { - __typename?: 'DeathFee' - DELAYED?: Maybe - ON_TIME?: Maybe -} - -export type DeathFeeInput = { - DELAYED?: InputMaybe - ON_TIME?: InputMaybe -} - -export type DeathInput = { - FEE?: InputMaybe - PRINT_IN_ADVANCE?: InputMaybe - REGISTRATION_TARGET?: InputMaybe -} - export type DeathRegistration = EventRegistration & { __typename?: 'DeathRegistration' _fhirIDMap?: Maybe @@ -684,6 +578,19 @@ export type DeclarationsStartedMetrics = { officeDeclarations: Scalars['Int'] } +export type DeclareAction = { + __typename?: 'DeclareAction' + createdAt: Scalars['DateTime'] + createdBy: Scalars['String'] + data: Array + identifiers: Identifiers + type: Scalars['String'] +} + +export type DeclareActionInput = { + data: Array +} + export type Dummy = { __typename?: 'Dummy' dummy: Scalars['String'] @@ -704,10 +611,17 @@ export type Estimation = { totalEstimation: Scalars['Float'] } -export enum Event { - Birth = 'birth', - Death = 'death', - Marriage = 'marriage' +export type Event = { + __typename?: 'Event' + actions: Array + createdAt: Scalars['DateTime'] + id: Scalars['String'] + type: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type EventInput = { + type: Scalars['String'] } export type EventMetrics = { @@ -797,6 +711,12 @@ export type EventSearchSet = { type?: Maybe } +export enum EventType { + Birth = 'birth', + Death = 'death', + Marriage = 'marriage' +} + export type FhiridMap = { composition?: InputMaybe encounter?: InputMaybe @@ -805,21 +725,15 @@ export type FhiridMap = { questionnaireResponse?: InputMaybe } -export type Features = { - __typename?: 'Features' - DEATH_REGISTRATION?: Maybe - EXTERNAL_VALIDATION_WORKQUEUE?: Maybe - INFORMANT_SIGNATURE?: Maybe - MARRIAGE_REGISTRATION?: Maybe - PRINT_DECLARATION?: Maybe +export type Field = { + __typename?: 'Field' + id: Scalars['String'] + value: Scalars['FieldValue'] } -export type FeaturesInput = { - DEATH_REGISTRATION?: InputMaybe - EXTERNAL_VALIDATION_WORKQUEUE?: InputMaybe - INFORMANT_SIGNATURE?: InputMaybe - MARRIAGE_REGISTRATION?: InputMaybe - PRINT_DECLARATION?: InputMaybe +export type FieldInput = { + id: Scalars['String'] + value: Scalars['FieldValue'] } export enum Gender { @@ -832,6 +746,7 @@ export enum Gender { export type History = { __typename?: 'History' action?: Maybe + certificateTemplateId?: Maybe certificates?: Maybe>> comments?: Maybe>> date?: Maybe @@ -882,6 +797,17 @@ export type Identifier = { value?: Maybe } +export type IdentifierInput = { + type: Scalars['String'] + value: Scalars['String'] +} + +export type Identifiers = { + __typename?: 'Identifiers' + registrationNumber: Scalars['String'] + trackingId: Scalars['String'] +} + export type IdentityInput = { fieldsModifiedByIdentity?: InputMaybe>> id?: InputMaybe @@ -897,11 +823,6 @@ export type IdentityType = { type?: Maybe } -export enum ImageFit { - Fill = 'FILL', - Tile = 'TILE' -} - export type InputOutput = { __typename?: 'InputOutput' value: Scalars['FieldValue'] @@ -917,10 +838,13 @@ export type IntegratedSystem = { } export enum IntegratingSystemType { - Mosip = 'MOSIP', Other = 'OTHER' } +export type IssueActionInput = { + data: Array +} + export type LabelInput = { label: Scalars['String'] lang: Scalars['String'] @@ -941,6 +865,7 @@ export type Location = { altitude?: Maybe description?: Maybe geoData?: Maybe + hierarchy?: Maybe> id: Scalars['ID'] identifier?: Maybe> latitude?: Maybe @@ -987,26 +912,6 @@ export type LocationWiseEstimationMetric = { withinTarget: Scalars['Float'] } -export type LoginBackground = { - __typename?: 'LoginBackground' - backgroundColor?: Maybe - backgroundImage?: Maybe - imageFit?: Maybe -} - -export type LoginBackgroundInput = { - backgroundColor?: InputMaybe - backgroundImage?: InputMaybe - imageFit?: InputMaybe -} - -export type Marriage = { - __typename?: 'Marriage' - FEE?: Maybe - PRINT_IN_ADVANCE?: Maybe - REGISTRATION_TARGET?: Maybe -} - export type MarriageEventSearchSet = EventSearchSet & { __typename?: 'MarriageEventSearchSet' brideIdentifier?: Maybe @@ -1020,23 +925,6 @@ export type MarriageEventSearchSet = EventSearchSet & { type?: Maybe } -export type MarriageFee = { - __typename?: 'MarriageFee' - DELAYED?: Maybe - ON_TIME?: Maybe -} - -export type MarriageFeeInput = { - DELAYED?: InputMaybe - ON_TIME?: InputMaybe -} - -export type MarriageInput = { - FEE?: InputMaybe - PRINT_IN_ADVANCE?: InputMaybe - REGISTRATION_TARGET?: InputMaybe -} - export type MarriageRegistration = EventRegistration & { __typename?: 'MarriageRegistration' _fhirIDMap?: Maybe @@ -1103,25 +991,29 @@ export type Mutation = { __typename?: 'Mutation' activateUser?: Maybe approveBirthRegistrationCorrection: Scalars['ID'] + approveCorrectionEvent: Event approveDeathRegistrationCorrection: Scalars['ID'] approveMarriageRegistrationCorrection: Scalars['ID'] auditUser?: Maybe bookmarkAdvancedSearch?: Maybe + certifyEvent: Event changeAvatar?: Maybe changeEmail?: Maybe changePassword?: Maybe changePhone?: Maybe + confirmRegistration: Scalars['ID'] createBirthRegistration: CreatedIds createBirthRegistrationCorrection: Scalars['ID'] createDeathRegistration: CreatedIds createDeathRegistrationCorrection: Scalars['ID'] + createEvent: Event createMarriageRegistration: CreatedIds createMarriageRegistrationCorrection: Scalars['ID'] - createNotification: Notification - createOrUpdateCertificateSVG?: Maybe createOrUpdateUser: User deactivateSystem?: Maybe + declareEvent: Event deleteSystem?: Maybe + issueEvent: Event markBirthAsCertified: Scalars['ID'] markBirthAsIssued: Scalars['ID'] markBirthAsRegistered: Scalars['ID'] @@ -1142,22 +1034,27 @@ export type Mutation = { markMarriageAsIssued: Scalars['ID'] markMarriageAsRegistered: Scalars['ID'] markMarriageAsValidated?: Maybe + notifyEvent: Event reactivateSystem?: Maybe refreshSystemSecret?: Maybe + registerEvent: Event registerSystem?: Maybe + reinstateEvent: Event + rejectCorrectionEvent: Event + rejectRegistration: Scalars['ID'] rejectRegistrationCorrection: Scalars['ID'] removeBookmarkedAdvancedSearch?: Maybe + requestCorrectionEvent: Event requestRegistrationCorrection: Scalars['ID'] resendInvite?: Maybe resetPasswordInvite?: Maybe - toggleInformantSMSNotification?: Maybe> - updateApplicationConfig?: Maybe - updateBirthRegistration: Scalars['ID'] + revokeCorrectionEvent: Event + revokeEvent: Event updateDeathRegistration: Scalars['ID'] updatePermissions?: Maybe updateRole: Response + upsertRegistrationIdentifier: Scalars['ID'] usernameReminder?: Maybe - voidNotification?: Maybe } export type MutationActivateUserArgs = { @@ -1171,6 +1068,11 @@ export type MutationApproveBirthRegistrationCorrectionArgs = { id: Scalars['ID'] } +export type MutationApproveCorrectionEventArgs = { + eventId: Scalars['ID'] + input: ApproveCorrectionActionInput +} + export type MutationApproveDeathRegistrationCorrectionArgs = { details: DeathRegistrationInput id: Scalars['ID'] @@ -1192,6 +1094,11 @@ export type MutationBookmarkAdvancedSearchArgs = { bookmarkSearchInput: BookmarkSearchInput } +export type MutationCertifyEventArgs = { + eventId: Scalars['ID'] + input: CertifyActionInput +} + export type MutationChangeAvatarArgs = { avatar: AvatarInput userId: Scalars['String'] @@ -1217,6 +1124,11 @@ export type MutationChangePhoneArgs = { verifyCode: Scalars['String'] } +export type MutationConfirmRegistrationArgs = { + details: ConfirmRegistrationInput + id: Scalars['ID'] +} + export type MutationCreateBirthRegistrationArgs = { details: BirthRegistrationInput } @@ -1235,6 +1147,10 @@ export type MutationCreateDeathRegistrationCorrectionArgs = { id: Scalars['ID'] } +export type MutationCreateEventArgs = { + event: EventInput +} + export type MutationCreateMarriageRegistrationArgs = { details: MarriageRegistrationInput } @@ -1244,14 +1160,6 @@ export type MutationCreateMarriageRegistrationCorrectionArgs = { id: Scalars['ID'] } -export type MutationCreateNotificationArgs = { - details: NotificationInput -} - -export type MutationCreateOrUpdateCertificateSvgArgs = { - certificateSVG: CertificateSvgInput -} - export type MutationCreateOrUpdateUserArgs = { user: UserInput } @@ -1260,10 +1168,20 @@ export type MutationDeactivateSystemArgs = { clientId: Scalars['ID'] } +export type MutationDeclareEventArgs = { + eventId: Scalars['ID'] + input: DeclareActionInput +} + export type MutationDeleteSystemArgs = { clientId: Scalars['ID'] } +export type MutationIssueEventArgs = { + eventId: Scalars['ID'] + input: IssueActionInput +} + export type MutationMarkBirthAsCertifiedArgs = { details: BirthRegistrationInput id: Scalars['ID'] @@ -1366,6 +1284,11 @@ export type MutationMarkMarriageAsValidatedArgs = { id: Scalars['ID'] } +export type MutationNotifyEventArgs = { + eventId: Scalars['ID'] + input: NotifyActionInput +} + export type MutationReactivateSystemArgs = { clientId: Scalars['ID'] } @@ -1374,10 +1297,30 @@ export type MutationRefreshSystemSecretArgs = { clientId: Scalars['String'] } +export type MutationRegisterEventArgs = { + eventId: Scalars['ID'] + input: RegisterActionInput +} + export type MutationRegisterSystemArgs = { system?: InputMaybe } +export type MutationReinstateEventArgs = { + eventId: Scalars['ID'] + input: ReinstateActionInput +} + +export type MutationRejectCorrectionEventArgs = { + eventId: Scalars['ID'] + input: RejectCorrectionActionInput +} + +export type MutationRejectRegistrationArgs = { + details: RejectRegistrationInput + id: Scalars['ID'] +} + export type MutationRejectRegistrationCorrectionArgs = { details: CorrectionRejectionInput id: Scalars['ID'] @@ -1387,6 +1330,11 @@ export type MutationRemoveBookmarkedAdvancedSearchArgs = { removeBookmarkedSearchInput: RemoveBookmarkedSeachInput } +export type MutationRequestCorrectionEventArgs = { + eventId: Scalars['ID'] + input: RequestCorrectionActionInput +} + export type MutationRequestRegistrationCorrectionArgs = { details: CorrectionInput id: Scalars['ID'] @@ -1400,17 +1348,14 @@ export type MutationResetPasswordInviteArgs = { userId: Scalars['String'] } -export type MutationToggleInformantSmsNotificationArgs = { - smsNotifications?: InputMaybe> +export type MutationRevokeCorrectionEventArgs = { + eventId: Scalars['ID'] + input: RevokeCorrectionActionInput } -export type MutationUpdateApplicationConfigArgs = { - applicationConfig?: InputMaybe -} - -export type MutationUpdateBirthRegistrationArgs = { - details: BirthRegistrationInput - id: Scalars['ID'] +export type MutationRevokeEventArgs = { + eventId: Scalars['ID'] + input: RevokeActionInput } export type MutationUpdateDeathRegistrationArgs = { @@ -1426,34 +1371,14 @@ export type MutationUpdateRoleArgs = { systemRole?: InputMaybe } -export type MutationUsernameReminderArgs = { - userId: Scalars['String'] -} - -export type MutationVoidNotificationArgs = { - id: Scalars['ID'] -} - -export type Notification = { - __typename?: 'Notification' - child?: Maybe - createdAt?: Maybe - father?: Maybe +export type MutationUpsertRegistrationIdentifierArgs = { id: Scalars['ID'] - informant?: Maybe - location?: Maybe - mother?: Maybe - updatedAt?: Maybe + identifierType: Scalars['String'] + identifierValue: Scalars['String'] } -export type NotificationInput = { - child?: InputMaybe - createdAt?: InputMaybe - father?: InputMaybe - informant?: InputMaybe - location?: InputMaybe - mother?: InputMaybe - updatedAt?: InputMaybe +export type MutationUsernameReminderArgs = { + userId: Scalars['String'] } export type NotificationResult = { @@ -1466,39 +1391,16 @@ export enum NotificationType { Sms = 'SMS' } -export type OidpUserAddress = { - __typename?: 'OIDPUserAddress' - city?: Maybe - country?: Maybe - formatted?: Maybe - locality?: Maybe - postal_code?: Maybe - region?: Maybe - street_address?: Maybe +export type NotifyAction = { + __typename?: 'NotifyAction' + createdAt: Scalars['DateTime'] + createdBy: Scalars['String'] + data: Array + type: Scalars['String'] } -export type OidpUserInfo = { - __typename?: 'OIDPUserInfo' - address?: Maybe - birthdate?: Maybe - email?: Maybe - email_verified?: Maybe - family_name?: Maybe - gender?: Maybe - given_name?: Maybe - locale?: Maybe - middle_name?: Maybe - name?: Maybe - nickname?: Maybe - phone_number?: Maybe - phone_number_verified?: Maybe - picture?: Maybe - preferred_username?: Maybe - profile?: Maybe - sub: Scalars['String'] - updated_at?: Maybe - website?: Maybe - zoneinfo?: Maybe +export type NotifyActionInput = { + data: Array } export type ObservationFhirids = { @@ -1627,12 +1529,10 @@ export type Query = { fetchRegistrationCountByStatus?: Maybe fetchRegistrationForViewing?: Maybe fetchSystem?: Maybe - getActiveCertificatesSVG?: Maybe> - getCertificateSVG?: Maybe getDeclarationsStartedMetrics?: Maybe + getEvent: Event getEventsWithProgress?: Maybe getLocationStatistics?: Maybe - getOIDPUserInfo?: Maybe getRegistrationsListByFilter?: Maybe getSystemRoles?: Maybe> getTotalCertifications?: Maybe> @@ -1644,12 +1544,8 @@ export type Query = { getUserByEmail?: Maybe getUserByMobile?: Maybe getVSExports?: Maybe - hasChildLocation?: Maybe - informantSMSNotifications?: Maybe> + isLeafLevelLocation: Scalars['Boolean'] listBirthRegistrations?: Maybe - listNotifications?: Maybe>> - locationById?: Maybe - locationsByParent?: Maybe>> queryPersonByIdentifier?: Maybe queryPersonByNidIdentifier?: Maybe queryRegistrationByIdentifier?: Maybe @@ -1714,17 +1610,16 @@ export type QueryFetchSystemArgs = { clientId: Scalars['ID'] } -export type QueryGetCertificateSvgArgs = { - event: Event - status: CertificateStatus -} - export type QueryGetDeclarationsStartedMetricsArgs = { locationId: Scalars['String'] timeEnd: Scalars['String'] timeStart: Scalars['String'] } +export type QueryGetEventArgs = { + eventId: Scalars['ID'] +} + export type QueryGetEventsWithProgressArgs = { compositionType?: InputMaybe>> count?: InputMaybe @@ -1739,13 +1634,6 @@ export type QueryGetLocationStatisticsArgs = { populationYear: Scalars['Int'] } -export type QueryGetOidpUserInfoArgs = { - clientId: Scalars['String'] - code: Scalars['String'] - grantType?: InputMaybe - redirectUri: Scalars['String'] -} - export type QueryGetRegistrationsListByFilterArgs = { event: Scalars['String'] filterBy: Scalars['String'] @@ -1793,7 +1681,7 @@ export type QueryGetTotalPaymentsArgs = { } export type QueryGetUserArgs = { - userId?: InputMaybe + userId: Scalars['String'] } export type QueryGetUserAuditLogArgs = { @@ -1805,15 +1693,15 @@ export type QueryGetUserAuditLogArgs = { } export type QueryGetUserByEmailArgs = { - email?: InputMaybe + email: Scalars['String'] } export type QueryGetUserByMobileArgs = { - mobile?: InputMaybe + mobile: Scalars['String'] } -export type QueryHasChildLocationArgs = { - parentId?: InputMaybe +export type QueryIsLeafLevelLocationArgs = { + locationId: Scalars['String'] } export type QueryListBirthRegistrationsArgs = { @@ -1826,23 +1714,6 @@ export type QueryListBirthRegistrationsArgs = { userId?: InputMaybe } -export type QueryListNotificationsArgs = { - from?: InputMaybe - locationIds?: InputMaybe>> - status?: InputMaybe - to?: InputMaybe - userId?: InputMaybe -} - -export type QueryLocationByIdArgs = { - locationId?: InputMaybe -} - -export type QueryLocationsByParentArgs = { - parentId?: InputMaybe - type?: InputMaybe -} - export type QueryQueryPersonByIdentifierArgs = { identifier: Scalars['ID'] } @@ -1981,6 +1852,19 @@ export type RegWorkflowInput = { user?: InputMaybe } +export type RegisterAction = { + __typename?: 'RegisterAction' + createdAt: Scalars['DateTime'] + createdBy: Scalars['String'] + data: Array + identifiers: Identifiers + type: Scalars['String'] +} + +export type RegisterActionInput = { + data: Array +} + export type Registration = { __typename?: 'Registration' _fhirID?: Maybe @@ -1988,7 +1872,6 @@ export type Registration = { attachments?: Maybe>> book?: Maybe brideSignature?: Maybe - brideSignatureURI?: Maybe certificates?: Maybe>> contact?: Maybe contactEmail?: Maybe @@ -1997,12 +1880,10 @@ export type Registration = { draftId?: Maybe duplicates?: Maybe>> groomSignature?: Maybe - groomSignatureURI?: Maybe id?: Maybe inCompleteFields?: Maybe informantType?: Maybe informantsSignature?: Maybe - informantsSignatureURI?: Maybe otherInformantType?: Maybe page?: Maybe paperFormID?: Maybe @@ -2011,9 +1892,7 @@ export type Registration = { trackingId?: Maybe type?: Maybe witnessOneSignature?: Maybe - witnessOneSignatureURI?: Maybe witnessTwoSignature?: Maybe - witnessTwoSignatureURI?: Maybe } export type RegistrationCountResult = { @@ -2074,12 +1953,25 @@ export enum RegistrationType { Marriage = 'MARRIAGE' } +export type ReinstateActionInput = { + data: Array +} + export type Reinstated = { __typename?: 'Reinstated' registrationStatus?: Maybe taskEntryResourceID: Scalars['ID'] } +export type RejectCorrectionActionInput = { + data: Array +} + +export type RejectRegistrationInput = { + comment?: InputMaybe + reason: Scalars['String'] +} + export type RelatedPerson = { __typename?: 'RelatedPerson' _fhirID?: Maybe @@ -2142,11 +2034,23 @@ export type RemoveBookmarkedSeachInput = { userId: Scalars['String'] } +export type RequestCorrectionActionInput = { + data: Array +} + export type Response = { __typename?: 'Response' roleIdMap: Scalars['Map'] } +export type RevokeActionInput = { + data: Array +} + +export type RevokeCorrectionActionInput = { + data: Array +} + export type Role = { __typename?: 'Role' _id: Scalars['ID'] @@ -2164,21 +2068,6 @@ export type RoleLabel = { lang: Scalars['String'] } -export type SmsNotification = { - __typename?: 'SMSNotification' - createdAt: Scalars['String'] - enabled: Scalars['Boolean'] - id?: Maybe - name: Scalars['String'] - updatedAt: Scalars['String'] -} - -export type SmsNotificationInput = { - enabled: Scalars['Boolean'] - id: Scalars['String'] - name: Scalars['String'] -} - export type SearchFieldAgentResponse = { __typename?: 'SearchFieldAgentResponse' avatar?: Maybe @@ -2376,7 +2265,6 @@ export type UpdatePermissionsInput = { export type User = { __typename?: 'User' avatar?: Maybe - catchmentArea?: Maybe> creationDate: Scalars['String'] device?: Maybe email?: Maybe @@ -2432,16 +2320,7 @@ export type UserIdentifierInput = { value?: InputMaybe } -export type UserInfo = { - __typename?: 'UserInfo' - districtFhirId?: Maybe - locationLevel3FhirId?: Maybe - oidpUserInfo?: Maybe - stateFhirId?: Maybe -} - export type UserInput = { - catchmentArea?: InputMaybe>> device?: InputMaybe email?: InputMaybe id?: InputMaybe diff --git a/e2e/helpers.ts b/e2e/helpers.ts index 8f37aa54..8312c31a 100644 --- a/e2e/helpers.ts +++ b/e2e/helpers.ts @@ -128,6 +128,7 @@ export const uploadImage = async ( await locator.click() const fileChooser = await fileChooserPromise await fileChooser.setFiles(image) + return fileChooser } /** diff --git a/e2e/testcases/birth/1-birth-event-declaration.spec.ts b/e2e/testcases/birth/1-birth-event-declaration.spec.ts index 78426dfa..69335fbc 100644 --- a/e2e/testcases/birth/1-birth-event-declaration.spec.ts +++ b/e2e/testcases/birth/1-birth-event-declaration.spec.ts @@ -426,10 +426,10 @@ test.describe('1. Birth event declaration', () => { /* * Expected result: should - * - be navigated to "in-progress" tab + * - be navigated to "my-drafts" tab * - find the declared birth event record on this page list with saved data */ - await expect(page.locator('#content-name')).toHaveText('In progress') + await expect(page.locator('#content-name')).toHaveText('My drafts') await expect(page.getByText(/seconds ago/)).toBeVisible() }) }) @@ -483,13 +483,13 @@ test.describe('1. Birth event declaration', () => { test('1.10.3 Click Confirm', async ({ page }) => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) @@ -552,13 +552,13 @@ test.describe('1. Birth event declaration', () => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) diff --git a/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts index 6a076a51..22a2a359 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts @@ -20,8 +20,8 @@ test.describe.serial('1. Birth declaration case - 1', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, gender: 'Male', birthDate: getRandomDate(0, 200) @@ -35,8 +35,8 @@ test.describe.serial('1. Birth declaration case - 1', () => { informantEmail: faker.internet.email(), mother: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, birthDate: getRandomDate(20, 200), nationality: 'Farajaland', @@ -60,8 +60,8 @@ test.describe.serial('1. Birth declaration case - 1', () => { }, father: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, birthDate: getRandomDate(22, 200), nationality: 'Gabon', diff --git a/e2e/testcases/birth/queries.ts b/e2e/testcases/birth/queries.ts index b4c30bc7..b14dd2f8 100644 --- a/e2e/testcases/birth/queries.ts +++ b/e2e/testcases/birth/queries.ts @@ -150,6 +150,31 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` contactRelationship contactPhoneNumber contactEmail + assignment { + practitionerId + firstName + lastName + officeName + avatarURL + } + certificates { + hasShowedVerifiedDocument + certificateTemplateId + collector { + relationship + otherRelationship + name { + use + firstNames + familyName + } + telecom { + system + value + use + } + } + } duplicates { compositionId trackingId @@ -207,6 +232,7 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` requesterOther noSupportingDocumentationRequired hasShowedVerifiedDocument + certificateTemplateId date action regStatus @@ -250,13 +276,13 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` user { id role { - _id - labels { - lang - label + id + label { + id + defaultMessage + description } } - systemRole name { firstNames familyName @@ -295,6 +321,7 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` } certificates { hasShowedVerifiedDocument + certificateTemplateId collector { relationship otherRelationship @@ -309,6 +336,21 @@ export const GET_BIRTH_REGISTRATION_FOR_REVIEW = print(gql` use } } + certifier { + name { + use + firstNames + familyName + } + role { + id + label { + id + defaultMessage + description + } + } + } } duplicateOf potentialDuplicates 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 b6bef512..e65577e2 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts @@ -128,6 +128,12 @@ test.describe.serial('Correct record - 2', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'No, make correction' }).click() 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 5bb865e7..2b7decd7 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts @@ -126,6 +126,12 @@ test.describe.serial(' Correct record - 3', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'Yes, print certificate' }).click() 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 0a138ade..50aa0541 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts @@ -121,6 +121,12 @@ test.describe.serial(' Correct record - 5', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'No, make correction' }).click() 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 8efaba60..acb294bb 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts @@ -113,6 +113,12 @@ test.describe.serial(' Correct record - 6', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'Yes, print certificate' }).click() 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 bc6718b4..de74be0f 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts @@ -113,6 +113,12 @@ test.describe.serial(' Correct record - 8', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'No, make correction' }).click() 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 2e5d5ae7..3eef960e 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts @@ -112,6 +112,12 @@ test.describe.serial(' Correct record - 9', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'Yes, print certificate' }).click() diff --git a/e2e/testcases/correction-death/correct-death-record-11.spec.ts b/e2e/testcases/correction-death/correct-death-record-11.spec.ts index 37603581..7d8ca245 100644 --- a/e2e/testcases/correction-death/correct-death-record-11.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-11.spec.ts @@ -82,6 +82,12 @@ test.describe.serial(' Correct record - 11', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'No, make correction' }).click() diff --git a/e2e/testcases/correction-death/correct-death-record-12.spec.ts b/e2e/testcases/correction-death/correct-death-record-12.spec.ts index 6615b3eb..97fcceed 100644 --- a/e2e/testcases/correction-death/correct-death-record-12.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-12.spec.ts @@ -120,6 +120,12 @@ test.describe.serial(' Correct record - 12', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'Yes, print certificate' }).click() 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 0c1fab52..2a537ece 100644 --- a/e2e/testcases/correction-death/correct-death-record-14.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-14.spec.ts @@ -86,6 +86,12 @@ test.describe.serial(' Correct record - 14', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'No, make correction' }).click() diff --git a/e2e/testcases/correction-death/correct-death-record-15.spec.ts b/e2e/testcases/correction-death/correct-death-record-15.spec.ts index 909bee49..416dfcbf 100644 --- a/e2e/testcases/correction-death/correct-death-record-15.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-15.spec.ts @@ -86,6 +86,12 @@ test.describe.serial(' Correct record - 15', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'Yes, print certificate' }).click() diff --git a/e2e/testcases/correction-death/correct-death-record-17.spec.ts b/e2e/testcases/correction-death/correct-death-record-17.spec.ts index f52ae130..edd30e4c 100644 --- a/e2e/testcases/correction-death/correct-death-record-17.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-17.spec.ts @@ -88,6 +88,12 @@ test.describe.serial(' Correct record - 17', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'No, make correction' }).click() 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 aa0747a7..5fc26dbb 100644 --- a/e2e/testcases/correction-death/correct-death-record-18.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-18.spec.ts @@ -86,6 +86,12 @@ test.describe.serial(' Correct record - 18', () => { await page.getByRole('button', { name: 'Action' }).first().click() await getAction(page, 'Print certified copy').click() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() await page.getByLabel('Print in advance').check() await page.getByRole('button', { name: 'Continue' }).click() await page.getByRole('button', { name: 'Yes, print certificate' }).click() diff --git a/e2e/testcases/death/1-death-event-declaration.spec.ts b/e2e/testcases/death/1-death-event-declaration.spec.ts index 1f9d2e9c..dfc7e8d5 100644 --- a/e2e/testcases/death/1-death-event-declaration.spec.ts +++ b/e2e/testcases/death/1-death-event-declaration.spec.ts @@ -406,10 +406,10 @@ test.describe('1. Death event declaration', () => { /* * Expected result: should - * - be navigated to "in-progress" tab + * - be navigated to "my-drafts" tab * - find the declared death event record on this page list with saved data */ - await expect(page.locator('#content-name')).toHaveText('In progress') + await expect(page.locator('#content-name')).toHaveText('My drafts') await expect(page.getByText(/seconds ago/)).toBeVisible() }) }) @@ -463,13 +463,13 @@ test.describe('1. Death event declaration', () => { test('1.10.3 Click Confirm', async ({ page }) => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) @@ -532,13 +532,13 @@ test.describe('1. Death event declaration', () => { await page.getByRole('button', { name: 'Confirm' }).click() /* - * Expected result: should be navigated to "in-progress" tab but no draft will be saved + * Expected result: should be navigated to "my-drafts" tab but no draft will be saved */ await page.waitForTimeout(500) // This page renders twice at first await expect( - page.locator('#content-name', { hasText: 'In progress' }) + page.locator('#content-name', { hasText: 'My drafts' }) ).toBeVisible() await expect(page.getByText(/seconds ago/)).toBeHidden() }) diff --git a/e2e/testcases/death/helpers.ts b/e2e/testcases/death/helpers.ts index 806b6855..59aa1140 100644 --- a/e2e/testcases/death/helpers.ts +++ b/e2e/testcases/death/helpers.ts @@ -25,6 +25,7 @@ export type DeathDeclarationInput = { } } event?: { + date?: string placeOfDeath?: | 'Health Institution' | "Deceased's usual place of residence" @@ -177,7 +178,9 @@ export async function createDeathDeclaration( } ], deceased: { - deathDate: formatDateObjectTo_yyyyMMdd(declaration.event.date) + deathDate: + details.event?.date || + formatDateObjectTo_yyyyMMdd(declaration.event.date) } }, eventLocation: diff --git a/e2e/testcases/death/queries.ts b/e2e/testcases/death/queries.ts index 52eb3734..d994b913 100644 --- a/e2e/testcases/death/queries.ts +++ b/e2e/testcases/death/queries.ts @@ -214,6 +214,24 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` contactRelationship contactPhoneNumber contactEmail + certificates { + hasShowedVerifiedDocument + certificateTemplateId + collector { + relationship + otherRelationship + name { + use + firstNames + familyName + } + telecom { + system + value + use + } + } + } duplicates { compositionId trackingId @@ -287,7 +305,9 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` } otherReason requester + requesterOther hasShowedVerifiedDocument + certificateTemplateId noSupportingDocumentationRequired date action @@ -318,13 +338,14 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` user { id role { - _id - labels { - lang - label + id + label { + id + defaultMessage + description } } - systemRole + name { firstNames familyName @@ -363,6 +384,7 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` } certificates { hasShowedVerifiedDocument + certificateTemplateId collector { relationship otherRelationship @@ -377,6 +399,21 @@ export const GET_DEATH_REGISTRATION_FOR_REVIEW = print(gql` use } } + certifier { + name { + use + firstNames + familyName + } + role { + id + label { + id + defaultMessage + description + } + } + } } duplicateOf potentialDuplicates diff --git a/e2e/testcases/print-certificate/birth/36.01-02-validation-of-printing-certificate.spec.ts b/e2e/testcases/print-certificate/birth/36.01-02-validation-of-printing-certificate.spec.ts new file mode 100644 index 00000000..50440924 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.01-02-validation-of-printing-certificate.spec.ts @@ -0,0 +1,67 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('Certified copies', () => { + let declaration: BirthDeclaration + let trackingId = '' + + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('1.0 Click on "Print certified copy" from action menu', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + trackingId = response.trackingId + + await expect( + page + .url() + .includes(`/cert/collector/${declaration.id}/birth/certCollector`) + ).toBeTruthy() + }) + + test.describe('2.0 Validate "Certify record" page', async () => { + test('2.1 Click continue without selecting collector type and template type', async () => { + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.getByText('Please select certificate type') + ).toBeVisible() + await expect( + page.getByText('Please select who is collecting the certificate') + ).toBeVisible() + }) + + test('2.2 Click continue without selecting collector type', async () => { + await page.reload({ waitUntil: 'networkidle' }) + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.getByText('Please select certificate type') + ).toBeVisible() + }) + + test('2.3 Click continue without selecting template type', async () => { + await page.reload({ waitUntil: 'networkidle' }) + + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() + + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.getByText('Please select who is collecting the certificate') + ).toBeVisible() + }) + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.03-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.03-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..80b47608 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.03-validate-certify-record-page.spec.ts @@ -0,0 +1,100 @@ +import { expect, test, type Page } from '@playwright/test' +import { format, parseISO } from 'date-fns' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('3.0 Validate "Certify record" page', () => { + let declaration: BirthDeclaration + let trackingId = '' + + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('3.1 should navigate to Verify their identity page', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + trackingId = response.trackingId + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + }) + + test('3.2 should see informant Id, names, nationality and dob', async () => { + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Verify their identity' + ) + + await expect( + page.locator(`text="${declaration.informant.name[0].firstNames}"`) + ).toBeVisible() + + await expect( + page.locator(`text="${declaration.informant.name[0].familyName}"`) + ).toBeVisible() + + await expect( + page.locator( + `text="${format( + parseISO(declaration.informant.birthDate), + 'dd MMMM yyyy' + )}"` + ) + ).toBeVisible() + + await expect(page.getByRole('button', { name: 'Verified' })).toBeVisible() + await expect( + page.getByRole('button', { name: 'Identity does not match' }) + ).toBeVisible() + }) + + test('3.3 should navigate to collect payment page on "Verified" button click', async () => { + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/birth`) + ).toBeTruthy() + await page.goBack() + }) + + test('3.4 should open warning modal on "Identity does not match" button click', async () => { + await page.getByRole('button', { name: 'Identity does not match' }).click() + await expect(page.locator('#withoutVerificationPrompt')).toContainText( + 'Print without proof of ID?', + { useInnerText: true } + ) + }) + + test('3.5 click warning modal confirm button should take to payment page', async () => { + await page.getByRole('button', { name: 'Confirm' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/birth`) + ).toBeTruthy() + await page.goBack() + }) + + test('3.6 click warning modal cancel button should close the modal', async () => { + await page.getByRole('button', { name: 'Identity does not match' }).click() + await page.getByRole('button', { name: 'Cancel' }).click() + console.log(page.locator('#withoutVerificationPrompt')) + await expect(page.locator('#withoutVerificationPrompt')).toBeHidden() + await page.goBack() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.04-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.04-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..3b2bc031 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.04-validate-certify-record-page.spec.ts @@ -0,0 +1,35 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('4.0 Validate "Certify record" page', () => { + let declaration: BirthDeclaration + let trackingId = '' + + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('4.1 continue with print in advance redirect to review page', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + trackingId = response.trackingId + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Birth Certificate', { exact: true }).click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..d50332cb --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts @@ -0,0 +1,116 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' +import { uploadImage } from '../../../helpers' + +test.describe.serial('7.0 Validate collect payment page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('5.1 check collect payment page header', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page.getByText('Birth Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to someone else').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page + .url() + .includes(`/collector/${declaration.id}/birth/otherCertCollector`) + ).toBeTruthy() + }) + + test('5.2 should be able to select "No ID available" and no other ID field will be visible', async () => { + await page.locator('#iDType-form-input').click() + await page.getByText('No ID available').click() + await expect(page.locator('#iD-form-input')).toBeHidden() + }) + + test('5.2 should be able to select any type of id and correspondent id input will be visible', async () => { + await page.locator('#iDType-form-input').click() + await page.getByText('Passport', { exact: true }).click() + await expect(page.locator('#iD-form-input')).toBeVisible() + await expect(page.locator('#iD_label')).toContainText('Passport') + + await page.locator('#iDType-form-input').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.locator('#iD-form-input')).toBeVisible() + await expect(page.locator('#iDTypeOther-form-input')).toBeVisible() + await expect(page.locator('#iDTypeOther_label')).toContainText( + 'Other type of ID' + ) + }) + + test('5.2 should be able to select National ID and correspondent id input will be visible with validation rules', async () => { + await page.locator('#iDType-form-input').click() + await page.getByText('National ID', { exact: true }).click() + await page.fill('#iD', '1234567') + + await expect(page.locator('#iD')).toHaveValue('1234567') + await page.locator('#lastName').click() + await expect(page.locator('#iD_error')).toContainText( + 'The National ID can only be numeric and must be 10 digits long' + ) + await page.fill('#iD', '1235678922') + await expect(page.locator('#iD_error')).toBeHidden() + }) + + test('5.3 should be able to enter first name', async () => { + await page.fill('#firstName', 'Muhammed Tareq') + await expect(page.locator('#firstName')).toHaveValue('Muhammed Tareq') + }) + + test('5.4 should be able to enter lastname name', async () => { + await page.fill('#lastName', 'Aziz') + await expect(page.locator('#lastName')).toHaveValue('Aziz') + }) + + test('5.5 keep relationship null and continue', async () => { + await page.getByRole('button', { name: 'Continue' }).click() + await expect(page.locator('#form_error')).toContainText( + 'Complete all the mandatory fields' + ) + }) + + test('5.6 should be able to enter relationship', async () => { + await page.fill('#relationship', 'Uncle') + await expect(page.locator('#relationship')).toHaveValue('Uncle') + }) + + test("5.7 Fill all mandatory field and click 'Continue' should navigate to affidavit page", async () => { + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/cert/collector/${declaration.id}/birth/affidavit`) + ).toBeTruthy() + }) + + test.describe('6.0 Validate "Upload signed affidavit" page:', async () => { + test('6.1 Click continue without adding any file or clicking the checkbox should show error', async () => { + await page.getByRole('button', { name: 'Continue' }).click() + }) + + test('6.2 Should be able to add file and navigate to the "Ready to certify?" page.', async () => { + const path = require('path') + const attachmentPath = path.resolve(__dirname, './528KB-random.png') + const inputFile = await page.locator( + 'input[name="affidavitFile"][type="file"]' + ) + await inputFile.setInputFiles(attachmentPath) + await expect( + page.getByRole('button', { name: 'Signed affidavit' }) + ).toBeVisible() + }) + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.07-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.07-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..94fe0ea8 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.07-validate-certify-record-page.spec.ts @@ -0,0 +1,78 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' +import { format } from 'date-fns' +import { CLIENT_URL } from '../../../constants' + +test.describe.serial('7.0 Validate "Certify record" page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('7.1 continue with "Print and issue to informant (Brother)" redirect to Collector details page', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page.getByText('Birth Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/birth`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText('Collect payment') + await expect(page.locator('#service')).toContainText( + 'Birth registration before 30 days of date of birth' + ) + await expect(page.locator('#amountDue')).toContainText('$5.00') + await expect(page.locator('#Continue')).toBeVisible() + }) + + test('7.2 should navigate to ready to certify page on continue button click', async () => { + await page.locator('#Continue').click() + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + }) + + test('7.3 should skip payment page if payment is 0', async () => { + await page.goto(`${CLIENT_URL}/registration-home/print/1`) + const response = await getDeclarationForPrintCertificate(page, { + child: { birthDate: format(new Date(), 'yyyy-MM-dd') }, + isLoggedIn: true + }) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.08-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.08-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..40b44b4e --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.08-validate-certify-record-page.spec.ts @@ -0,0 +1,65 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' +import { format } from 'date-fns' +import { CLIENT_URL } from '../../../constants' + +test.describe.serial('8.0 Validate "Payment" page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('7.1 Payment page should correct payment fee based on selected template', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page.getByText('Birth Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/birth`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText('Collect payment') + await expect(page.locator('#service')).toContainText( + 'Birth registration before 30 days of date of birth' + ) + await expect(page.locator('#amountDue')).toContainText('$5.00') + await expect(page.locator('#Continue')).toBeVisible() + + await page.goBack() + await page.goBack() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.09-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.09-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..b15115b8 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.09-validate-certify-record-page.spec.ts @@ -0,0 +1,53 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('9.0 Validate "Payment" page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('9.1 Review page validations', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'Yes, print certificate' }) + ).toBeVisible() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.10-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.10-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..8ff579b4 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.10-validate-certify-record-page.spec.ts @@ -0,0 +1,71 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('10.0 Validate "Review" page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('10.1 Review page validations', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Brother)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/birth/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'Yes, print certificate' }) + ).toBeVisible() + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await expect(page.locator('#confirm-print-modal')).toBeVisible() + await expect(page.locator('#confirm-print-modal')).toContainText( + 'Print and issue certificate?' + ) + await expect(page.locator('#confirm-print-modal')).toContainText( + 'A PDF of the certificate will open in a new tab for you to print and issue' + ) + }) + + test('10.2 On click cancel button, modal will be closed', async () => { + await page.getByRole('button', { name: 'Cancel' }).click() + await expect(page.locator('#confirm-print-modal')).toBeHidden() + }) + + test('10.3 On click print button, user will navigate to a new tab from where user can download PDF', async () => { + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await page.getByRole('button', { name: 'Print', exact: true }).click() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.11-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.11-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..961dac5a --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.11-validate-certify-record-page.spec.ts @@ -0,0 +1,69 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('11.0 Validate "Review" page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('11.1 Review page validations', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'Yes, print certificate' }) + ).toBeVisible() + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await expect(page.locator('#confirm-print-modal')).toBeVisible() + await expect(page.locator('#confirm-print-modal')).toContainText( + 'Print certificate?' + ) + await expect(page.locator('#confirm-print-modal')).toContainText( + 'A PDF of the certificate will open in a new tab for you to print. This record will then be moved to your ready to issue work-queue' + ) + }) + + test('11.2 On click cancel button, modal will be closed', async () => { + await page.getByRole('button', { name: 'Cancel' }).click() + await expect(page.locator('#confirm-print-modal')).toBeHidden() + }) + + test('11.3 On click print button, user will navigate to a new tab from where user can download PDF', async () => { + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await page.getByRole('button', { name: 'Print', exact: true }).click() + await expect(page.locator('#confirm-print-modal')).toBeHidden() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.12-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.12-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..ffb6e471 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.12-validate-certify-record-page.spec.ts @@ -0,0 +1,64 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('12.0 Validate "Review" page', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('12.1 Review page click make correction', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + + await expect( + page.url().includes(`/review/${declaration.id}/birth`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + }) + + test('12.2 Navigated to correction requester page', async () => { + await page.getByRole('button', { name: 'No, make correction' }).click() + await expect( + page.url().includes(`/correction/${declaration.id}/corrector`) + ).toBeTruthy() + }) + + test('12.3 Validate correction requester page', async () => { + await page.getByText('Mother', { exact: true }).click() + await page.getByRole('button', { name: 'Continue' }).click() + await expect(page.getByText('Verify their identity')).toBeVisible() + await expect(page.getByRole('button', { name: 'Verified' })).toBeVisible() + await expect( + page.getByRole('button', { name: 'Identity does not match' }) + ).toBeVisible() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/36.13-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.13-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..51508861 --- /dev/null +++ b/e2e/testcases/print-certificate/birth/36.13-validate-certify-record-page.spec.ts @@ -0,0 +1,51 @@ +import { expect, test, type Page } from '@playwright/test' +import { BirthDeclaration } from '../../birth/types' +import { getDeclarationForPrintCertificate } from './certificate-helper' + +test.describe + .serial('13.0 Validate the history section of record audit after printing', () => { + let declaration: BirthDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('13.1 Go to printed declaration details page by Print in advance', async () => { + const response = await getDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Birth Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await page.locator('#print-certificate').click() + + await page + .getByPlaceholder('Search for a tracking ID') + .fill(declaration.registration.trackingId) + await page.getByPlaceholder('Search for a tracking ID').press('Enter') + await page.locator('#ListItemAction-0-icon').click() + + const assignRecordModal = await page.locator('#assign').isVisible() + if (assignRecordModal) { + await page.locator('#assign').click() + } + await page.locator('#name_0').click() + await expect(page.getByRole('button', { name: 'Certified' })).toBeVisible() + + await page.getByRole('button', { name: 'Certified' }).click() + await expect( + page.getByText('Birth Certificate Certified Copy') + ).toBeVisible() + }) +}) diff --git a/e2e/testcases/print-certificate/birth/528KB-random.png b/e2e/testcases/print-certificate/birth/528KB-random.png new file mode 100644 index 00000000..02bd6901 Binary files /dev/null and b/e2e/testcases/print-certificate/birth/528KB-random.png differ diff --git a/e2e/testcases/print-certificate/birth/certificate-helper.ts b/e2e/testcases/print-certificate/birth/certificate-helper.ts new file mode 100644 index 00000000..f0ea704b --- /dev/null +++ b/e2e/testcases/print-certificate/birth/certificate-helper.ts @@ -0,0 +1,81 @@ +import { faker } from '@faker-js/faker' +import { expect, type Page } from '@playwright/test' +import { CREDENTIALS } from '../../../constants' +import { getToken, login, createPIN, getAction } from '../../../helpers' +import { + ConvertEnumsToStrings, + createDeclaration, + fetchDeclaration +} from '../../birth/helpers' +import { BirthInputDetails, BirthDeclaration } from '../../birth/types' + +export async function getDeclarationForPrintCertificate( + page: Page, + options?: Record +): Promise<{ + declaration: BirthDeclaration + trackingId: string +}> { + const token = await getToken( + CREDENTIALS.LOCAL_REGISTRAR.USERNAME, + CREDENTIALS.LOCAL_REGISTRAR.PASSWORD + ) + const declarationInput = { + child: { + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), + gender: 'male', + ...(options && { birthDate: options.child.birthDate }) + }, + informant: { + type: 'BROTHER' + }, + attendant: { + type: 'PHYSICIAN' + }, + mother: { + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() + }, + father: { + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() + } + } as ConvertEnumsToStrings + + const res = await createDeclaration(token, declarationInput) + expect(res).toStrictEqual({ + trackingId: expect.any(String), + compositionId: expect.any(String), + isPotentiallyDuplicate: false, + __typename: 'CreatedIds' + }) + + const trackingId = res.trackingId + const declaration = (await fetchDeclaration(token, res.compositionId)).data + .fetchBirthRegistration as BirthDeclaration + + if (!options?.isLoggedIn) { + await login( + page, + CREDENTIALS.LOCAL_REGISTRAR.USERNAME, + CREDENTIALS.LOCAL_REGISTRAR.PASSWORD + ) + await createPIN(page) + } + + await page.getByPlaceholder('Search for a tracking ID').fill(trackingId) + await page.getByPlaceholder('Search for a tracking ID').press('Enter') + await page.locator('#ListItemAction-0-icon').click() + + const assignRecordModal = await page.locator('#assign').isVisible() + if (assignRecordModal) { + await page.locator('#assign').click() + } + + await page.locator('#name_0').click() + await page.getByRole('button', { name: 'Action' }).first().click() + await getAction(page, 'Print certified copy').click() + + return { declaration, trackingId } +} diff --git a/e2e/testcases/print-certificate/death/36.01-02-validation-of-printing-certificate.spec.ts b/e2e/testcases/print-certificate/death/36.01-02-validation-of-printing-certificate.spec.ts new file mode 100644 index 00000000..05c295ae --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.01-02-validation-of-printing-certificate.spec.ts @@ -0,0 +1,67 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('Certified copies', () => { + let declaration: DeathDeclaration + let trackingId = '' + + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('1.0 Click on "Print certified copy" from action menu', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + trackingId = response.trackingId + + await expect( + page + .url() + .includes(`/cert/collector/${declaration.id}/death/certCollector`) + ).toBeTruthy() + }) + + test.describe('2.0 Validate "Certify record" page', async () => { + test('2.1 Click continue without selecting collector type and template type', async () => { + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.getByText('Please select certificate type') + ).toBeVisible() + await expect( + page.getByText('Please select who is collecting the certificate') + ).toBeVisible() + }) + + test('2.2 Click continue without selecting collector type', async () => { + await page.reload({ waitUntil: 'networkidle' }) + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.getByText('Please select certificate type') + ).toBeVisible() + }) + + test('2.3 Click continue without selecting template type', async () => { + await page.reload({ waitUntil: 'networkidle' }) + + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() + + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.getByText('Please select who is collecting the certificate') + ).toBeVisible() + }) + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.03-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.03-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..0c64e676 --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.03-validate-certify-record-page.spec.ts @@ -0,0 +1,100 @@ +import { expect, test, type Page } from '@playwright/test' +import { format, parseISO } from 'date-fns' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('3.0 Validate "Certify record" page', () => { + let declaration: DeathDeclaration + let trackingId = '' + + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('3.1 should navigate to Verify their identity page', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + trackingId = response.trackingId + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + }) + + test('3.2 should see informant Id, names, nationality and dob', async () => { + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Verify their identity' + ) + + await expect( + page.locator(`text="${declaration.informant.name[0].firstNames}"`) + ).toBeVisible() + + await expect( + page.locator(`text="${declaration.informant.name[0].familyName}"`) + ).toBeVisible() + + await expect( + page.locator( + `text="${format( + parseISO(declaration.informant.birthDate), + 'dd MMMM yyyy' + )}"` + ) + ).toBeVisible() + + await expect(page.getByRole('button', { name: 'Verified' })).toBeVisible() + await expect( + page.getByRole('button', { name: 'Identity does not match' }) + ).toBeVisible() + }) + + test('3.3 should navigate to collect payment page on "Verified" button click', async () => { + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/death`) + ).toBeTruthy() + await page.goBack() + }) + + test('3.4 should open warning modal on "Identity does not match" button click', async () => { + await page.getByRole('button', { name: 'Identity does not match' }).click() + await expect(page.locator('#withoutVerificationPrompt')).toContainText( + 'Print without proof of ID?', + { useInnerText: true } + ) + }) + + test('3.5 click warning modal confirm button should take to payment page', async () => { + await page.getByRole('button', { name: 'Confirm' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/death`) + ).toBeTruthy() + await page.goBack() + }) + + test('3.6 click warning modal cancel button should close the modal', async () => { + await page.getByRole('button', { name: 'Identity does not match' }).click() + await page.getByRole('button', { name: 'Cancel' }).click() + console.log(page.locator('#withoutVerificationPrompt')) + await expect(page.locator('#withoutVerificationPrompt')).toBeHidden() + await page.goBack() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.04-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.04-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..d5e1ab3e --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.04-validate-certify-record-page.spec.ts @@ -0,0 +1,35 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('4.0 Validate "Certify record" page', () => { + let declaration: DeathDeclaration + let trackingId = '' + + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('4.1 continue with print in advance redirect to review page', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + trackingId = response.trackingId + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + + await page.getByText('Death Certificate', { exact: true }).click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..3c9c650c --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts @@ -0,0 +1,115 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('7.0 Validate collect payment page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('5.1 check collect payment page header', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page.getByText('Death Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to someone else').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page + .url() + .includes(`/collector/${declaration.id}/death/otherCertCollector`) + ).toBeTruthy() + }) + + test('5.2 should be able to select "No ID available" and no other ID field will be visible', async () => { + await page.locator('#iDType-form-input').click() + await page.getByText('No ID available').click() + await expect(page.locator('#iD-form-input')).toBeHidden() + }) + + test('5.2 should be able to select any type of id and correspondent id input will be visible', async () => { + await page.locator('#iDType-form-input').click() + await page.getByText('Passport', { exact: true }).click() + await expect(page.locator('#iD-form-input')).toBeVisible() + await expect(page.locator('#iD_label')).toContainText('Passport') + + await page.locator('#iDType-form-input').click() + await page.getByText('Other', { exact: true }).click() + await expect(page.locator('#iD-form-input')).toBeVisible() + await expect(page.locator('#iDTypeOther-form-input')).toBeVisible() + await expect(page.locator('#iDTypeOther_label')).toContainText( + 'Other type of ID' + ) + }) + + test('5.2 should be able to select National ID and correspondent id input will be visible with validation rules', async () => { + await page.locator('#iDType-form-input').click() + await page.getByText('National ID', { exact: true }).click() + await page.fill('#iD', '1234567') + + await expect(page.locator('#iD')).toHaveValue('1234567') + await page.locator('#lastName').click() + await expect(page.locator('#iD_error')).toContainText( + 'The National ID can only be numeric and must be 10 digits long' + ) + await page.fill('#iD', '1235678922') + await expect(page.locator('#iD_error')).toBeHidden() + }) + + test('5.3 should be able to enter first name', async () => { + await page.fill('#firstName', 'Muhammed Tareq') + await expect(page.locator('#firstName')).toHaveValue('Muhammed Tareq') + }) + + test('5.4 should be able to enter lastname name', async () => { + await page.fill('#lastName', 'Aziz') + await expect(page.locator('#lastName')).toHaveValue('Aziz') + }) + + test('5.5 keep relationship null and continue', async () => { + await page.getByRole('button', { name: 'Continue' }).click() + await expect(page.locator('#form_error')).toContainText( + 'Complete all the mandatory fields' + ) + }) + + test('5.6 should be able to enter relationship', async () => { + await page.fill('#relationship', 'Uncle') + await expect(page.locator('#relationship')).toHaveValue('Uncle') + }) + + test("5.7 Fill all mandatory field and click 'Continue' should navigate to affidavit page", async () => { + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/cert/collector/${declaration.id}/death/affidavit`) + ).toBeTruthy() + }) + + test.describe('6.0 Validate "Upload signed affidavit" page:', async () => { + test('6.1 Click continue without adding any file or clicking the checkbox should show error', async () => { + await page.getByRole('button', { name: 'Continue' }).click() + }) + + test('6.2 Should be able to add file and navigate to the "Ready to certify?" page.', async () => { + const path = require('path') + const attachmentPath = path.resolve(__dirname, './528KB-random.png') + const inputFile = await page.locator( + 'input[name="affidavitFile"][type="file"]' + ) + await inputFile.setInputFiles(attachmentPath) + await expect( + page.getByRole('button', { name: 'Signed affidavit' }) + ).toBeVisible() + }) + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.07-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.07-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..4504a30a --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.07-validate-certify-record-page.spec.ts @@ -0,0 +1,78 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' +import { format } from 'date-fns' +import { CLIENT_URL } from '../../../constants' + +test.describe.serial('7.0 Validate "Certify record" page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('7.1 continue with "Print and issue to informant (Spouse)" redirect to Collector details page', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page.getByText('Death Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/death`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText('Collect payment') + await expect(page.locator('#service')).toContainText( + 'Death registration before 45 days of date of death' + ) + await expect(page.locator('#amountDue')).toContainText('$3.00') + await expect(page.locator('#Continue')).toBeVisible() + }) + + test('7.2 should navigate to ready to certify page on continue button click', async () => { + await page.locator('#Continue').click() + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + }) + + test('7.3 should skip payment page if payment is 0', async () => { + await page.goto(`${CLIENT_URL}/registration-home/print/1`) + const response = await getDeathDeclarationForPrintCertificate(page, { + event: { date: format(new Date(), 'yyyy-MM-dd') }, + isLoggedIn: true + }) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.08-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.08-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..1dc1e493 --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.08-validate-certify-record-page.spec.ts @@ -0,0 +1,65 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' +import { format } from 'date-fns' +import { CLIENT_URL } from '../../../constants' + +test.describe.serial('8.0 Validate "Payment" page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('7.1 Payment page should correct payment fee based on selected template', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page.getByText('Death Certificate', { exact: true }).click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/print/payment/${declaration.id}/death`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText('Collect payment') + await expect(page.locator('#service')).toContainText( + 'Death registration before 45 days of date of death' + ) + await expect(page.locator('#amountDue')).toContainText('$3.00') + await expect(page.locator('#Continue')).toBeVisible() + + await page.goBack() + await page.goBack() + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.09-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.09-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..6b715867 --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.09-validate-certify-record-page.spec.ts @@ -0,0 +1,53 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('9.0 Validate "Payment" page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('9.1 Review page validations', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'Yes, print certificate' }) + ).toBeVisible() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.10-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.10-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..2ceb9e74 --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.10-validate-certify-record-page.spec.ts @@ -0,0 +1,71 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('10.0 Validate "Review" page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('10.1 Review page validations', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print and issue to informant (Spouse)').check() + await page.getByRole('button', { name: 'Continue' }).click() + await expect( + page.url().includes(`/print/check/${declaration.id}/death/informant`) + ).toBeTruthy() + + await page.getByRole('button', { name: 'Verified' }).click() + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'Yes, print certificate' }) + ).toBeVisible() + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await expect(page.locator('#confirm-print-modal')).toBeVisible() + await expect(page.locator('#confirm-print-modal')).toContainText( + 'Print and issue certificate?' + ) + await expect(page.locator('#confirm-print-modal')).toContainText( + 'A PDF of the certificate will open in a new tab for you to print and issue' + ) + }) + + test('10.2 On click cancel button, modal will be closed', async () => { + await page.getByRole('button', { name: 'Cancel' }).click() + await expect(page.locator('#confirm-print-modal')).toBeHidden() + }) + + test('10.3 On click print button, user will navigate to a new tab from where user can download PDF', async () => { + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await page.getByRole('button', { name: 'Print', exact: true }).click() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.11-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.11-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..16854748 --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.11-validate-certify-record-page.spec.ts @@ -0,0 +1,69 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('11.0 Validate "Review" page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('11.1 Review page validations', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + await expect( + page.getByRole('button', { name: 'Yes, print certificate' }) + ).toBeVisible() + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await expect(page.locator('#confirm-print-modal')).toBeVisible() + await expect(page.locator('#confirm-print-modal')).toContainText( + 'Print certificate?' + ) + await expect(page.locator('#confirm-print-modal')).toContainText( + 'A PDF of the certificate will open in a new tab for you to print. This record will then be moved to your ready to issue work-queue' + ) + }) + + test('11.2 On click cancel button, modal will be closed', async () => { + await page.getByRole('button', { name: 'Cancel' }).click() + await expect(page.locator('#confirm-print-modal')).toBeHidden() + }) + + test('11.3 On click print button, user will navigate to a new tab from where user can download PDF', async () => { + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await page.getByRole('button', { name: 'Print', exact: true }).click() + await expect(page.locator('#confirm-print-modal')).toBeHidden() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.12-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.12-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..24e15bf2 --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.12-validate-certify-record-page.spec.ts @@ -0,0 +1,64 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe.serial('12.0 Validate "Review" page', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('12.1 Review page click make correction', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + + await expect( + page.url().includes(`/review/${declaration.id}/death`) + ).toBeTruthy() + + await expect(page.locator('#content-name')).toContainText( + 'Ready to certify?' + ) + await expect( + page.getByText( + 'Please confirm that the informant has reviewed that the information on the certificate is correct and that it is ready to print.' + ) + ).toBeVisible() + + await expect( + page.getByRole('button', { name: 'No, make correction' }) + ).toBeVisible() + }) + + test('12.2 Navigated to correction requester page', async () => { + await page.getByRole('button', { name: 'No, make correction' }).click() + await expect( + page.url().includes(`/correction/${declaration.id}/corrector`) + ).toBeTruthy() + }) + + test('12.3 Validate correction requester page', async () => { + await page.getByText('Informant (Spouse)', { exact: true }).click() + await page.getByRole('button', { name: 'Continue' }).click() + await expect(page.getByText('Verify their identity')).toBeVisible() + await expect(page.getByRole('button', { name: 'Verified' })).toBeVisible() + await expect( + page.getByRole('button', { name: 'Identity does not match' }) + ).toBeVisible() + }) +}) diff --git a/e2e/testcases/print-certificate/death/36.13-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.13-validate-certify-record-page.spec.ts new file mode 100644 index 00000000..9964ddde --- /dev/null +++ b/e2e/testcases/print-certificate/death/36.13-validate-certify-record-page.spec.ts @@ -0,0 +1,51 @@ +import { expect, test, type Page } from '@playwright/test' +import { DeathDeclaration } from '../../death/types' +import { getDeathDeclarationForPrintCertificate } from './certificate-helper' + +test.describe + .serial('13.0 Validate the history section of record audit after printing', () => { + let declaration: DeathDeclaration + let page: Page + + test.beforeAll(async ({ browser }) => { + page = await browser.newPage() + }) + + test.afterAll(async () => { + await page.close() + }) + + test('13.1 Go to printed declaration details page by Print in advance', async () => { + const response = await getDeathDeclarationForPrintCertificate(page) + declaration = response.declaration + await page + .locator('#certificateTemplateId-form-input > span') + .first() + .click() + await page + .getByText('Death Certificate Certified Copy', { exact: true }) + .click() + await page.getByLabel('Print in advance').check() + await page.getByRole('button', { name: 'Continue' }).click() + await page.getByRole('button', { name: 'Yes, print certificate' }).click() + await page.locator('#print-certificate').click() + + await page + .getByPlaceholder('Search for a tracking ID') + .fill(declaration.registration.trackingId) + await page.getByPlaceholder('Search for a tracking ID').press('Enter') + await page.locator('#ListItemAction-0-icon').click() + + const assignRecordModal = await page.locator('#assign').isVisible() + if (assignRecordModal) { + await page.locator('#assign').click() + } + await page.locator('#name_0').click() + await expect(page.getByRole('button', { name: 'Certified' })).toBeVisible() + + await page.getByRole('button', { name: 'Certified' }).click() + await expect( + page.getByText('Death Certificate Certified Copy') + ).toBeVisible() + }) +}) diff --git a/e2e/testcases/print-certificate/death/528KB-random.png b/e2e/testcases/print-certificate/death/528KB-random.png new file mode 100644 index 00000000..02bd6901 Binary files /dev/null and b/e2e/testcases/print-certificate/death/528KB-random.png differ diff --git a/e2e/testcases/print-certificate/death/certificate-helper.ts b/e2e/testcases/print-certificate/death/certificate-helper.ts new file mode 100644 index 00000000..abf800a0 --- /dev/null +++ b/e2e/testcases/print-certificate/death/certificate-helper.ts @@ -0,0 +1,62 @@ +import { faker } from '@faker-js/faker' +import { expect, type Page } from '@playwright/test' +import { CREDENTIALS } from '../../../constants' +import { getToken, login, createPIN, getAction } from '../../../helpers' +import { DeathDeclaration } from '../../death/types' +import { + createDeathDeclaration, + DeathDeclarationInput, + fetchDeclaration +} from '../../death/helpers' + +export async function getDeathDeclarationForPrintCertificate( + page: Page, + options?: Record +): Promise<{ + declaration: DeathDeclaration + trackingId: string +}> { + const token = await getToken( + CREDENTIALS.LOCAL_REGISTRAR.USERNAME, + CREDENTIALS.LOCAL_REGISTRAR.PASSWORD + ) + + const res = await createDeathDeclaration( + token, + options as DeathDeclarationInput + ) + expect(res).toStrictEqual({ + trackingId: expect.any(String), + compositionId: expect.any(String), + isPotentiallyDuplicate: false, + __typename: 'CreatedIds' + }) + + const trackingId = res.trackingId + const declaration = (await fetchDeclaration(token, res.compositionId)).data + .fetchDeathRegistration as DeathDeclaration + + if (!options?.isLoggedIn) { + await login( + page, + CREDENTIALS.LOCAL_REGISTRAR.USERNAME, + CREDENTIALS.LOCAL_REGISTRAR.PASSWORD + ) + await createPIN(page) + } + + await page.getByPlaceholder('Search for a tracking ID').fill(trackingId) + await page.getByPlaceholder('Search for a tracking ID').press('Enter') + await page.locator('#ListItemAction-0-icon').click() + + const assignRecordModal = await page.locator('#assign').isVisible() + if (assignRecordModal) { + await page.locator('#assign').click() + } + + await page.locator('#name_0').click() + await page.getByRole('button', { name: 'Action' }).first().click() + await getAction(page, 'Print certified copy').click() + + return { declaration, trackingId } +} diff --git a/package.json b/package.json index 2b8b0d1e..1ab8b822 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "scripts": { "dev": "yarn start", "e2e": "NODE_OPTIONS=--dns-result-order=ipv4first yarn playwright test --ui", + "e2e-dev": "NODE_ENV=development NODE_OPTIONS=--dns-result-order=ipv4first yarn playwright test --ui", "e2e:generate-types": "graphql-codegen --config e2e/codegen.yml && yarn prettier --write e2e/gateway.ts", "precommit": "lint-staged", "test": "vitest 'src/**/*.test.ts' --passWithNoTests", diff --git a/src/api/certificates/handler.ts b/src/api/certificates/handler.ts index 4a5f0b2e..a54b4b61 100644 --- a/src/api/certificates/handler.ts +++ b/src/api/certificates/handler.ts @@ -76,7 +76,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) { }, isDefault: false, fee: { - onTime: 8, + onTime: 0, late: 11.5, delayed: 17 }, @@ -125,7 +125,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) { }, isDefault: false, fee: { - onTime: 6, + onTime: 0, late: 9, delayed: 14.5 },