Add multi browser tests + wabac.js update (#420)

Fidelity: Fix CSP issue with iframes in Firefox (via wabac.js 2.23.0)
Loading: Avoid unnecessary reloads of multiWACZ JSON, prune expired
multiWACZ collections

Testing improvements:
- add playwright multi browser tests with firefox and webkit
- add test of iframe replay with iframetest.wacz

deps: update to wabac.js 2.23.0
bump to 2.3.9
This commit is contained in:
Ilya Kreymer
2025-05-14 21:26:01 -07:00
committed by GitHub
parent 62c30e7838
commit 69983af3a8
11 changed files with 139 additions and 27 deletions
+54 -2
View File
@@ -42,6 +42,42 @@ test("cross-domain embed is loading", async ({ page }) => {
await expect(res).toContainText("Want to help");
});
test("same-domain iframe embed is loading", async ({ page }) => {
await page.goto("http://localhost:9990/iframe-test.html");
const res = page
.locator("replay-web-page")
.frameLocator("iframe")
.locator("replay-app-main wr-item wr-coll-replay")
.frameLocator("iframe")
.locator("body");
await expect(res).toContainText("Outside iframe");
const inside = res.frameLocator("iframe").locator("body");
await expect(inside).toContainText("Inside iframe");
});
test("cross-domain iframe embed is loading", async ({ page }) => {
await page.goto("http://localhost:8020/iframe-test-cross.html");
const res = page
.locator("replay-web-page")
.frameLocator("iframe")
.locator("replay-app-main wr-item wr-coll-replay")
.frameLocator("iframe")
.locator("body");
await expect(res).toContainText("Outside iframe");
const inside = res.frameLocator("iframe").locator("body");
await expect(inside).toContainText("Inside iframe");
});
test("sandbox + cross-domain embed is loading", async ({ page }) => {
await page.goto("http://localhost:8030/");
@@ -73,7 +109,7 @@ test("require subdomain iframe", async ({ page }) => {
);
});
test("csp blocking in place", async ({ page }) => {
test("csp blocking in place", async ({ page }, workerInfo) => {
await page.goto("http://localhost:9990/embed.html");
const frame = page
@@ -114,6 +150,8 @@ test("csp blocking in place", async ({ page }) => {
// (5-6) blocked by csp policy, even though local
block += await blocked(iframe.contentWindow, "http://localhost:9990/sw.js");
// not blocked in FF
block += await blocked(
iframe.contentWindow,
"http://localhost:9990/static/wombat.js",
@@ -122,5 +160,19 @@ test("csp blocking in place", async ({ page }) => {
return block;
});
expect(didNotFetch).toBe(6);
const name = workerInfo.project.name;
switch (name) {
case "chrome":
expect(didNotFetch).toBe(6);
break;
case "firefox":
expect(didNotFetch).toBe(5);
break;
case "webkit":
expect(didNotFetch).toBe(4);
break;
}
});