From 1bbcb757a47c4a12576ee7ae484a366f0d629c14 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:04:52 -0800 Subject: [PATCH 1/7] chore: upgrade playwright --- package.json | 2 +- packages/adapter-static/package.json | 2 +- packages/create-svelte/package.json | 2 +- packages/kit/package.json | 2 +- pnpm-lock.yaml | 99 ++++++++++++++-------------- renovate.json | 2 - 6 files changed, 54 insertions(+), 55 deletions(-) diff --git a/package.json b/package.json index b28c283f09be..f97bb6d6a6d9 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", "eslint-plugin-unicorn": "^50.0.0", - "playwright": "1.30.0" + "playwright": "^1.41.0" }, "packageManager": "pnpm@8.14.1", "engines": { diff --git a/packages/adapter-static/package.json b/packages/adapter-static/package.json index aa9857815333..68e2351a0654 100644 --- a/packages/adapter-static/package.json +++ b/packages/adapter-static/package.json @@ -30,7 +30,7 @@ "test": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test" }, "devDependencies": { - "@playwright/test": "1.30.0", + "@playwright/test": "^1.41.0", "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^3.0.1", "@types/node": "^18.19.3", diff --git a/packages/create-svelte/package.json b/packages/create-svelte/package.json index 7e1beec273ee..e7fb1a3dc362 100644 --- a/packages/create-svelte/package.json +++ b/packages/create-svelte/package.json @@ -16,7 +16,7 @@ "kleur": "^4.1.5" }, "devDependencies": { - "@playwright/test": "1.30.0", + "@playwright/test": "^1.41.0", "@types/gitignore-parser": "^0.0.3", "gitignore-parser": "^0.0.2", "prettier": "^3.1.1", diff --git a/packages/kit/package.json b/packages/kit/package.json index 8b374eb824c4..9c641f95cc40 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -25,7 +25,7 @@ "tiny-glob": "^0.2.9" }, "devDependencies": { - "@playwright/test": "1.30.0", + "@playwright/test": "^1.41.0", "@sveltejs/vite-plugin-svelte": "^3.0.1", "@types/connect": "^3.4.38", "@types/node": "^18.19.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bed64323f968..f538945982b9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ^50.0.0 version: 50.0.1(eslint@8.56.0) playwright: - specifier: 1.30.0 - version: 1.30.0 + specifier: ^1.41.0 + version: 1.41.0 packages/adapter-auto: dependencies: @@ -197,8 +197,8 @@ importers: packages/adapter-static: devDependencies: '@playwright/test': - specifier: 1.30.0 - version: 1.30.0 + specifier: ^1.41.0 + version: 1.41.0 '@sveltejs/kit': specifier: workspace:^ version: link:../kit @@ -289,7 +289,7 @@ importers: dependencies: '@sveltejs/kit': specifier: ^1.0.0 || ^2.0.0 - version: 2.3.5(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11) + version: link:../kit packages/create-svelte: dependencies: @@ -301,8 +301,8 @@ importers: version: 4.1.5 devDependencies: '@playwright/test': - specifier: 1.30.0 - version: 1.30.0 + specifier: ^1.41.0 + version: 1.41.0 '@types/gitignore-parser': specifier: ^0.0.3 version: 0.0.3 @@ -442,8 +442,8 @@ importers: version: 0.2.9 devDependencies: '@playwright/test': - specifier: 1.30.0 - version: 1.30.0 + specifier: ^1.41.0 + version: 1.41.0 '@sveltejs/vite-plugin-svelte': specifier: ^3.0.1 version: 3.0.1(svelte@4.2.8)(vite@5.0.11) @@ -2119,13 +2119,12 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@playwright/test@1.30.0: - resolution: {integrity: sha512-SVxkQw1xvn/Wk/EvBnqWIq6NLo1AppwbYOjNLmyU0R1RoQ3rLEBtmjTnElcnz8VEtn11fptj1ECxK0tgURhajw==} - engines: {node: '>=14'} + /@playwright/test@1.41.0: + resolution: {integrity: sha512-Grvzj841THwtpBOrfiHOeYTJQxDRnKofMSzCiV8XeyLWu3o89qftQ4BCKfkziJhSUQRd0utKhrddtIsiraIwmw==} + engines: {node: '>=16'} hasBin: true dependencies: - '@types/node': 18.19.3 - playwright-core: 1.30.0 + playwright: 1.41.0 dev: true /@polka/url@1.0.0-next.24: @@ -2314,33 +2313,6 @@ packages: typescript: 5.3.3 dev: true - /@sveltejs/kit@2.3.5(@sveltejs/vite-plugin-svelte@3.0.1)(svelte@4.2.8)(vite@5.0.11): - resolution: {integrity: sha512-Vu+ckGQu/t+pcuueryaHYacgoYsYq6KB1k1p4w1xDp1eQ2aYz3POcx3GSuqxWjJfOwMMM83xiuAnDWBKyOn1Tg==} - engines: {node: '>=18.13'} - hasBin: true - requiresBuild: true - peerDependencies: - '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 - vite: ^5.0.3 - dependencies: - '@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.2.8)(vite@5.0.11) - '@types/cookie': 0.6.0 - cookie: 0.6.0 - devalue: 4.3.2 - esm-env: 1.0.0 - import-meta-resolve: 4.0.0 - kleur: 4.1.5 - magic-string: 0.30.5 - mrmime: 2.0.0 - sade: 1.8.1 - set-cookie-parser: 2.6.0 - sirv: 2.0.4 - svelte: 4.2.8 - tiny-glob: 0.2.9 - vite: 5.0.11(@types/node@18.19.3)(lightningcss@1.22.1) - dev: false - /@sveltejs/site-kit@6.0.0-next.59(@sveltejs/kit@packages+kit)(svelte@4.2.8): resolution: {integrity: sha512-nAUCuunhN0DmurQBxbsauqvdvv4mL0F/Aluxq0hFf6gB3iSn9WdaUZdPMXoujy+8cy+m6UvKuyhkgApZhmOLvw==} peerDependencies: @@ -2367,6 +2339,7 @@ packages: vite: 5.0.11(@types/node@18.19.3)(lightningcss@1.22.1) transitivePeerDependencies: - supports-color + dev: true /@sveltejs/vite-plugin-svelte@3.0.1(svelte@4.2.8)(vite@5.0.11): resolution: {integrity: sha512-CGURX6Ps+TkOovK6xV+Y2rn8JKa8ZPUHPZ/NKgCxAmgBrXReavzFl8aOSCj3kQ1xqT7yGJj53hjcV/gqwDAaWA==} @@ -2386,6 +2359,7 @@ packages: vitefu: 0.2.5(vite@5.0.11) transitivePeerDependencies: - supports-color + dev: true /@svitejs/changesets-changelog-github-compact@1.1.0: resolution: {integrity: sha512-qhUGGDHcpbY2zpjW3SwqchuW8J/5EzlPFud7xNntHKA7f3a/mx5+g+ruJKFHSAiVZYo30PALt+AyhmPUNKH/Og==} @@ -2457,6 +2431,7 @@ packages: resolution: {integrity: sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==} dependencies: undici-types: 5.26.5 + dev: true /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -3375,6 +3350,7 @@ packages: resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} engines: {node: '>=0.10'} hasBin: true + dev: true /detect-libc@2.0.2: resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} @@ -3917,6 +3893,14 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + /fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -4537,6 +4521,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /lightningcss-darwin-x64@1.22.1: @@ -4545,6 +4530,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /lightningcss-freebsd-x64@1.22.1: @@ -4553,6 +4539,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true optional: true /lightningcss-linux-arm-gnueabihf@1.22.1: @@ -4561,6 +4548,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /lightningcss-linux-arm64-gnu@1.22.1: @@ -4569,6 +4557,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /lightningcss-linux-arm64-musl@1.22.1: @@ -4577,6 +4566,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /lightningcss-linux-x64-gnu@1.22.1: @@ -4585,6 +4575,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /lightningcss-linux-x64-musl@1.22.1: @@ -4593,6 +4584,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /lightningcss-win32-x64-msvc@1.22.1: @@ -4601,6 +4593,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /lightningcss@1.22.1: @@ -4618,6 +4611,7 @@ packages: lightningcss-linux-x64-gnu: 1.22.1 lightningcss-linux-x64-musl: 1.22.1 lightningcss-win32-x64-msvc: 1.22.1 + dev: true /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} @@ -4899,6 +4893,7 @@ packages: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + dev: true /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -5201,19 +5196,20 @@ packages: pathe: 1.1.2 dev: true - /playwright-core@1.30.0: - resolution: {integrity: sha512-7AnRmTCf+GVYhHbLJsGUtskWTE33SwMZkybJ0v6rqR1boxq2x36U7p1vDRV7HO2IwTZgmycracLxPEJI49wu4g==} - engines: {node: '>=14'} + /playwright-core@1.41.0: + resolution: {integrity: sha512-UGKASUhXmvqm2Lxa1fNr8sFwAtqjpgBRr9jQ7XBI8Rn5uFiEowGUGwrruUQsVPIom4bk7Lt+oLGpXobnXzrBIw==} + engines: {node: '>=16'} hasBin: true dev: true - /playwright@1.30.0: - resolution: {integrity: sha512-ENbW5o75HYB3YhnMTKJLTErIBExrSlX2ZZ1C/FzmHjUYIfxj/UnI+DWpQr992m+OQVSg0rCExAOlRwB+x+yyIg==} - engines: {node: '>=14'} + /playwright@1.41.0: + resolution: {integrity: sha512-XOsfl5ZtAik/T9oek4V0jAypNlaCNzuKOwVhqhgYT3os6kH34PzbRb74F0VWcLYa5WFdnmxl7qyAHBXvPv7lqQ==} + engines: {node: '>=16'} hasBin: true - requiresBuild: true dependencies: - playwright-core: 1.30.0 + playwright-core: 1.41.0 + optionalDependencies: + fsevents: 2.3.2 dev: true /pluralize@8.0.0: @@ -5288,6 +5284,7 @@ packages: nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 + dev: true /preferred-pm@3.1.2: resolution: {integrity: sha512-nk7dKrcW8hfCZ4H6klWcdRknBOXWzNQByJ0oJyX97BOupsYD+FzLS4hflgEu/uPUEHZCuRfMxzCBsuWd7OzT8Q==} @@ -5986,6 +5983,7 @@ packages: svelte: ^3.19.0 || ^4.0.0 dependencies: svelte: 4.2.8 + dev: true /svelte-local-storage-store@0.6.4(svelte@4.2.8): resolution: {integrity: sha512-45WoY2vSGPQM1sIQJ9jTkPPj20hYeqm+af6mUGRFSPP5WglZf36YYoZqwmZZ8Dt/2SU8lem+BTA8/Z/8TkqNLg==} @@ -6323,6 +6321,7 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} @@ -6446,6 +6445,7 @@ packages: rollup: 4.9.5 optionalDependencies: fsevents: 2.3.3 + dev: true /vitefu@0.2.5(vite@5.0.11): resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} @@ -6456,6 +6456,7 @@ packages: optional: true dependencies: vite: 5.0.11(@types/node@18.19.3)(lightningcss@1.22.1) + dev: true /vitest@1.2.0(@types/node@18.19.3)(lightningcss@1.22.1): resolution: {integrity: sha512-Ixs5m7BjqvLHXcibkzKRQUvD/XLw0E3rvqaCMlrm/0LMsA0309ZqYvTlPzkhh81VlEyVZXFlwWnkhb6/UMtcaQ==} diff --git a/renovate.json b/renovate.json index ca68a4d66245..1131556abb02 100644 --- a/renovate.json +++ b/renovate.json @@ -10,10 +10,8 @@ "enabled": false }, "ignoreDeps": [ - "@playwright/test", "@types/node", "esbuild", - "playwright", "rollup", "typescript" ], From 96ea4e3203fef5d4bf94c15a4490f38403efbb61 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:22:31 -0800 Subject: [PATCH 2/7] firefox workaround --- .../test/apps/basics/test/cross-platform/client.test.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/kit/test/apps/basics/test/cross-platform/client.test.js b/packages/kit/test/apps/basics/test/cross-platform/client.test.js index 804b4f06d4cd..867b88939ce5 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/client.test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/client.test.js @@ -106,7 +106,7 @@ test.describe('a11y', () => { await page.goto('/accessibility/autofocus/a'); await clicknav('[href="/"]'); - expect(await page.evaluate(() => (window.active || {}).nodeName)).toBe('BODY'); + expect(await page.evaluate(() => (globalThis.active || {}).nodeName)).toBe('BODY'); expect(await page.evaluate(() => (document.activeElement || {}).nodeName)).toBe('BODY'); }); }); @@ -417,13 +417,18 @@ test.describe('Scrolling', () => { await expect(page.locator('input')).toBeFocused(); }); - test('scroll positions are recovered on reloading the page', async ({ page, app }) => { + test('scroll positions are recovered on reloading the page', async ({ page, app, browserName }) => { await page.goto('/anchor'); await page.evaluate(() => window.scrollTo(0, 1000)); await app.goto('/anchor/anchor'); await page.evaluate(() => window.scrollTo(0, 1000)); await page.reload(); + if (browserName === 'firefox') { + // Firefox pushed new history entry history after reload + // See https://github.com/microsoft/playwright/issues/22640 + await page.goBack() + } expect(await page.evaluate(() => window.scrollY)).toBe(1000); await page.goBack(); From d607c870cf3353105751418fd63868782a3afd4f Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:23:07 -0800 Subject: [PATCH 3/7] clarify --- .../kit/test/apps/basics/test/cross-platform/client.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kit/test/apps/basics/test/cross-platform/client.test.js b/packages/kit/test/apps/basics/test/cross-platform/client.test.js index 867b88939ce5..4195365db302 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/client.test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/client.test.js @@ -425,7 +425,7 @@ test.describe('Scrolling', () => { await page.reload(); if (browserName === 'firefox') { - // Firefox pushed new history entry history after reload + // Firefox with Playwright pushed new history entry history after reload // See https://github.com/microsoft/playwright/issues/22640 await page.goBack() } From b592779434ae5e6d1cb7a7e976120d30300dd453 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:25:10 -0800 Subject: [PATCH 4/7] format --- .../apps/basics/test/cross-platform/client.test.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/kit/test/apps/basics/test/cross-platform/client.test.js b/packages/kit/test/apps/basics/test/cross-platform/client.test.js index 4195365db302..fb152d91faf8 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/client.test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/client.test.js @@ -417,17 +417,21 @@ test.describe('Scrolling', () => { await expect(page.locator('input')).toBeFocused(); }); - test('scroll positions are recovered on reloading the page', async ({ page, app, browserName }) => { + test('scroll positions are recovered on reloading the page', async ({ + page, + app, + browserName + }) => { await page.goto('/anchor'); await page.evaluate(() => window.scrollTo(0, 1000)); await app.goto('/anchor/anchor'); await page.evaluate(() => window.scrollTo(0, 1000)); await page.reload(); - if (browserName === 'firefox') { + if (browserName === 'firefox') { // Firefox with Playwright pushed new history entry history after reload // See https://github.com/microsoft/playwright/issues/22640 - await page.goBack() + await page.goBack(); } expect(await page.evaluate(() => window.scrollY)).toBe(1000); From 2e169a331b254613d327f4c5931fde06ab866780 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 12:57:06 -0800 Subject: [PATCH 5/7] try this --- .../apps/basics/test/cross-platform/client.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/kit/test/apps/basics/test/cross-platform/client.test.js b/packages/kit/test/apps/basics/test/cross-platform/client.test.js index fb152d91faf8..e913e400ac60 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/client.test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/client.test.js @@ -106,7 +106,7 @@ test.describe('a11y', () => { await page.goto('/accessibility/autofocus/a'); await clicknav('[href="/"]'); - expect(await page.evaluate(() => (globalThis.active || {}).nodeName)).toBe('BODY'); + expect(await page.evaluate(() => (window.active || {}).nodeName)).toBe('BODY'); expect(await page.evaluate(() => (document.activeElement || {}).nodeName)).toBe('BODY'); }); }); @@ -422,17 +422,18 @@ test.describe('Scrolling', () => { app, browserName }) => { + if (browserName === 'firefox') { + // Firefox with Playwright pushes new history entry history after reload + // See https://github.com/microsoft/playwright/issues/22640 + return; + } + await page.goto('/anchor'); await page.evaluate(() => window.scrollTo(0, 1000)); await app.goto('/anchor/anchor'); await page.evaluate(() => window.scrollTo(0, 1000)); await page.reload(); - if (browserName === 'firefox') { - // Firefox with Playwright pushed new history entry history after reload - // See https://github.com/microsoft/playwright/issues/22640 - await page.goBack(); - } expect(await page.evaluate(() => window.scrollY)).toBe(1000); await page.goBack(); From a4a73b599c0c5b344b3072e7c8adf29d804c7963 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:08:11 -0800 Subject: [PATCH 6/7] this works for now --- .../apps/basics/test/cross-platform/client.test.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/kit/test/apps/basics/test/cross-platform/client.test.js b/packages/kit/test/apps/basics/test/cross-platform/client.test.js index e913e400ac60..4fab633ab97b 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/client.test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/client.test.js @@ -422,9 +422,11 @@ test.describe('Scrolling', () => { app, browserName }) => { - if (browserName === 'firefox') { - // Firefox with Playwright pushes new history entry history after reload - // See https://github.com/microsoft/playwright/issues/22640 + // No idea why the workaround below works only in dev mode + // Firefox needs to fix their shit + // We could probably also work around it by setting fission.webContentIsolationStrategy: 1 + // in the Firefox preferences but I'm not quite sure how to do that + if (!process.env.DEV && browserName === 'firefox') { return; } @@ -434,6 +436,11 @@ test.describe('Scrolling', () => { await page.evaluate(() => window.scrollTo(0, 1000)); await page.reload(); + if (process.env.DEV && browserName === 'firefox') { + // Firefox with Playwright pushed new history entry history after reload + // See https://github.com/microsoft/playwright/issues/22640 + await page.goBack(); + } expect(await page.evaluate(() => window.scrollY)).toBe(1000); await page.goBack(); From f9b53caaa7d2f81c5851a591388581c7c3573fdf Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:16:33 -0800 Subject: [PATCH 7/7] update --- .../test/apps/basics/test/cross-platform/client.test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/kit/test/apps/basics/test/cross-platform/client.test.js b/packages/kit/test/apps/basics/test/cross-platform/client.test.js index 4fab633ab97b..7bda137157dc 100644 --- a/packages/kit/test/apps/basics/test/cross-platform/client.test.js +++ b/packages/kit/test/apps/basics/test/cross-platform/client.test.js @@ -423,9 +423,8 @@ test.describe('Scrolling', () => { browserName }) => { // No idea why the workaround below works only in dev mode - // Firefox needs to fix their shit - // We could probably also work around it by setting fission.webContentIsolationStrategy: 1 - // in the Firefox preferences but I'm not quite sure how to do that + // A better solution would probably be to set fission.webContentIsolationStrategy: 1 + // in the Firefox preferences but the Playwright API to do so is incomprehensible if (!process.env.DEV && browserName === 'firefox') { return; } @@ -436,7 +435,7 @@ test.describe('Scrolling', () => { await page.evaluate(() => window.scrollTo(0, 1000)); await page.reload(); - if (process.env.DEV && browserName === 'firefox') { + if (browserName === 'firefox') { // Firefox with Playwright pushed new history entry history after reload // See https://github.com/microsoft/playwright/issues/22640 await page.goBack();