microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.79k stars 3.58k forks source link

[BUG]use playwright open electron app the server report can't find module? #28872

Closed SnoopCorleone closed 8 months ago

SnoopCorleone commented 8 months ago

System info

Why does opening the Electron app work normally, but when I try to open it using Playwright, it reports an error? The funny thing is, when I refresh the window, it runs normally.

Source code

[Run the test] ···· async initApp(){ this.electronApp = await _electron.launch( {executablePath: "D:\software\EasiCapsule\EasiCapsule\EasiCapsule.exe"}); // Get the first window that the app opens, wait if necessary. await this.electronApp.waitForEvent("window",{timeout:this.actionTimeOut}); await this.listenWindows() console.log("init capsule app server") } ····

[server report erro code ]

import { getLogger } from '@src/common/utils/log';
import { LoggerSentryNameSpace } from '@src/plugins/sentry/types';
const win32Api = require(winUtil.replace('/@fs/', ''));

The win32Api file is called 'winUtils.ddb632b6.node

errorcode
mxschmitt commented 8 months ago

Would it be possible to share a minimal self contained reproducible? Otherwise we are unfortunately not able to triage this issue further.

SnoopCorleone commented 8 months ago

Ok,The download URL for the app is https://capsule.seewo.com. Thank you

mxschmitt commented 8 months ago

Would it be possible to create a smaller repro without any external third party dependencies? We unfortunately don't have the capacity to look into large codebases or programs. (minified makes it harder as well)

In this case something like electron-quickstart with modifications, expected and actual outcome would be very helpful in order to triage this issue further.

SnoopCorleone commented 8 months ago

thanks ,we try to package the demo and replace you later

mxschmitt commented 8 months ago

I'll close it in the meantime as part of the triage process. Feel free to re-file with a repro, thanks!