From d082b28c8768a273ac3addfed23e81ccb82c6669 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Thu, 19 Mar 2026 11:34:59 +0000 Subject: [PATCH 01/20] Automation HDPI-3549 NonRentArrearsDispute --- src/test/ui/config/axe-exclusions.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/ui/config/axe-exclusions.config.ts b/src/test/ui/config/axe-exclusions.config.ts index 645125111..142da0c0d 100644 --- a/src/test/ui/config/axe-exclusions.config.ts +++ b/src/test/ui/config/axe-exclusions.config.ts @@ -4,4 +4,5 @@ export const axe_exclusions = [ '#contactByTelephone', //page: contactByTelephone, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button '#nameConfirmation-2', //page: DefendantNameConfirmation, element: 'No', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button '#confirmTenancyDate-2', //page: tenancyStartDateKnown, element: 'No', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button + '#disputeClaim', //page: nonRentArrearsDispute, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button ]; From 48a55ae68e65f4f24d477a0560809a3197a4c187 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Thu, 19 Mar 2026 12:22:41 +0000 Subject: [PATCH 02/20] Automation HDPI-3549 NonRentArrearsDispute --- src/test/ui/config/axe-exclusions.config.ts | 2 +- .../nonRentArrearsDispute.page.data.ts | 38 ++++++- src/test/ui/e2eTest/respondToAClaim.spec.ts | 101 +++--------------- .../functional/nonRentArrearsDispute.pft.ts | 38 +++++++ .../custom-actions/respondToClaim.action.ts | 18 ++++ src/test/ui/utils/registry/action.registry.ts | 1 + 6 files changed, 107 insertions(+), 91 deletions(-) create mode 100644 src/test/ui/functional/nonRentArrearsDispute.pft.ts diff --git a/src/test/ui/config/axe-exclusions.config.ts b/src/test/ui/config/axe-exclusions.config.ts index 142da0c0d..b4b22d00a 100644 --- a/src/test/ui/config/axe-exclusions.config.ts +++ b/src/test/ui/config/axe-exclusions.config.ts @@ -4,5 +4,5 @@ export const axe_exclusions = [ '#contactByTelephone', //page: contactByTelephone, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button '#nameConfirmation-2', //page: DefendantNameConfirmation, element: 'No', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button '#confirmTenancyDate-2', //page: tenancyStartDateKnown, element: 'No', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button - '#disputeClaim', //page: nonRentArrearsDispute, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button + '#disputeOtherParts', //page: nonRentArrearsDispute, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button ]; diff --git a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts index 6866f1ab4..9b2e98395 100644 --- a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts +++ b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts @@ -1,4 +1,38 @@ +import { submitCaseApiData } from '../api-data'; + +function generateRandomString(length: number): string { + const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`; + let result = ``; + + for (let i = 0; i < length; i++) { + const randomIndex = Math.floor(Math.random() * chars.length); + result += chars[randomIndex]; + } + + return result; +} + export const nonRentArrearsDispute = { - mainHeader: `Non-Rent Arrears Dispute(Placeholder)`, - continueButton: `Continue`, + mainHeader: `Disputing other parts of the claim`, + partOfClaimParagraph: `You should view the claim (opens in new tab) to see if there’s any other parts of the claim that are incorrect or you disagree with.`, + viewTheClaimLink: `view the claim (opens in new tab)`, + mainHeaderGovServiceHiddenNewTab: `Welcome to GOV.UK`, + thisIncludesParagraph: `This includes:`, + groundsForPossessionList: `${submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName}’s grounds for possession (their reasons for making the claim)`, + anyDocumentsList: `any documents they’ve uploaded to support their claim`, + anyOtherList: ` any other information they’ve given as part of their claim`, + doYouWantToDisputeQuestion: `Do you want to dispute any other parts of the claim?`, + explainPartOfClaimHiddenTextLabel: `Explain which parts of the claim you do not agree with`, + explainClaimTextInput: `Example - Do not agree with claim 1,2 and 3`, + yesRadioOption: `Yes`, + noRadioOption: `No`, + saveForLaterButton: `Save for later`, + saveAndContinueButton: `Save and continue`, + backLink: `Back`, + detailsCharLimitInputText: generateRandomString(6501), + tooManyCharacterHiddenHintText: `You have 1 character too many`, + youHave6500CharactersHiddenHintText: `You have 6,500 characters remaining`, + thereIsAProblemErrorMessageHeader: `There is a problem`, + selectIfYouWantToDisputeErrorMessage: `Select if you want to dispute any other parts of the claim`, + partsOfClaimDoNotAgreeErrorMessage: `Enter the parts of the claim you do not agree with`, }; diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index ccc9aa60e..fe39f7066 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -132,7 +132,9 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { option: confirmationOfNoticeGiven.yesRadioOption, }); await performAction('enterNoticeDateUnknown'); - await performValidation('mainHeader', nonRentArrearsDispute.mainHeader); + await performAction('disputingOtherPartsOfTheClaim', { + disputeOption: nonRentArrearsDispute.noRadioOption, + }); }); test('Non-RentArrears - NoticeServed - Yes and NoticeDateProvided - Yes - NoticeDetails- Yes - Notice date known @noDefendants @regression', async () => { @@ -169,8 +171,9 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { option: confirmationOfNoticeGiven.yesRadioOption, }); await performAction('enterNoticeDateKnown'); - await performValidation('mainHeader', nonRentArrearsDispute.mainHeader); - await performAction('clickButton', nonRentArrearsDispute.continueButton); + await performAction('disputingOtherPartsOfTheClaim', { + disputeOption: nonRentArrearsDispute.noRadioOption, + }); // placeholder page, so need to be replaced with custom action when actual page is implemented await performValidation('mainHeader', counterClaim.mainHeader); await performAction('clickButton', counterClaim.saveAndContinueButton); @@ -212,8 +215,10 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { await performAction('selectNoticeDetails', { option: confirmationOfNoticeGiven.imNotSureRadioOption, }); - await performValidation('mainHeader', nonRentArrearsDispute.mainHeader); - await performAction('clickButton', nonRentArrearsDispute.continueButton); + await performAction('disputingOtherPartsOfTheClaim', { + disputeOption: nonRentArrearsDispute.yesRadioOption, + disputeInfo: nonRentArrearsDispute.explainClaimTextInput, + }); // placeholder page, so need to be replaced with custom action when actual page is implemented await performValidation('mainHeader', counterClaim.mainHeader); await performAction('clickButton', counterClaim.saveAndContinueButton); @@ -225,48 +230,6 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { await performValidation('mainHeader', repaymentsAgreed.mainHeader); }); - test('Non-RentArrears - NoticeServed - Yes NoticeDetails - No - NonRentArrearsDispute @noDefendants @regression', async () => { - await performAction('selectLegalAdvice', freeLegalAdvice.yesRadioOption); - await performAction('inputDefendantDetails', { - fName: defendantNameCapture.firstNameTextInput, - lName: defendantNameCapture.lastNameTextInput, - }); - await performAction('enterDateOfBirthDetails'); - await performAction('selectCorrespondenceAddressUnKnown', { - addressLine1: correspondenceAddress.walesAddressLine1TextInput, - townOrCity: correspondenceAddress.walesTownOrCityTextInput, - postcode: correspondenceAddress.walesPostcodeTextInput, - }); - await performAction('clickButton', contactPreference.saveAndContinueButton); - await performAction('selectContactByTelephone', { - radioOption: contactPreferencesTelephone.noRadioOption, - }); - await performAction( - 'disputeClaimInterstitial', - submitCaseApiData.submitCasePayloadNoDefendants.isClaimantNameCorrect - ); - await performValidation('mainHeader', tenancyDetails.mainHeader); - await performAction('clickButton', tenancyDetails.saveAndContinueButton); - await performAction('enterTenancyStartDetailsUnKnown', { - tsDay: '15', - tsMonth: '11', - tsYear: '2024', - }); - await performAction('selectNoticeDetails', { - option: confirmationOfNoticeGiven.noRadioOption, - }); - await performValidation('mainHeader', nonRentArrearsDispute.mainHeader); - await performAction('clickButton', nonRentArrearsDispute.continueButton); - // placeholder page, so need to be replaced with custom action when actual page is implemented - await performValidation('mainHeader', counterClaim.mainHeader); - await performAction('clickButton', counterClaim.saveAndContinueButton); - await performAction('readPaymentInterstitial'); - await performAction('repaymentsMade', { - repaymentOption: repaymentsMade.noRadioOption, - }); - await performValidation('mainHeader', repaymentsAgreed.mainHeader); - }); - test('England - NonRentArrears - NoticeServed - No NoticeDateProvided - No - NonRentArrearsDispute @noDefendants @regression', async () => { await performAction('selectLegalAdvice', freeLegalAdvice.yesRadioOption); await performAction('inputDefendantDetails', { @@ -295,8 +258,9 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { await performValidation('mainHeader', tenancyDetails.mainHeader); await performAction('clickButton', tenancyDetails.saveAndContinueButton); await performAction('enterTenancyStartDetailsUnKnown'); - await performValidation('mainHeader', nonRentArrearsDispute.mainHeader); - await performAction('clickButton', nonRentArrearsDispute.continueButton); + await performAction('disputingOtherPartsOfTheClaim', { + disputeOption: nonRentArrearsDispute.noRadioOption, + }); }); test('RentArrears - NoticeServed - Yes and NoticeDateProvided - No - NoticeDetails- Yes - Notice date unknown @regression', async () => { @@ -423,45 +387,6 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { await performValidation('mainHeader', repaymentsAgreed.mainHeader); }); - test('RentArrears - NoticeServed - Yes NoticeDateProvided - No - NoticeDetails - Im not sure - RentArrearsDispute @regression', async () => { - await performAction('selectLegalAdvice', freeLegalAdvice.yesRadioOption); - await performAction('confirmDefendantDetails', { - question: defendantNameConfirmation.mainHeader, - option: defendantNameConfirmation.yesRadioOption, - }); - await performAction('enterDateOfBirthDetails', { - dobDay: dateOfBirth.dayInputText, - dobMonth: dateOfBirth.monthInputText, - dobYear: dateOfBirth.yearInputText, - }); - await performAction('selectCorrespondenceAddressKnown', { - radioOption: correspondenceAddress.yesRadioOption, - }); - await performAction('clickButton', contactPreference.saveAndContinueButton); - await performAction('selectContactByTelephone', { - radioOption: contactPreferencesTelephone.noRadioOption, - }); - await performAction('disputeClaimInterstitial', submitCaseApiData.submitCasePayload.isClaimantNameCorrect); - await performValidation('mainHeader', tenancyDetails.mainHeader); - await performAction('clickButton', tenancyDetails.saveAndContinueButton); - await performAction('selectTenancyStartDateKnown', { - option: tenancyDateDetails.iAmNotSureRadioOption, - }); - await performAction('selectNoticeDetails', { - option: confirmationOfNoticeGiven.imNotSureRadioOption, - }); - await performValidation('mainHeader', rentArrearsDispute.mainHeader); - await performAction('clickButton', rentArrearsDispute.continueButton); - // placeholder page, so need to be replaced with custom action when actual page is implemented - await performValidation('mainHeader', counterClaim.mainHeader); - await performAction('clickButton', counterClaim.saveAndContinueButton); - await performAction('readPaymentInterstitial'); - await performAction('repaymentsMade', { - repaymentOption: repaymentsMade.noRadioOption, - }); - await performValidation('mainHeader', repaymentsAgreed.mainHeader); - }); - test('England - RentArrears - NoticeServed - No NoticeDateProvided - No - RentArrearsDispute @regression', async () => { await performAction('selectLegalAdvice', freeLegalAdvice.yesRadioOption); await performAction('confirmDefendantDetails', { diff --git a/src/test/ui/functional/nonRentArrearsDispute.pft.ts b/src/test/ui/functional/nonRentArrearsDispute.pft.ts new file mode 100644 index 000000000..ac015a7cd --- /dev/null +++ b/src/test/ui/functional/nonRentArrearsDispute.pft.ts @@ -0,0 +1,38 @@ +import { nonRentArrearsDispute } from '../data/page-data'; +import { performAction, performValidation } from '../utils/controller'; + +export async function nonRentArrearsDisputeErrorValidation(): Promise { + //mandatory radio button selection + await performAction('clickButton', nonRentArrearsDispute.saveAndContinueButton); + await performValidation('errorMessage', { + header: nonRentArrearsDispute.thereIsAProblemErrorMessageHeader, + message: nonRentArrearsDispute.selectIfYouWantToDisputeErrorMessage, + }); + await performAction('clickRadioButton', nonRentArrearsDispute.yesRadioOption); + //hidden hint text for input field validation + await performValidation('elementToBeVisible', nonRentArrearsDispute.youHave6500CharactersHiddenHintText); + //mandatory input field validation for 'Yes' radio button selection + await performAction('clickButton', nonRentArrearsDispute.saveAndContinueButton); + await performValidation('errorMessage', { + header: nonRentArrearsDispute.thereIsAProblemErrorMessageHeader, + message: nonRentArrearsDispute.partsOfClaimDoNotAgreeErrorMessage, + }); + //character limit error validation + await performAction( + 'inputText', + nonRentArrearsDispute.explainPartOfClaimHiddenTextLabel, + nonRentArrearsDispute.detailsCharLimitInputText + ); + await performValidation('elementToBeVisible', nonRentArrearsDispute.tooManyCharacterHiddenHintText); + //link opening in new tab validation + await performAction( + 'clickLinkAndVerifyNewTabTitle', + nonRentArrearsDispute.viewTheClaimLink, + nonRentArrearsDispute.mainHeaderGovServiceHiddenNewTab + ); + await performAction( + 'inputText', + nonRentArrearsDispute.explainPartOfClaimHiddenTextLabel, + nonRentArrearsDispute.explainClaimTextInput + ); +} diff --git a/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts b/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts index 9bcc6f5ef..8d7477e62 100644 --- a/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts +++ b/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts @@ -12,6 +12,7 @@ import { disputeClaimInterstitial, freeLegalAdvice, landlordRegistered, + nonRentArrearsDispute, noticeDateWhenNotProvided, noticeDateWhenProvided, paymentInterstitial, @@ -43,6 +44,7 @@ export class RespondToClaimAction implements IAction { ['disputeClaimInterstitial', () => this.disputeClaimInterstitial(fieldName as actionData)], ['selectLandlordRegistered', () => this.selectLandlordRegistered(fieldName as actionData)], ['enterTenancyStartDetailsUnKnown', () => this.enterTenancyStartDetailsUnKnown(fieldName as actionRecord)], + ['disputingOtherPartsOfTheClaim', () => this.disputingOtherPartsOfTheClaim(fieldName as actionRecord)], ]); const actionToPerform = actionsMap.get(action); if (!actionToPerform) { @@ -245,6 +247,22 @@ export class RespondToClaimAction implements IAction { await performAction('clickButton', tenancyDateUnknown.saveAndContinueButton); } + private async disputingOtherPartsOfTheClaim(doYouWantToDisputeOption: actionRecord): Promise { + await performAction('clickRadioButton', { + question: nonRentArrearsDispute.doYouWantToDisputeQuestion, + option: doYouWantToDisputeOption.disputeOption, + }); + + if (doYouWantToDisputeOption.disputeOption === nonRentArrearsDispute.yesRadioOption) { + await performAction( + 'inputText', + nonRentArrearsDispute.explainPartOfClaimHiddenTextLabel, + doYouWantToDisputeOption.disputeInfo + ); + } + await performAction('clickButton', nonRentArrearsDispute.saveAndContinueButton); + } + // Below changes are temporary will be changed as part of HDPI-3596 private async inputErrorValidation(validationArr: actionRecord) { if (!validationArr || validationArr.validationReq !== 'YES') { diff --git a/src/test/ui/utils/registry/action.registry.ts b/src/test/ui/utils/registry/action.registry.ts index 294eabe4a..3fcd8d564 100644 --- a/src/test/ui/utils/registry/action.registry.ts +++ b/src/test/ui/utils/registry/action.registry.ts @@ -59,6 +59,7 @@ export class ActionRegistry { ['enterTenancyStartDetailsUnKnown', new RespondToClaimAction()], ['triggerFunctionalTests', new TriggerPageFunctionalTestsAction()], ['selectTenancyStartDateKnown', new RespondToClaimAction()], + ['disputingOtherPartsOfTheClaim', new RespondToClaimAction()], ]); static getAction(actionName: string): IAction { From 586fd4ecf55b0e0647573771b5550ef3c11b41e5 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Thu, 19 Mar 2026 14:36:41 +0000 Subject: [PATCH 03/20] Automation HDPI-3549 NonRentArrearsDispute --- src/test/ui/data/page-data/rentArrearsDispute.page.data.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/data/page-data/rentArrearsDispute.page.data.ts b/src/test/ui/data/page-data/rentArrearsDispute.page.data.ts index 1ce132dcf..e65f79010 100644 --- a/src/test/ui/data/page-data/rentArrearsDispute.page.data.ts +++ b/src/test/ui/data/page-data/rentArrearsDispute.page.data.ts @@ -1,4 +1,4 @@ export const rentArrearsDispute = { - mainHeader: `Rent Arrears Dispute(Placeholder)`, + mainHeader: `Rent arrears`, continueButton: `Continue`, }; From 391ac693e517323937c6e2b38855b7c65d78f814 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Thu, 19 Mar 2026 15:47:45 +0000 Subject: [PATCH 04/20] review comment --- .../ui/data/page-data/nonRentArrearsDispute.page.data.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts index 9b2e98395..02aace8a8 100644 --- a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts +++ b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts @@ -14,13 +14,14 @@ function generateRandomString(length: number): string { export const nonRentArrearsDispute = { mainHeader: `Disputing other parts of the claim`, - partOfClaimParagraph: `You should view the claim (opens in new tab) to see if there’s any other parts of the claim that are incorrect or you disagree with.`, + partOfClaimParagraph: `You should`, + toSeeIfParagraph: `to see if there’s any other parts of the claim that are incorrect or you disagree with.`, viewTheClaimLink: `view the claim (opens in new tab)`, mainHeaderGovServiceHiddenNewTab: `Welcome to GOV.UK`, thisIncludesParagraph: `This includes:`, groundsForPossessionList: `${submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName}’s grounds for possession (their reasons for making the claim)`, anyDocumentsList: `any documents they’ve uploaded to support their claim`, - anyOtherList: ` any other information they’ve given as part of their claim`, + anyOtherList: `any other information they’ve given as part of their claim`, doYouWantToDisputeQuestion: `Do you want to dispute any other parts of the claim?`, explainPartOfClaimHiddenTextLabel: `Explain which parts of the claim you do not agree with`, explainClaimTextInput: `Example - Do not agree with claim 1,2 and 3`, From b1193705112e57e2660b7e7aa269552b1b3542f4 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Fri, 20 Mar 2026 09:36:24 +0000 Subject: [PATCH 05/20] review comment --- src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts | 4 +--- src/test/ui/e2eTest/respondToAClaim.spec.ts | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts index 02aace8a8..e76281fc5 100644 --- a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts +++ b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts @@ -1,5 +1,3 @@ -import { submitCaseApiData } from '../api-data'; - function generateRandomString(length: number): string { const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`; let result = ``; @@ -19,7 +17,7 @@ export const nonRentArrearsDispute = { viewTheClaimLink: `view the claim (opens in new tab)`, mainHeaderGovServiceHiddenNewTab: `Welcome to GOV.UK`, thisIncludesParagraph: `This includes:`, - groundsForPossessionList: `${submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName}’s grounds for possession (their reasons for making the claim)`, + groundsForPossessionList: `${process.env.CLAIMANT_NAME}’s grounds for possession (their reasons for making the claim)`, anyDocumentsList: `any documents they’ve uploaded to support their claim`, anyOtherList: `any other information they’ve given as part of their claim`, doYouWantToDisputeQuestion: `Do you want to dispute any other parts of the claim?`, diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index fe39f7066..5f47515f8 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -27,12 +27,14 @@ const home_url = config.get('e2e.testUrl') as string; test.beforeEach(async ({ page }, testInfo) => { initializeExecutor(page); + process.env.CLAIMANT_NAME = submitCaseApiData.submitCasePayload.claimantName; if (testInfo.title.includes('NoticeServed - No')) { process.env.NOTICE_SERVED = 'NO'; } else { process.env.NOTICE_SERVED = 'YES'; } if (testInfo.title.includes('@noDefendants')) { + process.env.CLAIMANT_NAME = submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName; await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadNoDefendants }); } else { From 6f2c4ce55f396414e807c874c88ecc2607f3947f Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 23 Mar 2026 09:33:09 +0000 Subject: [PATCH 06/20] conflict resolution --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index 6f581038b..9cd750000 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -278,8 +278,10 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { await performAction('selectNoticeDetails', { option: confirmationOfNoticeGiven.noRadioOption, }); - await performValidation('mainHeader', nonRentArrearsDispute.mainHeader); - await performAction('clickButton', nonRentArrearsDispute.continueButton); + await performAction('disputingOtherPartsOfTheClaim', { + disputeOption: nonRentArrearsDispute.yesRadioOption, + disputeInfo: nonRentArrearsDispute.explainClaimTextInput, + }); // placeholder page, so need to be replaced with custom action when actual page is implemented await performValidation('mainHeader', counterClaim.mainHeader); await performAction('clickButton', counterClaim.saveAndContinueButton); From 437c5db35890cccf4384ec57bfbc79a3a444632a Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Tue, 24 Mar 2026 12:58:28 +0000 Subject: [PATCH 07/20] navigation tests updated --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 17 +++++++++++++- .../functional/nonRentArrearsDispute.pft.ts | 23 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index 9cd750000..387d19993 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -33,6 +33,21 @@ test.beforeEach(async ({ page }, testInfo) => { } else { process.env.NOTICE_SERVED = 'YES'; } + + // Notice date provided + if (testInfo.title.includes('NoticeDateProvided - No')) { + process.env.NOTICE_DATE_PROVIDED = 'NO'; + } else if (testInfo.title.includes('NoticeDateProvided - Yes')) { + process.env.NOTICE_DATE_PROVIDED = 'YES'; + } + + // Tenancy start date logic (independent) + if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { + process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; + } else { + process.env.RENT_NON_RENT = 'YES'; + } + if (testInfo.title.includes('@noDefendants')) { process.env.CLAIMANT_NAME = submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName; process.env.CORRESPONDENCE_ADDRESS = 'UNKNOWN'; @@ -499,7 +514,7 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => { await performValidation('mainHeader', repaymentsAgreed.mainHeader); }); - test('England - RentArrears - NoticeServed - No NoticeDateProvided - No - RentArrearsDispute @regression', async () => { + test('England - RentArrears - NoticeServed - No - RentArrearsDispute @regression', async () => { await performAction('selectLegalAdvice', freeLegalAdvice.yesRadioOption); await performAction('confirmDefendantDetails', { question: defendantNameConfirmation.mainHeader, diff --git a/src/test/ui/functional/nonRentArrearsDispute.pft.ts b/src/test/ui/functional/nonRentArrearsDispute.pft.ts index ac015a7cd..3a1e3d326 100644 --- a/src/test/ui/functional/nonRentArrearsDispute.pft.ts +++ b/src/test/ui/functional/nonRentArrearsDispute.pft.ts @@ -1,4 +1,10 @@ -import { nonRentArrearsDispute } from '../data/page-data'; +import { + dashboard, + nonRentArrearsDispute, + noticeDateWhenNotProvided, + noticeDateWhenProvided, rentArrearsDispute, tenancyDateDetails, + tenancyDateUnknown, +} from '../data/page-data'; import { performAction, performValidation } from '../utils/controller'; export async function nonRentArrearsDisputeErrorValidation(): Promise { @@ -36,3 +42,18 @@ export async function nonRentArrearsDisputeErrorValidation(): Promise { nonRentArrearsDispute.explainClaimTextInput ); } + +export async function noRentArrearsNavigationTests(): Promise { + if (process.env.NOTICE_DATE_PROVIDED === 'NO') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenNotProvided.mainHeader); + } else if (process.env.NOTICE_DATE_PROVIDED === 'YES') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenProvided.mainHeader); + } else if (process.env.TENANCY_START_DATE_KNOWN === 'NO') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateUnknown.mainHeader); + } else if (process.env.TENANCY_START_DATE_KNOWN === 'YES') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateDetails.mainHeader); + } else if(process.env.RENT_NON_RENT === 'YES') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, rentArrearsDispute.mainHeader); + } + await performValidation('pageNavigation', nonRentArrearsDispute.saveForLaterButton, dashboard.mainHeader); +} From 17c16edb278d0806efe0c3539dbb5d33cbf9f50f Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Tue, 24 Mar 2026 12:59:19 +0000 Subject: [PATCH 08/20] navigation tests updated --- src/test/ui/functional/nonRentArrearsDispute.pft.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/ui/functional/nonRentArrearsDispute.pft.ts b/src/test/ui/functional/nonRentArrearsDispute.pft.ts index 3a1e3d326..36835949c 100644 --- a/src/test/ui/functional/nonRentArrearsDispute.pft.ts +++ b/src/test/ui/functional/nonRentArrearsDispute.pft.ts @@ -2,7 +2,9 @@ import { dashboard, nonRentArrearsDispute, noticeDateWhenNotProvided, - noticeDateWhenProvided, rentArrearsDispute, tenancyDateDetails, + noticeDateWhenProvided, + rentArrearsDispute, + tenancyDateDetails, tenancyDateUnknown, } from '../data/page-data'; import { performAction, performValidation } from '../utils/controller'; @@ -52,7 +54,7 @@ export async function noRentArrearsNavigationTests(): Promise { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateUnknown.mainHeader); } else if (process.env.TENANCY_START_DATE_KNOWN === 'YES') { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateDetails.mainHeader); - } else if(process.env.RENT_NON_RENT === 'YES') { + } else if (process.env.RENT_NON_RENT === 'YES') { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, rentArrearsDispute.mainHeader); } await performValidation('pageNavigation', nonRentArrearsDispute.saveForLaterButton, dashboard.mainHeader); From eb26507582a99613e51a05d7f5bc7dc2545c6f6e Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Tue, 24 Mar 2026 14:44:35 +0000 Subject: [PATCH 09/20] navigation tests updated --- .../page-data/nonRentArrearsDispute.page.data.ts | 12 +----------- src/test/ui/utils/common/string.utils.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts index e76281fc5..2595a5a84 100644 --- a/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts +++ b/src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts @@ -1,14 +1,4 @@ -function generateRandomString(length: number): string { - const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`; - let result = ``; - - for (let i = 0; i < length; i++) { - const randomIndex = Math.floor(Math.random() * chars.length); - result += chars[randomIndex]; - } - - return result; -} +import { generateRandomString } from '../../utils/common/string.utils'; export const nonRentArrearsDispute = { mainHeader: `Disputing other parts of the claim`, diff --git a/src/test/ui/utils/common/string.utils.ts b/src/test/ui/utils/common/string.utils.ts index 5ffabd676..71db21359 100644 --- a/src/test/ui/utils/common/string.utils.ts +++ b/src/test/ui/utils/common/string.utils.ts @@ -5,3 +5,15 @@ export function escapeForRegex(text: string): string { export function exactTextWithOptionalWhitespaceRegex(text: string): RegExp { return new RegExp(`^\\s*${escapeForRegex(text)}\\s*$`); } + +export function generateRandomString(length: number): string { + const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`; + let result = ``; + + for (let i = 0; i < length; i++) { + const randomIndex = Math.floor(Math.random() * chars.length); + result += chars[randomIndex]; + } + + return result; +} From c8da3f3d0458b981817f86c70ae8ee5f69516abb Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Tue, 24 Mar 2026 16:05:06 +0000 Subject: [PATCH 10/20] review comment resolved --- .../ui/utils/actions/custom-actions/respondToClaim.action.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts b/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts index 1c40725c6..02e67bfbd 100644 --- a/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts +++ b/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts @@ -271,7 +271,7 @@ export class RespondToClaimAction implements IAction { option: doYouWantToDisputeOption.disputeOption, }); - if (doYouWantToDisputeOption.disputeOption === nonRentArrearsDispute.yesRadioOption) { + if (doYouWantToDisputeOption.disputeOption === 'Yes') { await performAction( 'inputText', nonRentArrearsDispute.explainPartOfClaimHiddenTextLabel, From 10946db0ef0cd6a533a50d25b718b0350fb63121 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Fri, 27 Mar 2026 19:34:43 +0000 Subject: [PATCH 11/20] fixed conflicts --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 43 ++++++++++--------- .../custom-actions/respondToClaim.action.ts | 2 + 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index e6fbd51e7..9c10d0e0c 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -46,32 +46,33 @@ test.beforeEach(async ({ page }, testInfo) => { process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; } else { process.env.RENT_NON_RENT = 'YES'; - const tenancyKey = ['Introductory', 'Demoted', 'Assured', 'Secure', 'Flexible'].find(type => - testInfo.title.includes(type) - ); + const tenancyKey = ['Introductory', 'Demoted', 'Assured', 'Secure', 'Flexible'].find(type => + testInfo.title.includes(type) + ); - switch (tenancyKey) { - case 'Introductory': - process.env.TENANCY_TYPE = 'INTRODUCTORY_TENANCY'; - process.env.GROUNDS = 'RENT_ARREARS_GROUND10'; - break; + switch (tenancyKey) { + case 'Introductory': + process.env.TENANCY_TYPE = 'INTRODUCTORY_TENANCY'; + process.env.GROUNDS = 'RENT_ARREARS_GROUND10'; + break; - case 'Demoted': - process.env.TENANCY_TYPE = 'DEMOTED_TENANCY'; - process.env.GROUNDS = 'RENT_ARREARS'; - break; + case 'Demoted': + process.env.TENANCY_TYPE = 'DEMOTED_TENANCY'; + process.env.GROUNDS = 'RENT_ARREARS'; + break; - case 'Assured': - process.env.TENANCY_TYPE = 'ASSURED_TENANCY'; - break; + case 'Assured': + process.env.TENANCY_TYPE = 'ASSURED_TENANCY'; + break; - case 'Secure': - process.env.TENANCY_TYPE = 'SECURE_TENANCY'; - break; + case 'Secure': + process.env.TENANCY_TYPE = 'SECURE_TENANCY'; + break; - case 'Flexible': - process.env.TENANCY_TYPE = 'FLEXIBLE_TENANCY'; - break; + case 'Flexible': + process.env.TENANCY_TYPE = 'FLEXIBLE_TENANCY'; + break; + } } if (testInfo.title.includes('@noDefendants')) { diff --git a/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts b/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts index d452eb450..adccac670 100644 --- a/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts +++ b/src/test/ui/utils/actions/custom-actions/respondToClaim.action.ts @@ -292,6 +292,8 @@ export class RespondToClaimAction implements IAction { ); } await performAction('clickButton', nonRentArrearsDispute.saveAndContinueButton); + } + private async tenancyOrContractTypeDetails(tenancyTypeDetailsInfo: actionRecord) { const tenancyType = formatTextToLowercaseSeparatedBySpace(tenancyTypeDetailsInfo.tenancyType as string); const article = /^[aeiou]/i.test(tenancyType) ? 'an' : 'a'; From d8074182ed1e342673bbf1a8620258365b768c06 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Fri, 27 Mar 2026 20:15:20 +0000 Subject: [PATCH 12/20] fixed conflicts --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 55 +++++++++++---------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index 9c10d0e0c..be0109946 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -41,38 +41,39 @@ test.beforeEach(async ({ page }, testInfo) => { process.env.NOTICE_DATE_PROVIDED = 'YES'; } - // Tenancy start date logic (independent) - if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { - process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; - } else { - process.env.RENT_NON_RENT = 'YES'; - const tenancyKey = ['Introductory', 'Demoted', 'Assured', 'Secure', 'Flexible'].find(type => - testInfo.title.includes(type) - ); + const tenancyKey = ['Introductory', 'Demoted', 'Assured', 'Secure', 'Flexible'].find(type => + testInfo.title.includes(type) + ); - switch (tenancyKey) { - case 'Introductory': - process.env.TENANCY_TYPE = 'INTRODUCTORY_TENANCY'; - process.env.GROUNDS = 'RENT_ARREARS_GROUND10'; - break; + switch (tenancyKey) { + case 'Introductory': + process.env.TENANCY_TYPE = 'INTRODUCTORY_TENANCY'; + process.env.GROUNDS = 'RENT_ARREARS_GROUND10'; + break; - case 'Demoted': - process.env.TENANCY_TYPE = 'DEMOTED_TENANCY'; - process.env.GROUNDS = 'RENT_ARREARS'; - break; + case 'Demoted': + process.env.TENANCY_TYPE = 'DEMOTED_TENANCY'; + process.env.GROUNDS = 'RENT_ARREARS'; + break; - case 'Assured': - process.env.TENANCY_TYPE = 'ASSURED_TENANCY'; - break; + case 'Assured': + process.env.TENANCY_TYPE = 'ASSURED_TENANCY'; + break; - case 'Secure': - process.env.TENANCY_TYPE = 'SECURE_TENANCY'; - break; + case 'Secure': + process.env.TENANCY_TYPE = 'SECURE_TENANCY'; + break; - case 'Flexible': - process.env.TENANCY_TYPE = 'FLEXIBLE_TENANCY'; - break; - } + case 'Flexible': + process.env.TENANCY_TYPE = 'FLEXIBLE_TENANCY'; + break; + } + + // Tenancy start date logic (independent) + if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { + process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; + } else { + process.env.RENT_NON_RENT = 'YES'; } if (testInfo.title.includes('@noDefendants')) { From a670f3fb811caeb37546ff460823012865f6ba1d Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 07:40:43 +0100 Subject: [PATCH 13/20] fixed conflicts --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index be0109946..2b4f0b69d 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -80,7 +80,6 @@ test.beforeEach(async ({ page }, testInfo) => { process.env.CLAIMANT_NAME = submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName; process.env.CLAIMANT_NAME_OVERRIDDEN = 'YES'; process.env.CORRESPONDENCE_ADDRESS = 'UNKNOWN'; - process.env.CLAIMANT_NAME = submitCaseApiData.submitCasePayloadNoDefendants.overriddenClaimantName; await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadNoDefendants }); } else if (testInfo.title.includes('@assured')) { From 22a374c5baaa81cea4d6e8412d74058a4361c22e Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 07:47:06 +0100 Subject: [PATCH 14/20] fixed conflicts --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index 2b4f0b69d..6376eea7e 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -69,7 +69,7 @@ test.beforeEach(async ({ page }, testInfo) => { break; } - // Tenancy start date logic (independent) + // Tenancy start date logic for noDefendantTest if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; } else { From 027f65121ac94e9c36e1c798866678e3e570baf0 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 08:20:15 +0100 Subject: [PATCH 15/20] fixed conflicts --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index 6376eea7e..679531cf5 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -69,7 +69,7 @@ test.beforeEach(async ({ page }, testInfo) => { break; } - // Tenancy start date logic for noDefendantTest + // Tenancy start date logic for noDefendantTest and rentNonRent test if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; } else { From 52ede281c3d2b03917f24a7e8fe17bb3f40f8f9a Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 08:43:55 +0100 Subject: [PATCH 16/20] fixed wales journey failure --- .../ui/functional/tenancyDateDetails.pft.ts | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/test/ui/functional/tenancyDateDetails.pft.ts b/src/test/ui/functional/tenancyDateDetails.pft.ts index 5a93cdcef..ed03bc4e9 100644 --- a/src/test/ui/functional/tenancyDateDetails.pft.ts +++ b/src/test/ui/functional/tenancyDateDetails.pft.ts @@ -1,4 +1,11 @@ -import { dashboard, tenancyDateDetails, tenancyDetails } from '../data/page-data'; +import { + dashboard, + disputeClaimInterstitial, + tenancyDateDetails, + tenancyTypeDetails, + writtenTerms, +} from '../data/page-data'; +import { claimantsName } from '../utils/actions/custom-actions'; import { performAction, performActions, performValidation } from '../utils/controller'; export async function tenancyDateDetailsErrorValidation(): Promise { @@ -50,7 +57,19 @@ export async function tenancyDateDetailsErrorValidation(): Promise { } export async function tenancyDateDetailsNavigationTests(): Promise { - await performValidation('pageNavigation', tenancyDateDetails.backLink, tenancyDetails.mainHeader); - await performAction('clickRadioButton', tenancyDateDetails.yesRadioOption); + if (process.env.WALES_POSTCODE === 'YES') { + if (claimantsName) { + await performValidation('pageNavigation', tenancyTypeDetails.backLink, writtenTerms.mainHeader); + } + } else { + if (claimantsName) { + await performValidation( + 'pageNavigation', + tenancyTypeDetails.backLink, + disputeClaimInterstitial.getMainHeader(claimantsName) + ); + } + } + await performAction('clickRadioButton', tenancyTypeDetails.yesRadioOption); await performValidation('pageNavigation', tenancyDateDetails.saveForLaterButton, dashboard.mainHeader); } From 204f69853835b3e9db4a0099aa48d9d523cb0563 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 10:38:05 +0100 Subject: [PATCH 17/20] env variables for Notice details No NotSure --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 5 +++++ src/test/ui/functional/nonRentArrearsDispute.pft.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index 679531cf5..ea0bb5641 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -69,6 +69,11 @@ test.beforeEach(async ({ page }, testInfo) => { break; } + //Check if No or Im not sure is selected on NoticeDetails page - for back link navigation + if (testInfo.title.includes('NoticeDetails - No') || testInfo.title.includes('NoticeDetails - Im not sure')) { + process.env.NOTICE_DETAILS_NO_NOTSURE = 'YES'; + } + // Tenancy start date logic for noDefendantTest and rentNonRent test if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; diff --git a/src/test/ui/functional/nonRentArrearsDispute.pft.ts b/src/test/ui/functional/nonRentArrearsDispute.pft.ts index 36835949c..1c077590d 100644 --- a/src/test/ui/functional/nonRentArrearsDispute.pft.ts +++ b/src/test/ui/functional/nonRentArrearsDispute.pft.ts @@ -1,4 +1,5 @@ import { + confirmationOfNoticeGiven, dashboard, nonRentArrearsDispute, noticeDateWhenNotProvided, @@ -56,6 +57,8 @@ export async function noRentArrearsNavigationTests(): Promise { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateDetails.mainHeader); } else if (process.env.RENT_NON_RENT === 'YES') { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, rentArrearsDispute.mainHeader); + } else if (process.env.NOTICE_DETAILS_NO_NOTSURE === 'YES') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, confirmationOfNoticeGiven.mainHeader); } await performValidation('pageNavigation', nonRentArrearsDispute.saveForLaterButton, dashboard.mainHeader); } From 656afdedf12e87cefa95c0a28fadbb32bb54d6fd Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 17:42:57 +0100 Subject: [PATCH 18/20] fixed page navigation --- src/test/ui/e2eTest/respondToAClaim.spec.ts | 3 +- .../functional/nonRentArrearsDispute.pft.ts | 64 +++++++++++++++---- 2 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/test/ui/e2eTest/respondToAClaim.spec.ts b/src/test/ui/e2eTest/respondToAClaim.spec.ts index ea0bb5641..491aa6e5d 100644 --- a/src/test/ui/e2eTest/respondToAClaim.spec.ts +++ b/src/test/ui/e2eTest/respondToAClaim.spec.ts @@ -77,6 +77,7 @@ test.beforeEach(async ({ page }, testInfo) => { // Tenancy start date logic for noDefendantTest and rentNonRent test if (testInfo.title.includes('NoticeServed - No') && !testInfo.title.includes('@rentNonRent')) { process.env.TENANCY_START_DATE_KNOWN = testInfo.title.includes('noDefendants') ? 'NO' : 'YES'; + process.env.RENT_NON_RENT = 'NO'; } else { process.env.RENT_NON_RENT = 'YES'; } @@ -96,7 +97,7 @@ test.beforeEach(async ({ page }, testInfo) => { } else if (testInfo.title.includes('@other')) { await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadOtherTenancy }); - } else if (testInfo.title.includes('@rentAndNonRent')) { + } else if (testInfo.title.includes('@rentNonRent')) { await performAction('createCaseAPI', { data: createCaseApiData.createCasePayload }); await performAction('submitCaseAPI', { data: submitCaseApiData.submitCasePayloadRentNonRent }); } else { diff --git a/src/test/ui/functional/nonRentArrearsDispute.pft.ts b/src/test/ui/functional/nonRentArrearsDispute.pft.ts index 1c077590d..93794f53c 100644 --- a/src/test/ui/functional/nonRentArrearsDispute.pft.ts +++ b/src/test/ui/functional/nonRentArrearsDispute.pft.ts @@ -4,7 +4,6 @@ import { nonRentArrearsDispute, noticeDateWhenNotProvided, noticeDateWhenProvided, - rentArrearsDispute, tenancyDateDetails, tenancyDateUnknown, } from '../data/page-data'; @@ -47,18 +46,59 @@ export async function nonRentArrearsDisputeErrorValidation(): Promise { } export async function noRentArrearsNavigationTests(): Promise { - if (process.env.NOTICE_DATE_PROVIDED === 'NO') { - await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenNotProvided.mainHeader); - } else if (process.env.NOTICE_DATE_PROVIDED === 'YES') { - await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenProvided.mainHeader); - } else if (process.env.TENANCY_START_DATE_KNOWN === 'NO') { + if (process.env.NOTICE_SERVED === 'YES' && process.env.NOTICE_DATE_PROVIDED === 'YES') { + if (process.env.NOTICE_DETAILS_NO_NOTSURE === 'YES') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, confirmationOfNoticeGiven.mainHeader); + } else { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenProvided.mainHeader); + } + } else if (process.env.NOTICE_SERVED === 'YES' && process.env.NOTICE_DATE_PROVIDED === 'NO') { + if (process.env.NOTICE_DETAILS_NO_NOTSURE === 'YES') { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, confirmationOfNoticeGiven.mainHeader); + } else { + await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenNotProvided.mainHeader); + } + } + + if ( + process.env.NOTICE_SERVED === 'NO' && + process.env.TENANCY_START_DATE_KNOWN === 'NO' && + process.env.RENT_NON_RENT === 'NO' + ) { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateUnknown.mainHeader); - } else if (process.env.TENANCY_START_DATE_KNOWN === 'YES') { + } else if ( + process.env.NOTICE_SERVED === 'NO' && + process.env.TENANCY_START_DATE_KNOWN === 'YES' && + process.env.RENT_NON_RENT === 'NO' + ) { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateDetails.mainHeader); - } else if (process.env.RENT_NON_RENT === 'YES') { - await performValidation('pageNavigation', nonRentArrearsDispute.backLink, rentArrearsDispute.mainHeader); - } else if (process.env.NOTICE_DETAILS_NO_NOTSURE === 'YES') { - await performValidation('pageNavigation', nonRentArrearsDispute.backLink, confirmationOfNoticeGiven.mainHeader); - } + } + //enable after 3495 is merged + + // else if ( + // process.env.NOTICE_SERVED === 'NO' && + // process.env.TENANCY_START_DATE_KNOWN === 'YES' && + // process.env.RENT_NON_RENT === 'YES' + // ) { + // await performValidation('pageNavigation', nonRentArrearsDispute.backLink, rentArrearsDispute.mainHeader); + // } + await performAction('clickRadioButton', nonRentArrearsDispute.yesRadioOption); await performValidation('pageNavigation', nonRentArrearsDispute.saveForLaterButton, dashboard.mainHeader); } + +//old implementation +// if (process.env.NOTICE_DATE_PROVIDED === 'NO') { +// await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenNotProvided.mainHeader); +// } else if (process.env.NOTICE_DATE_PROVIDED === 'YES') { +// await performValidation('pageNavigation', nonRentArrearsDispute.backLink, noticeDateWhenProvided.mainHeader); +// } else if (process.env.TENANCY_START_DATE_KNOWN === 'NO') { +// await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateUnknown.mainHeader); +// } else if (process.env.TENANCY_START_DATE_KNOWN === 'YES') { +// await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateDetails.mainHeader); +// } else if (process.env.RENT_NON_RENT === 'YES') { +// await performValidation('pageNavigation', nonRentArrearsDispute.backLink, rentArrearsDispute.mainHeader); +// } else if (process.env.NOTICE_DETAILS_NO_NOTSURE === 'YES') { +// await performValidation('pageNavigation', nonRentArrearsDispute.backLink, confirmationOfNoticeGiven.mainHeader); +// } +// await performValidation('pageNavigation', nonRentArrearsDispute.saveForLaterButton, dashboard.mainHeader); +// } From fa5d37068c0493cd8658c83fe7953121fdeb7ebe Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 17:46:50 +0100 Subject: [PATCH 19/20] fixed page navigation --- src/test/ui/functional/nonRentArrearsDispute.pft.ts | 2 +- src/test/ui/functional/tenancyDateDetails.pft.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/functional/nonRentArrearsDispute.pft.ts b/src/test/ui/functional/nonRentArrearsDispute.pft.ts index 93794f53c..19fe26255 100644 --- a/src/test/ui/functional/nonRentArrearsDispute.pft.ts +++ b/src/test/ui/functional/nonRentArrearsDispute.pft.ts @@ -72,7 +72,7 @@ export async function noRentArrearsNavigationTests(): Promise { process.env.RENT_NON_RENT === 'NO' ) { await performValidation('pageNavigation', nonRentArrearsDispute.backLink, tenancyDateDetails.mainHeader); - } + } //enable after 3495 is merged // else if ( diff --git a/src/test/ui/functional/tenancyDateDetails.pft.ts b/src/test/ui/functional/tenancyDateDetails.pft.ts index dc9129830..66342648d 100644 --- a/src/test/ui/functional/tenancyDateDetails.pft.ts +++ b/src/test/ui/functional/tenancyDateDetails.pft.ts @@ -71,7 +71,7 @@ export async function tenancyDateDetailsNavigationTests(): Promise { ); } } - + await performValidation('pageNavigation', tenancyDateDetails.feedbackLink, { element: feedback.tellUsWhatYouThinkParagraph, pageSlug: tenancyDateDetails.pageSlug, From 44ae618107712f041ce0ffa3d86479344fbbf534 Mon Sep 17 00:00:00 2001 From: ashajayaprakash Date: Mon, 30 Mar 2026 18:13:02 +0100 Subject: [PATCH 20/20] fixed page navigation --- .../ui/functional/tenancyDateDetails.pft.ts | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/test/ui/functional/tenancyDateDetails.pft.ts b/src/test/ui/functional/tenancyDateDetails.pft.ts index 66342648d..9d6dd0772 100644 --- a/src/test/ui/functional/tenancyDateDetails.pft.ts +++ b/src/test/ui/functional/tenancyDateDetails.pft.ts @@ -1,12 +1,4 @@ -import { - dashboard, - disputeClaimInterstitial, - feedback, - tenancyDateDetails, - tenancyTypeDetails, - writtenTerms, -} from '../data/page-data'; -import { claimantsName } from '../utils/actions/custom-actions'; +import { dashboard, feedback, tenancyDateDetails, tenancyTypeDetails } from '../data/page-data'; import { performAction, performActions, performValidation } from '../utils/controller'; export async function tenancyDateDetailsErrorValidation(): Promise { @@ -58,20 +50,6 @@ export async function tenancyDateDetailsErrorValidation(): Promise { } export async function tenancyDateDetailsNavigationTests(): Promise { - if (process.env.WALES_POSTCODE === 'YES') { - if (claimantsName) { - await performValidation('pageNavigation', tenancyTypeDetails.backLink, writtenTerms.mainHeader); - } - } else { - if (claimantsName) { - await performValidation( - 'pageNavigation', - tenancyTypeDetails.backLink, - disputeClaimInterstitial.getMainHeader(claimantsName) - ); - } - } - await performValidation('pageNavigation', tenancyDateDetails.feedbackLink, { element: feedback.tellUsWhatYouThinkParagraph, pageSlug: tenancyDateDetails.pageSlug,