Skip to content

Commit 9a5dd74

Browse files
arun-hmctsjors95-mojrenovate[bot]lovelin-07madhavi1203
authored andcommitted
Hdpi 2036 statement of truth screen english journey (#918)
Co-authored-by: jors95-moj <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lovelin <[email protected]> Co-authored-by: madhavi1203 <[email protected]> Co-authored-by: Praveen Adusumilli <[email protected]> Co-authored-by: MoLala1 <[email protected]>
1 parent 29d3e29 commit 9a5dd74

25 files changed

+426
-42
lines changed
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
export const statementOfTruth = {
2-
title: 'Create a case - HM Courts & Tribunals Service - GOV.UK',
3-
mainHeader: 'Statement of truth',
4-
continue: 'Continue'
2+
title: `Create a case - HM Courts & Tribunals Service - GOV.UK`,
3+
mainHeader: `Statement of truth`,
4+
caseNumberParagraph: `Case number:`,
5+
cancelLink: `Cancel`,
6+
previousLink: `Previous`,
7+
continueButton: `Continue`,
8+
completedByLabel: `Completed by`,
9+
claimantRadioOption: `Claimant`,
10+
claimantLegalRepresentativeRadioOption: `Claimant’s legal representative (as defined by CPR 2.3 (1))`,
11+
signThisStatementHiddenCheckbox: `The claimant believes that the facts stated in this claim form are true. I am authorised by the claimant to sign this statement.`,
12+
fullNameHiddenTextLabel: `Full name`,
13+
nameOfFirmHiddenTextLabel: `Name of firm`,
14+
positionOrOfficeHeldHiddenTextLabel: `Position or office held`,
15+
fullNameHiddenTextInput: `John Doe`,
16+
nameOfFirmHiddenTextInput: `Doe & Co Solicitors`,
17+
positionOrOfficeHeldHiddenTextInput: `Solicitor`,
18+
iBelieveTheFactsHiddenCheckbox: `I believe that the facts stated in this claim form are true.`,
19+
iUnderstandThatProceedingsParagraph: `I understand that proceedings for contempt of court may be brought against anyone who makes, or causes to be made, a false statement in a document verified by a statement of truth without an honest belief in its truth.`,
20+
cymraegToggleLink: `Cymraeg`,
521
}

src/e2eTest/test-README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Playwright 1.30+ | TypeScript 4.9+
135135
| selectUnderlesseeOrMortgageeDetails | `performAction('selectUnderlesseeOrMortgageeDetails', { nameOption: 'Yes', addressOption: 'Yes', anotherUnderlesseeOrMortgageeOption: 'Yes'})` |
136136
| addDefendantDetails | `performAction('addDefendantDetails', { nameOption: defendantDetails.no, correspondenceAddressOption: defendantDetails.no, addAdditionalDefendantsOption: defendantDetails.no})` |
137137
| selectProhibitedConductStandardContract | `performAction('selectProhibitedConductStandardContract', prohibitedConductStandardContractWales.yes)` |
138-
| addDefendantDetails | `performAction('addDefendantDetails', { nameOption: defendantDetails.no, correspondenceAddressOption: defendantDetails.no, addAdditionalDefendantsOption: defendantDetails.no})` |
138+
| selectStatementOfTruth | `performAction('selectStatementOfTruth', {completedBy: statementOfTruth.completedByLabel, option :statementOfTruth.claimantRadioOption})` |
139139
| submitAddressCheckYourAnswers | `submitAddressCheckYourAnswers')` |
140140
### Validations
141141
| Validation | Example Usage |

src/e2eTest/tests/createCase.saveResume.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,12 @@ test.describe('[Create Case - With resume claim options]', async () => {
191191
option: languageUsed.english
192192
});
193193
await performAction('completingYourClaim', completeYourClaim.submitAndClaimNow);
194-
await performAction('clickButton', statementOfTruth.continue);
194+
await performAction('selectStatementOfTruth', {
195+
completedBy: statementOfTruth.claimantRadioOption,
196+
iBelieveCheckbox: statementOfTruth.iBelieveTheFactsHiddenCheckbox,
197+
fullNameTextInput: statementOfTruth.fullNameHiddenTextInput,
198+
positionOrOfficeTextInput: statementOfTruth.positionOrOfficeHeldHiddenTextInput
199+
});
195200
await performAction('clickButton', checkYourAnswers.saveAndContinue);
196201
await performValidation('bannerAlert', 'Case #.* has been updated with event: Make a claim');
197202
await performValidations(
@@ -308,8 +313,7 @@ test.describe('[Create Case - With resume claim options]', async () => {
308313
question: languageUsed.whichLanguageUsedQuestion,
309314
option: languageUsed.english
310315
});
311-
await performAction('completingYourClaim', completeYourClaim.submitAndClaimNow);
312-
await performAction('clickButton', statementOfTruth.continue);
316+
await performAction('completingYourClaim', completeYourClaim.saveItForLater);
313317
await performAction('clickButton', checkYourAnswers.saveAndContinue);
314318
await performValidation('bannerAlert', 'Case #.* has been updated with event: Make a claim');
315319
await performValidations(

src/e2eTest/tests/createCase.spec.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@ test.describe('[Create Case - England] @regression', async () => {
192192
await performAction('selectApplications', applications.yes);
193193
await performAction('selectLanguageUsed', {question: languageUsed.whichLanguageUsedQuestion, option: languageUsed.english});
194194
await performAction('completingYourClaim', completeYourClaim.submitAndClaimNow);
195-
await performAction('clickButton', statementOfTruth.continue);
195+
await performAction('selectStatementOfTruth', {
196+
completedBy: statementOfTruth.claimantRadioOption,
197+
iBelieveCheckbox: statementOfTruth.iBelieveTheFactsHiddenCheckbox,
198+
fullNameTextInput: statementOfTruth.fullNameHiddenTextInput,
199+
positionOrOfficeTextInput: statementOfTruth.positionOrOfficeHeldHiddenTextInput
200+
});
196201
await performAction('clickButton', checkYourAnswers.saveAndContinue);
197202
await performValidation('bannerAlert', 'Case #.* has been updated with event: Make a claim');
198203
await performValidations(
@@ -317,7 +322,13 @@ test.describe('[Create Case - England] @regression', async () => {
317322
await performAction('selectApplications', applications.yes);
318323
await performAction('selectLanguageUsed', {question: languageUsed.whichLanguageUsedQuestion, option: languageUsed.english});
319324
await performAction('completingYourClaim', completeYourClaim.submitAndClaimNow);
320-
await performAction('clickButton', statementOfTruth.continue);
325+
await performAction('selectStatementOfTruth', {
326+
completedBy: statementOfTruth.claimantLegalRepresentativeRadioOption,
327+
signThisStatementCheckbox: statementOfTruth.signThisStatementHiddenCheckbox,
328+
fullNameTextInput: statementOfTruth.fullNameHiddenTextInput,
329+
nameOfFirmTextInput: statementOfTruth.nameOfFirmHiddenTextInput,
330+
positionOrOfficeTextInput: statementOfTruth.positionOrOfficeHeldHiddenTextInput
331+
});
321332
await performAction('clickButton', checkYourAnswers.saveAndContinue);
322333
await performValidation('bannerAlert', 'Case #.* has been updated with event: Make a claim');
323334
await performValidations(

src/e2eTest/utils/actions/custom-actions/createCase.action.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {performAction, performActions, performValidation} from '@utils/controlle
66
import {createCase, addressDetails, housingPossessionClaim, defendantDetails, claimantName, contactPreferences, mediationAndSettlement, tenancyLicenceDetails, resumeClaimOptions, rentDetails, accessTokenApiData, caseApiData, dailyRentAmount, reasonsForPossession, detailsOfRentArrears,
77
claimantType, claimType, groundsForPossession, preActionProtocol, noticeOfYourIntention, borderPostcode, rentArrearsPossessionGrounds, rentArrearsOrBreachOfTenancy, noticeDetails, moneyJudgment, whatAreYourGroundsForPossession, languageUsed, defendantCircumstances, applications, claimantCircumstances,
88
claimingCosts, alternativesToPossession, reasonsForRequestingADemotionOrder, statementOfExpressTerms, reasonsForRequestingASuspensionOrder, uploadAdditionalDocs, additionalReasonsForPossession, completeYourClaim, home, search, userIneligible,
9-
whatAreYourGroundsForPossessionWales, underlesseeOrMortgageeDetails, reasonsForRequestingASuspensionAndDemotionOrder, provideMoreDetailsOfClaim, addressCheckYourAnswers} from "@data/page-data";
9+
whatAreYourGroundsForPossessionWales, underlesseeOrMortgageeDetails, reasonsForRequestingASuspensionAndDemotionOrder, provideMoreDetailsOfClaim, addressCheckYourAnswers, statementOfTruth} from "@data/page-data";
1010

1111
export let caseInfo: { id: string; fid: string; state: string };
1212
export let caseNumber: string;
@@ -63,7 +63,8 @@ export class CreateCaseAction implements IAction {
6363
['selectUnderlesseeOrMortgageeEntitledToClaim', () => this.selectUnderlesseeOrMortgageeEntitledToClaim(fieldName as actionRecord)],
6464
['selectUnderlesseeOrMortgageeDetails', () => this.selectUnderlesseeOrMortgageeDetails(fieldName as actionRecord)],
6565
['wantToUploadDocuments', () => this.wantToUploadDocuments(fieldName as actionRecord)],
66-
['uploadAdditionalDocs', () => this.uploadAdditionalDocs(fieldName as actionRecord)]
66+
['uploadAdditionalDocs', () => this.uploadAdditionalDocs(fieldName as actionRecord)],
67+
['selectStatementOfTruth', () => this.selectStatementOfTruth(fieldName as actionRecord)]
6768
]);
6869
const actionToPerform = actionsMap.get(action);
6970
if (!actionToPerform) throw new Error(`No action found for '${action}'`);
@@ -758,6 +759,30 @@ export class CreateCaseAction implements IAction {
758759
}
759760

760761

762+
private async selectStatementOfTruth(claimantDetails: actionRecord) {
763+
await performValidation('text', {elementType: 'paragraph', text: 'Case number: '+caseNumber});
764+
await performValidation('text', {
765+
elementType: 'paragraph',
766+
text: `Property address: ${addressInfo.buildingStreet}, ${addressInfo.townCity}, ${addressInfo.engOrWalPostcode}`
767+
});
768+
await performAction('clickRadioButton', {
769+
question: statementOfTruth.completedByLabel,
770+
option: claimantDetails.completedBy
771+
});
772+
if(claimantDetails.completedBy == statementOfTruth.claimantRadioOption){
773+
await performAction('check', claimantDetails.iBelieveCheckbox);
774+
await performAction('inputText', statementOfTruth.fullNameHiddenTextLabel, claimantDetails.fullNameTextInput);
775+
await performAction('inputText', statementOfTruth.positionOrOfficeHeldHiddenTextLabel, claimantDetails.positionOrOfficeTextInput);
776+
}
777+
if(claimantDetails.completedBy == statementOfTruth.claimantLegalRepresentativeRadioOption){
778+
await performAction('check', claimantDetails.signThisStatementCheckbox);
779+
await performAction('inputText', statementOfTruth.fullNameHiddenTextLabel, claimantDetails.fullNameTextInput);
780+
await performAction('inputText', statementOfTruth.nameOfFirmHiddenTextLabel, claimantDetails.nameOfFirmTextInput);
781+
await performAction('inputText', statementOfTruth.positionOrOfficeHeldHiddenTextLabel, claimantDetails.positionOrOfficeTextInput);
782+
}
783+
await performAction('clickButton', statementOfTruth.continueButton);
784+
}
785+
761786
private async reloginAndFindTheCase(userInfo: actionData) {
762787
await performAction('navigateToUrl', process.env.MANAGE_CASE_BASE_URL);
763788
await performAction('login', userInfo);

src/e2eTest/utils/actions/custom-actions/custom-actions-enforcement/makeClaim.action.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ export class MakeClaimAction implements IAction {
100100
option: languageUsed.english,
101101
});
102102
await performAction('completingYourClaim', completeYourClaim.submitAndClaimNow);
103-
await performAction('clickButton', statementOfTruth.continue);
103+
await performAction('selectStatementOfTruth', {
104+
completedBy: statementOfTruth.claimantRadioOption,
105+
iBelieveCheckbox: statementOfTruth.iBelieveTheFactsHiddenCheckbox,
106+
fullNameTextInput: statementOfTruth.fullNameHiddenTextInput,
107+
positionOrOfficeTextInput: statementOfTruth.positionOrOfficeHeldHiddenTextInput
108+
});
104109
await performAction('clickButton', checkYourAnswers.saveAndContinue);
105110
await performValidation('bannerAlert', 'Case #.* has been updated with event: Make a claim');
106111
}

src/e2eTest/utils/registry/action.registry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export class ActionRegistry {
8484
['selectProhibitedConductStandardContract', new CreateCaseWalesAction()],
8585
['selectOccupationContractOrLicenceDetails', new CreateCaseWalesAction()],
8686
['provideMoreDetailsOfClaim', new CreateCaseAction()],
87+
['selectStatementOfTruth', new CreateCaseAction()],
8788
['selectAsbQuestions', new CreateCaseWalesAction()]
8889
]);
8990

src/main/java/uk/gov/hmcts/reform/pcs/ccd/domain/PCSCase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ public class PCSCase {
767767
)
768768
private WaysToPay waysToPay;
769769

770+
@CCD
771+
private StatementOfTruthDetails statementOfTruth;
772+
770773
@CCD(searchable = false)
771774
private YesOrNo showPreActionProtocolPageWales;
772775

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package uk.gov.hmcts.reform.pcs.ccd.domain;
2+
3+
import uk.gov.hmcts.ccd.sdk.api.HasLabel;
4+
5+
public enum StatementOfTruthAgreementClaimant implements HasLabel {
6+
7+
BELIEVE_TRUE("I believe that the facts stated in this claim form are true.");
8+
9+
private final String label;
10+
11+
StatementOfTruthAgreementClaimant(String label) {
12+
this.label = label;
13+
}
14+
15+
@Override
16+
public String getLabel() {
17+
return label;
18+
}
19+
20+
}
21+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package uk.gov.hmcts.reform.pcs.ccd.domain;
2+
3+
import uk.gov.hmcts.ccd.sdk.api.HasLabel;
4+
5+
public enum StatementOfTruthAgreementLegalRep implements HasLabel {
6+
7+
AGREED("The claimant believes that the facts stated in this claim form are true. "
8+
+ "I am authorised by the claimant to sign this statement.");
9+
10+
private final String label;
11+
12+
StatementOfTruthAgreementLegalRep(String label) {
13+
this.label = label;
14+
}
15+
16+
@Override
17+
public String getLabel() {
18+
return label;
19+
}
20+
21+
}
22+

0 commit comments

Comments
 (0)