playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Question] electron app launch with executablePath timeout, but app already launched

Open monica-xu opened this issue 3 years ago • 1 comments

Context:

  • Playwright Version: 1.16.3
  • Operating System: Windows
  • Node.js version:14
  • Browser: Electron

Code Snippet

const {chromium, webkit, firefox} = require('playwright');

Before({ timeout: 3000000 }, async function(this: World) {
    console.log('before ');
    electronApp = await electron.launch({ args: [path.join(__dirname, '../../../../dist/apps/offline-tool/main.js')], executablePath: path.join(__dirname, '../../../../dist/executables/offline-tool') });
    console.log('after ');
    offlineToolFirstWindow = await electronApp.firstWindow();
});
get error 
  Scenario: check available
before
    × failed
      electron.launch: Timeout 30000ms exceeded.
          at World.<anonymous> (C:\work\CUwebem\trunk\webem\apps\vcu-offline-e2e\src\supports\hooks.ts:54:65)
          at step (C:\work\CUwebem\trunk\webem\apps\vcu-offline-e2e\src\supports\hooks.ts:33:23)
          at Object.next (C:\work\CUwebem\trunk\webem\apps\vcu-offline-e2e\src\supports\hooks.ts:14:53)
          at C:\work\CUwebem\trunk\webem\apps\vcu-offline-e2e\src\supports\hooks.ts:8:71
          at __awaiter (C:\work\CUwebem\trunk\webem\apps\vcu-offline-e2e\src\supports\hooks.ts:4:12)
          at World.<anonymous> (C:\work\CUwebem\trunk\webem\apps\vcu-offline-e2e\src\supports\hooks.ts:49:12)

Describe the bug

our team need to test electronApp.exe by playwright, but use electronApp = await electron.launch({ args: [path.join(__dirname, '../../../../dist/apps/offline-tool/main.js')]}) will test pass, but when use electronApp = await electron.launch({ executablePath: path.join(__dirname, '../../../../dist/executables/offline-tool') }) to test offline-tool.exe will timeout with actually already launched the exe

monica-xu avatar Apr 13 '22 09:04 monica-xu

@aslushnikov what's this progress now?

lswnsn avatar Aug 09 '22 11:08 lswnsn

Same thing happens when specifying recordVideo option

dan-cooke avatar Aug 23 '23 10:08 dan-cooke

What is the update on above?

RajeshKumarMahto avatar Jan 12 '24 09:01 RajeshKumarMahto