Skip to content

Commit

Permalink
chore: upgrade playwright (#11690)
Browse files Browse the repository at this point in the history
* chore: upgrade playwright

* firefox workaround

* clarify

* format

* try this

* this works for now

* update
  • Loading branch information
benmccann authored Jan 19, 2024
1 parent 961ba2c commit b8d0429
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 56 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 17 additions & 1 deletion packages/kit/test/apps/basics/test/cross-platform/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,29 @@ 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
}) => {
// No idea why the workaround below works only in dev mode
// 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;
}

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();
Expand Down
99 changes: 50 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
"enabled": false
},
"ignoreDeps": [
"@playwright/test",
"@types/node",
"esbuild",
"playwright",
"rollup",
"typescript"
],
Expand Down

0 comments on commit b8d0429

Please sign in to comment.