Chore: Desktop: Update Playwright, allow debugging Playwright tests from VSCode (#12003)

pull/12004/head
Henry Heino 2025-03-25 04:12:38 -07:00 committed by GitHub
parent baaeea1307
commit 93219575b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 17 deletions

View File

@ -17,6 +17,7 @@ with Playwright:
- [The Playwright ElectronApp docs](https://playwright.dev/docs/api/class-electronapplication)
- [Electron Playwright example repository](https://github.com/spaceagetv/electron-playwright-example)
- [Playwright best practices](https://playwright.dev/docs/best-practices)
- [Running and debugging tests from VSCode](https://playwright.dev/docs/getting-started-vscode#running-tests).
# FAQ
@ -25,3 +26,4 @@ with Playwright:
If Playwright tests are timing out, consider modifying `playwright.config.ts` in the `app-desktop` folder. For example, increase the `timeout` option to `120_000` (2 minutes).
Alternatively, try temporarily disabling `fullyParallel` (which disables running tests in parallel).

View File

@ -1,8 +1,13 @@
import { dirname, resolve } from 'path';
const createStartupArgs = (profileDirectory: string) => {
// Input paths need to be absolute when running from VSCode
const baseDirectory = dirname(dirname(__dirname));
const mainPath = resolve(baseDirectory, 'main.js');
// We need to run with --env dev to disable the single instance check.
return [
'main.js', '--env', 'dev', '--no-welcome', '--profile', profileDirectory,
mainPath, '--env', 'dev', '--no-welcome', '--profile', resolve(profileDirectory),
];
};

View File

@ -134,7 +134,7 @@
"@electron/rebuild": "3.6.0",
"@joplin/default-plugins": "~3.3",
"@joplin/tools": "~3.3",
"@playwright/test": "1.45.3",
"@playwright/test": "1.51.1",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "29.5.12",
"@types/node": "18.19.67",

View File

@ -8279,7 +8279,7 @@ __metadata:
"@joplin/renderer": ~3.3
"@joplin/tools": ~3.3
"@joplin/utils": ~3.3
"@playwright/test": 1.45.3
"@playwright/test": 1.51.1
"@sentry/electron": 4.24.0
"@testing-library/react-hooks": 8.0.1
"@types/jest": 29.5.12
@ -10675,14 +10675,14 @@ __metadata:
languageName: node
linkType: hard
"@playwright/test@npm:1.45.3":
version: 1.45.3
resolution: "@playwright/test@npm:1.45.3"
"@playwright/test@npm:1.51.1":
version: 1.51.1
resolution: "@playwright/test@npm:1.51.1"
dependencies:
playwright: 1.45.3
playwright: 1.51.1
bin:
playwright: cli.js
checksum: 3e2c88d40f98cf94ab7947263804d1ee78c4bb21a35c8dbb64855eed5565ffc688509c5f07bda5438cba6c354374981448dcba3dbe326d1699b4fef75c9ce43d
checksum: c3c14f37451cc0323234e37fa559a075e5aee9f5e6ca06fa3b4a132ec6c809909b22877daca1fa48c95a1112d859346c10111e7003f44582a05100dd5385bbef
languageName: node
linkType: hard
@ -37993,27 +37993,27 @@ __metadata:
languageName: node
linkType: hard
"playwright-core@npm:1.45.3":
version: 1.45.3
resolution: "playwright-core@npm:1.45.3"
"playwright-core@npm:1.51.1":
version: 1.51.1
resolution: "playwright-core@npm:1.51.1"
bin:
playwright-core: cli.js
checksum: cecb58877b2c643403d7a72c24a7aa0fdd087a3c7f9a5ea5403851336ea831d8e304b1f159aacbbabd12e5c47eaac054333746c9e5431ec07b13d64dbf3b50ec
checksum: 1eb37e22e97435a5ed6389b4caa666fbe618348861cae97e67586e20c8fed9ac3d3dc899ff3b9237d0ddfcf087d5b552b80be247e246fc45b75282f96be714bb
languageName: node
linkType: hard
"playwright@npm:1.45.3":
version: 1.45.3
resolution: "playwright@npm:1.45.3"
"playwright@npm:1.51.1":
version: 1.51.1
resolution: "playwright@npm:1.51.1"
dependencies:
fsevents: 2.3.2
playwright-core: 1.45.3
playwright-core: 1.51.1
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: d9d23b155ccd001553214f710561b01e48eb409676102f8ab94c0b4aa5ac5f398becc1a96528b0554944e07e34189503d891913e0e0a4aa58ad36b9c08747983
checksum: 2d78f53eed438d26df9743f98227d2e33bb5a378c8d0144a4ed75b4010c9c517d5a6ee6c1c9245ad61dc615054c5e19d2ded5a6e285e35d2bca39b05bc9c4a35
languageName: node
linkType: hard