mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 09:15:41 +03:00
Test for lack of WebAssembly support (#12792)
* Test for lack of WebAssembly support * Good news: the 'only' detection works
This commit is contained in:
parent
564ea53b83
commit
2920e76b64
2 changed files with 15 additions and 0 deletions
|
@ -20,8 +20,23 @@ test(`shows error page if browser lacks Intl support`, async ({ page }) => {
|
|||
await page.addInitScript({ content: `delete window.Intl;` });
|
||||
await page.goto("/");
|
||||
|
||||
// Lack of Intl support causes the app bundle to fail to load, so we get the iframed
|
||||
// static error page and need to explicitly look in the iframe becuse Playwright doesn't
|
||||
// recurse into iframes when looking for elements
|
||||
const header = await page.frameLocator("iframe").getByText("Unsupported browser");
|
||||
await expect(header).toBeVisible();
|
||||
|
||||
await expect(page).toMatchScreenshot("unsupported-browser.png");
|
||||
});
|
||||
|
||||
test(`shows error page if browser lacks WebAssembly support`, async ({ page }) => {
|
||||
await page.addInitScript({ content: `delete window.WebAssembly;` });
|
||||
await page.goto("/");
|
||||
|
||||
// Lack of WebAssembly support doesn't cause the bundle to fail loading, so we get
|
||||
// CompatibilityView, ie. no iframes.
|
||||
const header = await page.getByText("Unsupported browser");
|
||||
await expect(header).toBeVisible();
|
||||
|
||||
await expect(page).toMatchScreenshot("unsupported-browser-CompatibilityView.png");
|
||||
});
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 69 KiB |
Loading…
Reference in a new issue