Skip to content

Commit ba02f6b

Browse files
authored
chore(e2e): Skip request.url is host when ran locally (opennextjs#970)
* chore(e2e): Skip request.url is host when ran locally * refactor
1 parent fe913bb commit ba02f6b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/tests-e2e/tests/appPagesRouter/host.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { expect, test } from "@playwright/test";
44
* Tests that the request.url is the deployed host and not localhost
55
*/
66
test("Request.url is host", async ({ baseURL, page }) => {
7+
// We skip this test when E2E is run locally with `http` as protocol.
8+
// The cause can be seen here: https://github.com/opennextjs/opennextjs-aws/issues/969#issuecomment-3239569901
9+
test.skip(
10+
(baseURL ?? "").startsWith("http://localhost"),
11+
"Skipping test on localhost",
12+
);
713
await page.goto("/api/host");
814

915
const el = page.getByText(`{"url":"${baseURL}/api/host"}`);

packages/tests-e2e/tests/appRouter/host.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { expect, test } from "@playwright/test";
44
* Tests that the request.url is the deployed host and not localhost
55
*/
66
test("Request.url is host", async ({ baseURL, page }) => {
7+
// We skip this test when E2E is run locally with `http` as protocol.
8+
// The cause can be seen here: https://github.com/opennextjs/opennextjs-aws/issues/969#issuecomment-3239569901
9+
test.skip(
10+
(baseURL ?? "").startsWith("http://localhost"),
11+
"Skipping test on localhost",
12+
);
713
await page.goto("/api/host");
814

915
const el = page.getByText(`{"url":"${baseURL}/api/host"}`);

0 commit comments

Comments
 (0)