electron-userland / spectron

DEPRECATED: 🔎 Test Electron apps using ChromeDriver
http://electronjs.org/spectron
MIT License
1.68k stars 229 forks source link

Please release Spectron 16, compatible with electron 14 #1027

Closed sps-gold closed 2 years ago

sps-gold commented 2 years ago

Please release a compatible version of spectron (likely 16) for the recent electron 14 release

VerteDinde commented 2 years ago

Hey @sps-gold, unfortunately Spectron is fairly dependent on the remote module. This module was deprecated in Electron 12, and In Electron 14 it was removed from Electron itself for security reasons, replaced by an external @electron/remote module. Spectron is currently largely unmaintained, and fixing Spectron to work without the remote module will require a fairly large refactor (we provided more information in an issue in the spring here: https://github.com/electron-userland/spectron/issues/896).

We're working on getting Spectron up and running, but it unfortunately may take some time. Apologies for the delay!

sps-gold commented 2 years ago

Thank you @VerteDinde for looking into it and for the updates. Its no longer a blocker for me now after I managed to get the tests running with electron 14 and following changes:

Here's what I did, 1) upgrade spectron packages like - https://github.com/electron-userland/spectron/pull/1031 (actually for now I just upgraded packages in my own package.json without touching spectron package) 2) update chromedriver in wdio config drivers: { chrome: { version: "93.0.4577.15",

juanmartin commented 2 years ago

@sps-gold Where did you edit the wdio config? I can't find it in my project. Need to fix the same issue as my tests are failing due to having Electron v14 and Spectron v15 which still uses Chromium 91 where I need 93.

juanmartin commented 2 years ago

I have tried locking down electron-chromedriver dependency of Spectron to v14 to have Chrome v93 within my project but my tests throw:

javascript error: Cannot convert undefined or null to object

when doing app.start() They used to work on older versions

sps-gold commented 2 years ago

@juanmartin my project uses selenium standalone service, so I can just update the configuration to specify chromedriver version as in documentation here https://webdriver.io/docs/selenium-standalone-service/

sps-gold commented 2 years ago

following PR looks similar you may follow to debug error in your case - https://github.com/electron-userland/spectron/pull/738

juanmartin commented 2 years ago

following PR looks similar you may follow to debug error in your case - #738

Yeah I stumbled upon that one, so it seems to be needing electron.remote which was completely deprecated in v14. I've migrated to use @electron/remote in our project. Does this mean I cannot use Spectron anymore until it moves to @electron/remote or is there a way I can force the use of this module within Spectron?

sps-gold commented 2 years ago

closing as spectron is deprecated.