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

Looking for Maintainers & Contributors! #896

Closed
VerteDinde opened this issue Mar 10, 2021 · 19 comments
Closed

Looking for Maintainers & Contributors! #896

VerteDinde opened this issue Mar 10, 2021 · 19 comments

Comments

@VerteDinde
Copy link
Collaborator

VerteDinde commented Mar 10, 2021

Hey folks! We realize many of you use and depend on Spectron for your apps. However, we want to be honest about the current state of Spectron from a maintainer perspective.

Spectron currently has no active maintainers; while we've consistently put out new releases for each new version of Electron, Spectron has had very little maintenance and improvements for over a year.

As we approach Electron 14, Spectron will require a major rewrite in order to continue working without relying on the remote module. This rewrite is currently not planned work, and thus there is unfortunately no guarantee at this time that Spectron will continue working after Electron 14. This, along with a desire to make other improvements, made us decide to put out a call for community help.

We're looking for:

  • People who have experience working on Electron-related packages and are interested in becoming a maintainer of Spectron.
  • People who maintain their own fork of Spectron and might be interested in improving our upstream (even if you don't want to commit to being a maintainer, help on issues is appreciated)
  • People who wouldn't mind jumping in and helping with open issues

If you'd like to help out Spectron, please reach out to me via email (vertedinde@electronjs.org) or reply to this issue.

Thanks all! We appreciate you using Spectron and Electron. 🙇‍♀️

@vladimiry
Copy link

For those who are looking for an alternative to spectron I'd recommend exploring https://github.com/microsoft/playwright. I've just switched spectron => playwright and it's been a nicer experience for me so far (btw playwright doesn't depend on the remote module removed in @electron since v14).

@goosewobbler
Copy link

goosewobbler commented Jul 17, 2021

I started a rewrite on my fork. Consider it a prototype at this stage, but I got it clicking buttons (with nodeIntegration: false, enableRemoteModule: false, contextIsolation: true)...

https://github.com/goosewobbler/spectron

@goosewobbler
Copy link

Rewrite coming along, I updated to WDIO v7 and prototyped a new approach using their testrunner and chromedriver service. Figured Spectron is so heavily tied to WDIO anyway, might as well work with them rather than against them.

@gilles-yvetot
Copy link

For those who are looking for an alternative to spectron I'd recommend exploring https://github.com/microsoft/playwright. I've just switched spectron => playwright and it's been a nicer experience for me so far (btw playwright doesn't depend on the remote module removed in @electron since v14).

@vladimiry would you mind sharing your basic setup to run test with playwright. I have seen their gist on their page but it does not work for me

@vladimiry
Copy link

vladimiry commented Sep 4, 2021

@gilles-yvetot I didn't start from the basic setup but just replaced "spectron" with "playwright" keeping the existing structure, and it just worked out from the box (no time-wasting hacking needed as time to time was required for using "spectron"). But I remember that https://playwright.dev/docs/api/class-electron/ and https://playwright.dev/docs/api/class-page pages were helpful. I briefly shared my first experience here. The @avajs is currently used as a test runner in that project but I'm thinking of replacing it with something more simple or maybe with playwright test runner (see here the complete example of using it for @electron case). The test runner is a different topic though, "playwright" itself is supposed to work with any runner.

@gilles-yvetot
Copy link

@vladimiry thanks for the help, I could made it work! I agree with you, playwright seems like a very good alternative of spectron!

@cawa-93
Copy link

cawa-93 commented Sep 12, 2021

For the future. In one of my projects, I migrated to https://github.com/microsoft/playwright. It was a little harder than I expected. I really missed different examples. I hope my example will be useful to someone:
https://github.com/cawa-93/vite-electron-builder/blob/7d2df55fd8a0b3a803963d62558f719c9034ba2a/tests/app.spec.js

@goosewobbler
Copy link

goosewobbler commented Sep 13, 2021

Wasn't able to do anything on my rewrite for a bit. Next step is a WDIO service to handle the ChromeDriver stuff as the CD service I am currently using doesn't allow for restarting. Basically the same approach as before but as a part of the WDIO ecosystem. Don't wait for this, use Playwright in the meantime. I'm only rewriting this because I'm stubborn.

@jjeff
Copy link

jjeff commented Oct 13, 2021

For those who are looking for an alternative to spectron I'd recommend exploring https://github.com/microsoft/playwright. I've just switched spectron => playwright and it's been a nicer experience for me so far (btw playwright doesn't depend on the remote module removed in @electron since v14).

For anyone considering a move to Playwright, I've created an Electron Playwright Example project so you can see how it works. Playwright looks like a GREAT alternative to Spectron.

  • Playwright is faster
  • Playwright doesn't require the remote module
  • Playwright code is clearer and more concise (in my experience)
  • Playwright can speak directly to the main process
  • Playwright can test multiple windows simultaneously without Spectron's slow app.client.switchToWindow()-style functions

@ekosynth
Copy link

For those who are looking for an alternative to spectron I'd recommend exploring https://github.com/microsoft/playwright. I've just switched spectron => playwright and it's been a nicer experience for me so far (btw playwright doesn't depend on the remote module removed in @electron since v14).

For anyone considering a move to Playwright, I've created an Electron Playwright Example project so you can see how it works. Playwright looks like a GREAT alternative to Spectron.

  • Playwright is faster
  • Playwright doesn't require the remote module
  • Playwright code is clearer and more concise (in my experience)
  • Playwright can speak directly to the main process
  • Playwright can test multiple windows simultaneously without Spectron's slow app.client.switchToWindow()-style functions

Hey @jjeff , how do you use Playwright with electron? It looks like its not supported, but there is this ticket to add it:

microsoft/playwright#5181

@gilles-yvetot
Copy link

@ekosynth they have a code sample here

@goosewobbler
Copy link

If anyone is interested I added an issue for discussing my fork and released 17.0.0alpha3 to NPM.

#1044

@christian-bromann
Copy link

christian-bromann commented Oct 28, 2021

I agree that a new version could allow support for multiple automation frameworks, similar to the idea of what CodeceptJS is doing. Just want to clarify some misconceptions:

  • Playwright is faster

Not really. WebdriverIO can run through Puppeteer instead of through Chromedriver. I know that the Playwright team implemented some CDP optimisations to reduce the network throughput but it is questionable how much this impacts an e2e test. Would be curious to know though.

  • Playwright doesn't require the remote module

There are certainly optimisations how WebdriverIO is integrated into Spectron. I like the idea from @goosewobbler of building a spectron service and kick of tests using the wdio testrunner, which gives access to the WebdriverIO reporter and service ecosystem.

  • Playwright code is clearer and more concise (in my experience)

No doubt, Playwright has a nice API interface.

  • Playwright can speak directly to the main process

So can WebdriverIO when run with Puppeteer. The advantage: you run in the same Chromium environment Electron does. Playwright comes with a custom one and while you could argue it is essentially the same, it might be not.

  • Playwright can test multiple windows simultaneously without Spectron's slow app.client.switchToWindow()-style functions

Same as above, if you switch to Puppeteer you can access multiple windows through CDP.

I am happy to support this effort.

@jtoy
Copy link

jtoy commented Dec 2, 2021

I suggest we put this info directly on the spectron web pages so people know we need help.

@goosewobbler
Copy link

goosewobbler commented Dec 2, 2021

I didn't do anything on my fork for a while, stalled at recreating the CD restart behaviour with the new custom WDIO service. I believe this issue is the only thing stopping the fork being a fully working PoC. I will take another swing at it before long but could definitely do with some help. Going to spam the WDIO gitter a bit more but so far no responses, I guess people put off by it being a complex / atypical use of WDIO.

#1044 (comment)

@christian-bromann
Copy link

@goosewobbler I am currently exploring testing vscode extensions and probably don't get around building 1st class support into WebdriverIO. Let's get together next week to talk about this. Mind picking a time slot here so we can chat?

@VerteDinde
Copy link
Collaborator Author

Given that Spectron is now deprecated, closing this issue.

@VerteDinde VerteDinde unpinned this issue Feb 16, 2022
@christian-bromann
Copy link

The WebdriverIO community has build a service for WebdriverIO to seamlessly run Electron UI tests in parallel and with all the features WebdriverIO provides. You can find the instructions here. Thanks to @goosewobbler for making this happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants