Skip to content

Commit d0c3c54

Browse files
committed
fix(website): ensure pages are loaded for e2e tests
1 parent c8b7acf commit d0c3c54

5 files changed

Lines changed: 7 additions & 10 deletions

File tree

website/playwright.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ export default defineConfig({
2828
/* Base URL to use in actions like `await page.goto('')`. */
2929
baseURL: "http://127.0.0.1:4321",
3030

31-
/* Don't wait for all resources */
32-
waitUntil: "domcontentloaded",
33-
3431
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3532
trace: "on-first-retry",
3633
},

website/tests/about.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";
22

33
test.describe("About page", () => {
44
test.beforeEach(async ({ page }) => {
5-
await page.goto("/");
5+
await page.goto("/", { waitUntil: "domcontentloaded" });
66
});
77

88
test("renders hero and install section", async ({ page }) => {

website/tests/navigation.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";
22

33
test.describe("Page navigation", () => {
44
test("navigates to demo page via link", async ({ page }) => {
5-
await page.goto("/");
5+
await page.goto("/", { waitUntil: "domcontentloaded" });
66
await page
77
.locator('a.button, a[href*="demo"], .demo-link a')
88
.first()
@@ -11,22 +11,22 @@ test.describe("Page navigation", () => {
1111
});
1212

1313
test("navigates back to main page from demo", async ({ page }) => {
14-
await page.goto("/demo");
14+
await page.goto("/demo", { waitUntil: "domcontentloaded" });
1515
await page.locator(".t-prompt").waitFor();
1616
await page.locator("a.nav-back").click();
1717
await page.waitForURL("/");
1818
await expect(page.locator("#about")).toBeVisible();
1919
});
2020

2121
test("direct navigation to /demo shows demo view", async ({ page }) => {
22-
await page.goto("/demo");
22+
await page.goto("/demo", { waitUntil: "domcontentloaded" });
2323
await expect(page.locator("#demo-view")).toBeVisible();
2424
});
2525
});
2626

2727
test.describe("Sidebar", () => {
2828
test.beforeEach(async ({ page }) => {
29-
await page.goto("/demo");
29+
await page.goto("/demo", { waitUntil: "domcontentloaded" });
3030
await page.locator(".t-prompt").waitFor();
3131
});
3232

website/tests/picker.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";
22

33
test.describe("Interactive picker", () => {
44
test.beforeEach(async ({ page }) => {
5-
await page.goto("/demo");
5+
await page.goto("/demo", { waitUntil: "domcontentloaded" });
66
await page.locator(".t-prompt").waitFor();
77
await page.locator("#terminal-input").focus();
88
await page.keyboard.type("hdi");

website/tests/terminal.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";
22

33
test.describe("Terminal simulator", () => {
44
test.beforeEach(async ({ page }) => {
5-
await page.goto("/demo");
5+
await page.goto("/demo", { waitUntil: "domcontentloaded" });
66
await page.locator(".t-prompt").waitFor();
77
await page.locator("#terminal-input").focus();
88
});

0 commit comments

Comments
 (0)