Skip to content

Commit

Permalink
test(e2e): Ensure section statuses are accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Jul 10, 2024
1 parent b60756d commit 83c2eaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions e2e/tests/ui-driven/src/globalHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export async function expectSections({
const pageSections = page.locator("dl dt");
const pageStatuses = page.locator("dl dd");
await expect(pageSections).toContainText(sections.map((s) => s.title));
// TODO: This is failing
await expect(pageStatuses).toContainText(sections.map((s) => s.status));

Check failure on line 236 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › sections.spec.ts:315:9 › Section statuses › simple save and return › not started

1) [chromium] › sections.spec.ts:315:9 › Section statuses › simple save and return › not started, ready to start and complete statuses Error: expect(locator).toContainText(expected) Locator: locator('dl dd') - Expected - 3 + Received + 3 Array [ - "COMPLETED", - "READY TO START", - "CANNOT START YET", + " The status of this section of the application is:READY TO CONTINUE ", + " The status of this section of the application is:CANNOT START YET ", + " The status of this section of the application is:CANNOT START YET ", ] Call log: - expect.toContainText with timeout 45000ms - waiting for locator('dl dd') - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements at globalHelpers.ts:236 234 | await expect(pageSections).toContainText(sections.map((s) => s.title)); 235 | // TODO: This is failing > 236 | await expect(pageStatuses).toContainText(sections.map((s) => s.status)); | ^ 237 | } 238 | 239 | export async function fillGovUkCardDetails({ at expectSections (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:236:30) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/sections.spec.ts:368:7

Check failure on line 236 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › sections.spec.ts:315:9 › Section statuses › simple save and return › not started

1) [chromium] › sections.spec.ts:315:9 › Section statuses › simple save and return › not started, ready to start and complete statuses Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toContainText(expected) Locator: locator('dl dd') - Expected - 3 + Received + 3 Array [ - "COMPLETED", - "READY TO START", - "CANNOT START YET", + " The status of this section of the application is:READY TO CONTINUE ", + " The status of this section of the application is:CANNOT START YET ", + " The status of this section of the application is:CANNOT START YET ", ] Call log: - expect.toContainText with timeout 45000ms - waiting for locator('dl dd') - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements at globalHelpers.ts:236 234 | await expect(pageSections).toContainText(sections.map((s) => s.title)); 235 | // TODO: This is failing > 236 | await expect(pageStatuses).toContainText(sections.map((s) => s.status)); | ^ 237 | } 238 | 239 | export async function fillGovUkCardDetails({ at expectSections (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:236:30) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/sections.spec.ts:368:7

Check failure on line 236 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › sections.spec.ts:315:9 › Section statuses › simple save and return › not started

1) [chromium] › sections.spec.ts:315:9 › Section statuses › simple save and return › not started, ready to start and complete statuses Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toContainText(expected) Locator: locator('dl dd') - Expected - 3 + Received + 3 Array [ - "COMPLETED", - "READY TO START", - "CANNOT START YET", + " The status of this section of the application is:READY TO CONTINUE ", + " The status of this section of the application is:CANNOT START YET ", + " The status of this section of the application is:CANNOT START YET ", ] Call log: - expect.toContainText with timeout 45000ms - waiting for locator('dl dd') - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements - locator resolved to 3 elements at globalHelpers.ts:236 234 | await expect(pageSections).toContainText(sections.map((s) => s.title)); 235 | // TODO: This is failing > 236 | await expect(pageStatuses).toContainText(sections.map((s) => s.status)); | ^ 237 | } 238 | 239 | export async function fillGovUkCardDetails({ at expectSections (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:236:30) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/sections.spec.ts:368:7
}

Expand Down
1 change: 1 addition & 0 deletions e2e/tests/ui-driven/src/sections.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ test.describe("Section statuses", () => {
});
});

// TODO: Fix me!
test.describe("simple save and return", () => {
test("not started, ready to start and complete statuses", async ({
page,
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ export const previewStore: StateCreator<
});
}
}
updateSectionData();
setCurrentCard();
updateSectionData();
},

resultData(flagSet, overrides) {
Expand Down

0 comments on commit 83c2eaa

Please sign in to comment.