Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop spectron use #409

Closed
vladimiry opened this issue Jun 3, 2021 · 1 comment
Closed

Drop spectron use #409

vladimiry opened this issue Jun 3, 2021 · 1 comment
Labels

Comments

@vladimiry
Copy link
Owner

spectron is going to stop working since @electron v14 as it still depends on remote thing (being currently deprecated in @electron and will be removed since v14). The spectron seems to be getting into the unmaintained mode soon.

I know there is at least playwright testing framework that supports @electron to some extent. But a more forward-thinking way is to go framework-less:

  • Implementing the web testing steps in an e2e-specific preload script that doesn't come into the production build. Similarly for the main process part. Splitting e2e-specific code is easy to do since we already use @webpack and injected BUILD_ENVIRONMENT build-time variable.
  • Then the test runner, like @avajs or any other, would execute the testing flow with passing the testing steps controlling env variables to the above-named main process e2e-specific script (based on the received env variable the main process would connect the relevant preload script to the app's browser window).
  • It would be an improvement to the currently used scenario if the e2e tests were executed on the app installed from the actual installer rather than from the "unpacked" package (at least deb/exe/dmg packages). It's technically possible to do.

So the goal is to keep the currently used e2e-testing scenario but without using any electron-specific testing framework.

vladimiry added a commit that referenced this issue Jun 13, 2021
* aside other things, the change allows switching to @electron v14 since "playwright" doesn't depended on "remote" module (removed from @electron since v14)
@vladimiry
Copy link
Owner Author

I know there is at least playwright testing framework that supports @electron to some extent.

I ended up switching to https://github.com/microsoft/playwright for now. The switch was relatively easy (I kept the existing test structure/framework). Using playwright has been a nicer experience for me so far than using spectron.

vladimiry added a commit that referenced this issue Jun 13, 2021
* aside other things, the change allows switching to @electron v14 since "playwright" doesn't depended on "remote" module (removed from @electron since v14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant