playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] opening new windows electron

Open 2BC-Wasabi opened this issue 2 years ago • 2 comments

Context:

  • Playwright Version: 1.24.2]
  • Operating System: Windows 10
  • Node.js version: v16.15.0
  • Browser: Electron
  • Extra: electron react boiler plate
    //this is how i launch the app this is in the before all

    electronApp = await electron.launch({
      executablePath: 'C:\\myApp\\myApp.exe',
    });
    electronApp.on('window', (page) => {
      console.log('another window created');
    });


  test('test record', async () => {
    await SetupWin.locator('button:has-text("Launch")').click();
    //do i need the next line to wait for the second window to launch ?
    await SetupWin.waitForTimeout(10000);
    mywindows = await electronApp.windows();
    console.log(mywindows);
  
  });

so i have a page for setup where the user selects configurations for the next window when he clicks launch i setup the next window and i launch it.

i noticed that when doing so there is only two windows when i expect 3, also the on window event doesn't launch.

interestingly, i have a config file that i use to control things when testing the production app, one of the options is opendevtools, when i set it to true then, everything seems to work still need to test

2BC-Wasabi avatar Aug 08 '22 11:08 2BC-Wasabi

Thanks for your report! Can you please share a link to repo that we can clone and run that exhibits the behavior? This will help us debug faster and ensure we are solving the issue you are facing.

rwoll avatar Aug 08 '22 23:08 rwoll

hi i will try to make a repo and publish it asap.

2BC-Wasabi avatar Aug 09 '22 08:08 2BC-Wasabi

Closing as part of triage per-above. Please file a new issue with the information requested above, and reference this issue.

Thanks!

rwoll avatar Aug 11 '22 22:08 rwoll