spaceagetv / electron-playwright-example

Example of multi-window Playwright testing with Electron
MIT License
82 stars 9 forks source link

Feature/add linux support #4

Closed jeremymreed closed 2 years ago

jeremymreed commented 2 years ago

Hi, this PR is a start at adding Linux support.

Currently it works for the case where an asar file is generated, but I'm not 100% sure what do do in the case where an asar file isn't generated.

Could you take a look at this and see what you think? This builds, runs, and passes all tests on my machine. I've only run tests for the asar case. It'll throw an exception in the non-asar case at this point.

When I ran npm install, I was left with an updated package-lock.json file. Let me know if this is alright.

Thanks!

jjeff commented 2 years ago

Oh, this is great! Thank you so much. I'll try to test this and get in asap.

Yeah, the package-lock probably changed because we have different versions of Node/NPM. I should probably just remove it from the repository.

jeremymreed commented 2 years ago

No problem!

I can update the PR to more closely match the code style used in the rest of this project.

jjeff commented 2 years ago

I cleaned things up a little… and made some assumptions that (UNIX-based) Linux follows the same conventions as (UNIX-based) MacOS for the non-asar packages.

Thanks for the code!

BTW, I've been thinking about breaking out the electron-playwright-helper functions into a separate repository, with a proper npm release. It seems like these functions would be a helpful add-on for anyone using Playwright with Electron.

jeremymreed commented 2 years ago

You're welcome!

That sounds pretty interesting, that code is useful for getting playwright set up on multiple platforms. :)

Take care.