Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2920e76

Browse files
authored
Test for lack of WebAssembly support (#12792)
* Test for lack of WebAssembly support * Good news: the 'only' detection works
1 parent 564ea53 commit 2920e76

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

playwright/e2e/app-loading/feature-detection.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,23 @@ test(`shows error page if browser lacks Intl support`, async ({ page }) => {
2020
await page.addInitScript({ content: `delete window.Intl;` });
2121
await page.goto("/");
2222

23+
// Lack of Intl support causes the app bundle to fail to load, so we get the iframed
24+
// static error page and need to explicitly look in the iframe becuse Playwright doesn't
25+
// recurse into iframes when looking for elements
2326
const header = await page.frameLocator("iframe").getByText("Unsupported browser");
2427
await expect(header).toBeVisible();
2528

2629
await expect(page).toMatchScreenshot("unsupported-browser.png");
2730
});
31+
32+
test(`shows error page if browser lacks WebAssembly support`, async ({ page }) => {
33+
await page.addInitScript({ content: `delete window.WebAssembly;` });
34+
await page.goto("/");
35+
36+
// Lack of WebAssembly support doesn't cause the bundle to fail loading, so we get
37+
// CompatibilityView, ie. no iframes.
38+
const header = await page.getByText("Unsupported browser");
39+
await expect(header).toBeVisible();
40+
41+
await expect(page).toMatchScreenshot("unsupported-browser-CompatibilityView.png");
42+
});
68.9 KB
Loading

0 commit comments

Comments
 (0)