Closed GozaRuu closed 11 months ago
Any chance you can share a test script or a reduced test case?
This is how we start it:
this.app = await electron.launch(String(electronPath), {
args: [
join(__dirname, 'main.js'),
`--user-data-dir=${tempDir.path}`,
'--no-sandbox',
'--whitelisted-ips',
'--enable-logging',
'--ignore-certificate-errors',
'--ignore-ssl-errors',
'--disable-dev-shm-usage',
],
env: {
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,
NODE_ENV: 'test',
IS_RELEASE: this.appParams.isRelease || '',
},
})
It happens randomly on almost any tests even simple ones like:
const electronBrowser = await playwright.firstWindow().browserWindow
const {
isMinimized,
isDevToolsOpened,
isEnabled,
height,
width,
isLoading,
title,
} = await electronBrowser.evaluate((browserWindow: BrowserWindow) => {
return {
isMinimized: browserWindow.isMinimized(),
isDevToolsOpened: browserWindow.webContents.isDevToolsOpened(),
isEnabled: browserWindow.isEnabled(),
...browserWindow.getBounds(),
isLoading: browserWindow.webContents.isLoading(),
title: browserWindow.title,
}
})
expect(isMinimized).toBe(false)
expect(isDevToolsOpened).toBe(false)
expect(isEnabled).toBe(true)
expect(width).toBeGreaterThan(0)
expect(height).toBeGreaterThan(0)
expect(isLoading).toBe(false)
expect(title).toBe('Private App Name')
const page = await playwright.getMainPage()
expect(await page.title()).toBe('Private App Name')
expect(await page.$('#app')).not.toBeNull()
Maybe the issue is solved in the browser playwright? if so maybe releasing a new version can solve the issue
I have this same issue in my Electron app tested with playwright. In our project when we have added native-dependency to register SIP services in the app before login the app started dying prematurely on Windows OS. I feel it's the same issue what's described above. Solution to this would be highly appreciated. Thanks
is it resolved ?
any fix?
Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.
Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.
Context:
Error in closing the Electron App prematurely by Playwright:
It happens randomly causing a lot of flakiness in the tests. As a workaround, I'm no longer closing the app in the
after each
hook. Instead I let all the tests run and close them inafter all
with akillall
cmd which causes a range of other problems like bubbling errors of failed calls to non existing objects: