Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d082b28
Automation HDPI-3549 NonRentArrearsDispute
AshaJayaprakash Mar 19, 2026
48a55ae
Automation HDPI-3549 NonRentArrearsDispute
AshaJayaprakash Mar 19, 2026
586fd4e
Automation HDPI-3549 NonRentArrearsDispute
AshaJayaprakash Mar 19, 2026
391ac69
review comment
AshaJayaprakash Mar 19, 2026
3ee1348
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 19, 2026
b119370
review comment
AshaJayaprakash Mar 20, 2026
5523cbc
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 23, 2026
6f2c4ce
conflict resolution
AshaJayaprakash Mar 23, 2026
4d37a6c
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 23, 2026
85ee961
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 24, 2026
437c5db
navigation tests updated
AshaJayaprakash Mar 24, 2026
6db3ba0
Merge remote-tracking branch 'origin/TestAutomation-HDPI-3549' into T…
AshaJayaprakash Mar 24, 2026
17c16ed
navigation tests updated
AshaJayaprakash Mar 24, 2026
eb26507
navigation tests updated
AshaJayaprakash Mar 24, 2026
ebaf5c9
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 24, 2026
c8da3f3
review comment resolved
AshaJayaprakash Mar 24, 2026
b98835f
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 25, 2026
166721f
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 25, 2026
cca4750
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 27, 2026
10946db
fixed conflicts
AshaJayaprakash Mar 27, 2026
d807418
fixed conflicts
AshaJayaprakash Mar 27, 2026
a670f3f
fixed conflicts
AshaJayaprakash Mar 30, 2026
22a374c
fixed conflicts
AshaJayaprakash Mar 30, 2026
027f651
fixed conflicts
AshaJayaprakash Mar 30, 2026
52ede28
fixed wales journey failure
AshaJayaprakash Mar 30, 2026
204f698
env variables for Notice details No NotSure
AshaJayaprakash Mar 30, 2026
dd11aad
Merge branch 'HDPI-3549-non-rent-arrears-dispute-frontend' into TestA…
AshaJayaprakash Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/test/ui/config/axe-exclusions.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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
'#disputeOtherParts', //page: nonRentArrearsDispute, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button
'#tenancyTypeConfirm-2', //page: tenancyOccupationContractLicenseAgreement, element: 'No', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button
'#contactByEmailOrPost', //page: contactPreferenceEmailOrPost, element: 'Yes', element_type: radioOption, reason_for_exclusion: 'aria-expanded' attribute is expected for this radio button
];
27 changes: 25 additions & 2 deletions src/test/ui/data/page-data/nonRentArrearsDispute.page.data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
import { generateRandomString } from '../../utils/common/string.utils';

export const nonRentArrearsDispute = {
mainHeader: `Non-Rent Arrears Dispute(Placeholder)`,
continueButton: `Continue`,
mainHeader: `Disputing other parts of the claim`,
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: `${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?`,
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`,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const rentArrearsDispute = {
mainHeader: `Rent Arrears Dispute(Placeholder)`,
mainHeader: `Rent arrears`,
continueButton: `Continue`,
};
41 changes: 33 additions & 8 deletions src/test/ui/e2eTest/respondToAClaim.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ test.beforeEach(async ({ page }, testInfo) => {
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';
}

const tenancyKey = ['Introductory', 'Demoted', 'Assured', 'Secure', 'Flexible'].find(type =>
testInfo.title.includes(type)
);
Expand Down Expand Up @@ -62,10 +69,22 @@ 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';
} else {
process.env.RENT_NON_RENT = 'YES';
}

if (testInfo.title.includes('@noDefendants')) {
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')) {
Expand Down Expand Up @@ -189,7 +208,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 - Secure - NoticeServed - Yes and NoticeDateProvided - Yes - NoticeDetails- Yes - Notice date known @secureFlexible @regression', async () => {
Expand Down Expand Up @@ -232,8 +253,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);
Expand Down Expand Up @@ -280,8 +302,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);
Expand Down Expand Up @@ -326,8 +350,9 @@ test.describe('Respond to a claim - e2e Journey @nightly', async () => {
tenancyTypeInfo: tenancyTypeDetails.giveCorrectTenancyTypeTextInput,
});
await performAction('enterTenancyStartDetailsUnKnown');
await performValidation('mainHeader', nonRentArrearsDispute.mainHeader);
await performAction('clickButton', nonRentArrearsDispute.continueButton);
await performAction('disputingOtherPartsOfTheClaim', {
disputeOption: nonRentArrearsDispute.noRadioOption,
});
});

test('RentArrears - Introductory - NoticeServed - Yes and NoticeDateProvided - No - NoticeDetails- Yes - Notice date unknown @regression', async () => {
Expand Down
64 changes: 64 additions & 0 deletions src/test/ui/functional/nonRentArrearsDispute.pft.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import {
confirmationOfNoticeGiven,
dashboard,
nonRentArrearsDispute,
noticeDateWhenNotProvided,
noticeDateWhenProvided,
rentArrearsDispute,
tenancyDateDetails,
tenancyDateUnknown,
} from '../data/page-data';
import { performAction, performValidation } from '../utils/controller';

export async function nonRentArrearsDisputeErrorValidation(): Promise<void> {
//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
);
}

export async function noRentArrearsNavigationTests(): Promise<void> {
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);
}
25 changes: 22 additions & 3 deletions src/test/ui/functional/tenancyDateDetails.pft.ts
Original file line number Diff line number Diff line change
@@ -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<void> {
Expand Down Expand Up @@ -50,7 +57,19 @@ export async function tenancyDateDetailsErrorValidation(): Promise<void> {
}

export async function tenancyDateDetailsNavigationTests(): Promise<void> {
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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
freeLegalAdvice,
landlordLicensed,
landlordRegistered,
nonRentArrearsDispute,
noticeDateWhenNotProvided,
noticeDateWhenProvided,
paymentInterstitial,
Expand Down Expand Up @@ -48,6 +49,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)],
['tenancyOrContractTypeDetails', () => this.tenancyOrContractTypeDetails(fieldName as actionRecord)],
['selectLandlordLicensed', () => this.selectLandlordLicensed(fieldName as actionRecord)],
]);
Expand Down Expand Up @@ -276,6 +278,22 @@ export class RespondToClaimAction implements IAction {
await performAction('clickButton', tenancyDateUnknown.saveAndContinueButton);
}

private async disputingOtherPartsOfTheClaim(doYouWantToDisputeOption: actionRecord): Promise<void> {
await performAction('clickRadioButton', {
question: nonRentArrearsDispute.doYouWantToDisputeQuestion,
option: doYouWantToDisputeOption.disputeOption,
});

if (doYouWantToDisputeOption.disputeOption === 'Yes') {
await performAction(
'inputText',
nonRentArrearsDispute.explainPartOfClaimHiddenTextLabel,
doYouWantToDisputeOption.disputeInfo
);
}
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';
Expand Down
12 changes: 12 additions & 0 deletions src/test/ui/utils/common/string.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ 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;
}

export function formatTextToLowercaseSeparatedBySpace(value: string): string {
return value.toLowerCase().replace(/_/g, ' ').trim();
}
1 change: 1 addition & 0 deletions src/test/ui/utils/registry/action.registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class ActionRegistry {
['enterTenancyStartDetailsUnKnown', new RespondToClaimAction()],
['triggerFunctionalTests', new TriggerPageFunctionalTestsAction()],
['selectTenancyStartDateKnown', new RespondToClaimAction()],
['disputingOtherPartsOfTheClaim', new RespondToClaimAction()],
['tenancyOrContractTypeDetails', new RespondToClaimAction()],
['selectLandlordLicensed', new RespondToClaimAction()],
['selectContactPreferenceEmailOrPost', new RespondToClaimAction()],
Expand Down