Skip to content

Commit 7abd01c

Browse files
authored
2419 Fix E2E Tests (#2510)
* fix: e2e tests * fix: alcs txt naming * chore: update comments
1 parent f0b333d commit 7abd01c

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

e2e/pages/alcs/applicant-info-page/parcels-section.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export class ParcelsSection {
3232
}
3333
await expect(this.isFarmText(parcelNumber)).toHaveText(parcel.isFarm ? 'Yes' : 'No');
3434
await expect(this.civicAddressText(parcelNumber)).toHaveText(parcel.civicAddress);
35-
await expect(this.certificateOfTitleText(parcelNumber)).toHaveText(this.fileName(parcel.certificateOfTitlePath));
35+
36+
// Check each child element for certificate of title (mobile/desktop links)
37+
for (const text of await this.certificateOfTitleText(parcelNumber).locator("> *").all()) {
38+
await expect(text).toHaveText(this.fileName(parcel.certificateOfTitlePath));
39+
}
3640
}
3741

3842
async expectParcelOwners(parcelNumber: number, owners: ParcelOwnerDetails[]) {

e2e/pages/alcs/applicant-info-page/tur-proposal-section.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export class TURProposalSection {
88
readonly stepsToReduceImpactText: Locator;
99
readonly alternativeLandText: Locator;
1010
readonly totalAreaText: Locator;
11-
readonly allOwnersNotifiedText: Locator;
1211
readonly proofOfServingNoticeText: Locator;
1312
readonly proposalMapText: Locator;
1413

@@ -29,8 +28,15 @@ export class TURProposalSection {
2928
await expect(this.stepsToReduceImpactText).toHaveText(proposal.stepsToReduceImpact);
3029
await expect(this.alternativeLandText).toHaveText(proposal.alternativeLand);
3130
await expect(this.totalAreaText).toHaveText(`${proposal.totalArea} ha`);
32-
await expect(this.proofOfServingNoticeText).toHaveText(this.fileName(proposal.proofOfServingNoticePath));
33-
await expect(this.proposalMapText).toHaveText(this.fileName(proposal.proposalMapPath));
31+
32+
// ALCS has multiple files with *ngFor, so check each child element
33+
for (const text of await this.proofOfServingNoticeText.locator("> *").all()) {
34+
await expect(text).toHaveText(this.fileName(proposal.proofOfServingNoticePath));
35+
}
36+
37+
for (const text of await this.proposalMapText.locator("> *").all()) {
38+
await expect(text).toHaveText(this.fileName(proposal.proposalMapPath));
39+
}
3440
}
3541

3642
fileName(path: string): string {

e2e/pages/portal/review-and-submit-page/parcels-section.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ export class ParcelsSection {
3232
}
3333
await expect(this.isFarmText(parcelNumber)).toHaveText(parcel.isFarm ? 'Yes' : 'No');
3434
await expect(this.civicAddressText(parcelNumber)).toHaveText(parcel.civicAddress);
35-
await expect(this.certificateOfTitleText(parcelNumber)).toHaveText(this.fileName(parcel.certificateOfTitlePath));
35+
36+
// Check each child element for certificate of title (mobile/desktop links)
37+
for (const text of await this.certificateOfTitleText(parcelNumber).locator("> *").all()) {
38+
await expect(text).toHaveText(this.fileName(parcel.certificateOfTitlePath));
39+
}
40+
3641
await expect(this.confirmationText(parcelNumber)).toHaveText(parcel.isConfirmed ? 'Yes' : 'No');
3742
}
3843

e2e/pages/portal/review-and-submit-page/tur-proposal-section.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,16 @@ export class TURProposalSection {
3131
await expect(this.alternativeLandText).toHaveText(proposal.alternativeLand);
3232
await expect(this.totalAreaText).toHaveText(`${proposal.totalArea} ha`);
3333
await expect(this.allOwnersNotifiedText).toHaveText(proposal.isConfirmed ? 'Yes' : 'No');
34-
await expect(this.proofOfServingNoticeText).toHaveText(this.fileName(proposal.proofOfServingNoticePath));
35-
await expect(this.proposalMapText).toHaveText(this.fileName(proposal.proposalMapPath));
34+
35+
// Check each child element for proof of serving notice
36+
for (const text of await this.proofOfServingNoticeText.locator("> *").all()) {
37+
await expect(text).toHaveText(this.fileName(proposal.proofOfServingNoticePath));
38+
}
39+
40+
// Check each child element for proposal map
41+
for (const text of await this.proposalMapText.locator("> *").all()) {
42+
await expect(text).toHaveText(this.fileName(proposal.proposalMapPath));
43+
}
3644
}
3745

3846
fileName(path: string): string {

0 commit comments

Comments
 (0)