Skip to content

Commit b98cf81

Browse files
VIA-601 AJ/MD Fix snapshot tests for static page
1 parent b550161 commit b98cf81

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

e2e/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const AppPageDetails: Record<PageName, PageDetails> = {
188188
url: "/assets/static/service-failure.html",
189189
heading: "There is a problem with the service",
190190
title: `There is a problem with the service - ${SERVICE_HEADING} - ${NHS_TITLE_SUFFIX}`,
191-
snapshotFilename: "default-service-failure.png",
191+
snapshotFilename: "default-service-failure-static.png",
192192
},
193193
"not-found": {
194194
url: "/page-does-not-exist",

e2e/snapshot/app.snapshot.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ const testPageSnapshot = async (
1414
) => {
1515
const screenshotPath: string = pathForCustomScreenshots(testFileName, snapshotFileName, projectName);
1616
await page.goto(pageRoute);
17-
await page.getByRole("link", { name: "Log out" }).waitFor();
17+
18+
// wait for specific elements on the page, as they may take longer to load
19+
if (pageRoute !== AppPageDetails["service-failure-static"].url) {
20+
await page.getByRole("link", { name: "Log out" }).waitFor();
21+
}
1822

1923
await openExpandersIfPresent(page);
2024

0 commit comments

Comments
 (0)