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

Add support for Electron 28 #110

Open
bigorn0 opened this issue Dec 29, 2023 · 3 comments
Open

Add support for Electron 28 #110

bigorn0 opened this issue Dec 29, 2023 · 3 comments

Comments

@bigorn0
Copy link

bigorn0 commented Dec 29, 2023

Hello,

while upgrading my application to latest Electron 28 latest release, I wanted to validate my test tooling and i noticed that Testcafe integration doesn't work anymore. It only opens the default Electron page and displays the help command output in logs.

I started to try to find a workaround (or at least the root cause) but so far no luck for now

Note that it works perfectly with Electron 27.

Could you please check?

Thanks!

Copy link

github-actions bot commented Jan 4, 2024

We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.

@thomas-jakemeyn
Copy link

We managed to make the TestCafe tests start with Electron 28 by patching src/injectable/index.js.
We have modified the existing logic below:

// src/injectable/index.js, line 19
const isMain = args[2];
const isNotBrowserInitMainModule = isMain && !isBrowserInitModule(args[0]);

if (isNotBrowserInitMainModule) {
  ...
}

as followed:

// src/injectable/index.js, line 19
const isMain = args[2];
const isNotBrowserInitMainModule = isMain && !isBrowserInitModule(args[0]);
const isNotBrowserInitMainModuleAsOfElectron28 = args[0] === 'electron' && !args[1];
const runDecorator = isNotBrowserInitMainModule || isNotBrowserInitMainModuleAsOfElectron28;

if (runDecorator) {
  ...
}

We have validated this patch by running npm run test in this repository after upgrading the following dev dependencies:

  • electron to the version 28.1.3
  • @electron/remote to the version 2.1.1

@thomas-jakemeyn
Copy link

If you are looking for a solution to make the plugin work for a more recent version of Electron, then have a look at #119.

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

No branches or pull requests

3 participants