question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] electronApp.firstWindow never returns any windows

See original GitHub issue

Context:

  • Playwright Version: 1.21.0
  • Operating System: Mac
  • Node.js version: 16.5
  • Browser: Electron

Code Snippet

import { _electron as electron } from 'playwright';
import { test } from '@playwright/test';

test('Launch electron app', async () => {
	const electronApp = await electron.launch({ args: ['out/mac/MyApp.app/Contents/Resources/app.asar/dist/main/index.cjs'], executablePath: './out/mac/MyApp.app/Contents/MacOS/MyApp' });
	const window = await electronApp.firstWindow();
	console.log(await window.title());
	await electronApp.close();
});

Describe the bug

await electronApp.firstWindow never resolves with the window even though the window is indeed open

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aslushnikovcommented, Apr 18, 2022

@ahadcove no ideas. I’d recommend slowly iterating from a basic working app towards your complicated non-working to find out the culprit.

0reactions
ahadcovecommented, Apr 18, 2022

@aslushnikov i still haven’t been able to reproduce this on a repo outside of mine. Any idea why playwright wouldn’t be able to see the app opening a window when the app is signed and packaged?

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Starts and Stops Immediately Without Launching Window ...
I'm using the latest version of electron quick start, and ignore-scripts is set to false. I don't have Vue devtools, and I've never...
Read more >
Electron Window does not open, but doesn't show any errors
When I try running my electron app, I receive no errors and it seems like it compiles, but the electron window does not...
Read more >
app | Electron
Returns : event Event. Emitted when all windows have been closed and the application will quit. Calling event.preventDefault() will prevent the default ...
Read more >
Running Fully Automated E2E Tests in Electron in a Docker ...
electronApp = await _electron.launch({ ... The common-setup.ts file is a base for all our tests. ... expect(windows.length).to.equal(1);.
Read more >
ElectronApplication | Playwright - CukeTest
getAppPath(); }); console.log(appPath); // Get the first window that the app opens, wait if necessary. const window = await electronApp.firstWindow() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found