spaceagetv / electron-playwright-example

Example of multi-window Playwright testing with Electron
MIT License
79 stars 8 forks source link

How to test with electron-builder ? #6

Closed andirsun closed 2 years ago

andirsun commented 2 years ago

I want to use this example and helpers with electron-buider.

jjeff commented 2 years ago

I have not used electron-builder before, but this project actually runs the Playwright tests against the packaged Electron application (in the "out" directory), so the tests should still work with an electron-builder workflow.

If you want to fork this project and create an electron-builder version, I will happily link to it and/or include instructions in this project.

2BC-Wasabi commented 2 years ago

you have a few options i didn't run full tests on this but in the helpers you need to change a line, from const outDir = path.join(rootDir,'out'); to const outDir = path.join(rootDir, 'release', 'build');

don't forget to build the app before starting the test.

second option that i'm using is, install the app then electronApp = await electron.launch({ executablePath: 'C:\path\To\app.exe, }); i'm only developing for windows i don't know about other platforms.