Bring back Playwright-Electron Workbench's on-failure screenshot + new PLAYWRIGHT_RECORD_VIDEO (#5464)

* Fix playwright-electron screenshots on failure and add PLAYWRIGHT_RECORD_VIDEO

* yarn tsc
This commit is contained in:
49fl
2025-02-24 13:09:39 -05:00
committed by GitHub
parent 77fbb68419
commit fa9e6ccea9
3 changed files with 32 additions and 12 deletions

View File

@ -937,11 +937,16 @@ export async function setupElectron({
testInfo,
cleanProjectDir = true,
appSettings,
viewport,
}: {
testInfo: TestInfo
folderSetupFn?: (projectDirName: string) => Promise<void>
cleanProjectDir?: boolean
appSettings?: Partial<SaveSettingsPayload>
viewport: {
width: number
height: number
}
}): Promise<{
electronApp: ElectronApplication
context: BrowserContext
@ -972,6 +977,14 @@ export async function setupElectron({
...(process.env.ELECTRON_OVERRIDE_DIST_PATH
? { executablePath: process.env.ELECTRON_OVERRIDE_DIST_PATH + 'electron' }
: {}),
...(process.env.PLAYWRIGHT_RECORD_VIDEO
? {
recordVideo: {
dir: testInfo.snapshotPath(),
size: viewport,
},
}
: {}),
}
// Do this once and then reuse window on subsequent calls.