Skip to content

Commit 2ddeb17

Browse files
only run the ssr test
1 parent edaca3e commit 2ddeb17

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// NOTE: loading.tsx is currently broken on open - next
2+
// This works locally but not on deployed apps
3+
4+
import { expect, test } from "@playwright/test";
5+
6+
// NOTE: We don't await page load b/c we want to see the Loading page
7+
// loading.tsx doesn't currently work: https://github.com/opennextjs/opennextjs-cloudflare/issues/313
8+
test.skip("Server Side Render and loading.tsx", async ({ page }) => {
9+
test.setTimeout(600000);
10+
await page.goto("/");
11+
await page.getByRole("link", { name: "SSR" }).click();
12+
await page.waitForURL("/ssr");
13+
14+
let loading: any;
15+
let lastTime = "";
16+
17+
for (let i = 0; i < 5; i++) {
18+
void page.reload();
19+
20+
loading = page.getByText("Loading...");
21+
await expect(loading).toBeVisible();
22+
const el = page.getByText("Time:");
23+
await expect(el).toBeVisible();
24+
const time = await el.textContent();
25+
expect(time).not.toEqual(lastTime);
26+
lastTime = time!;
27+
await page.waitForTimeout(1000);
28+
}
29+
});
30+
31+
test("Fetch cache properly cached", async ({ page }) => {
32+
await page.goto("/ssr");
33+
const originalDate = await page.getByText("Cached fetch:").textContent();
34+
await page.waitForTimeout(2000);
35+
await page.reload();
36+
const newDate = await page.getByText("Cached fetch:").textContent();
37+
expect(originalDate).toEqual(newDate);
38+
});

examples/e2e/app-router/e2e/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ declare const process: typeof nodeProcess;
77
* See https://playwright.dev/docs/test-configuration.
88
*/
99
export default defineConfig({
10-
testDir: "./",
10+
testDir: "./only",
1111
/* Run tests in files in parallel */
1212
fullyParallel: true,
1313
/* Fail the build on CI if you accidentally left test.only in the source code. */

0 commit comments

Comments
 (0)