-
Hello,
Would you know how to make this work using Vanilla CJS? Update:
I'm not sure what else to try Update: I bumped into https://github.com/goosewobbler/wdio-electron-service-example which is a perfect example of a testable CJS electron application. Hope it helps others too. I found out that when loading a web extension into Electron, WDIO opens the context of the extension window, and if that window doesn't use the preload script then the test fails. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I figured it out. I am still not sure why, I was going deeper into the matter (Dig into the chromedriver launching code) and I thought of "moving" the extension loading code to the end of the "ready" event handler and that did the trick. So bottom line, if you're loading extensions into Electron, you should do that at the end of the "ready" event handler. Otherwise, the chromedriver will attach to the first extension's background page. |
Beta Was this translation helpful? Give feedback.
I figured it out. I am still not sure why, I was going deeper into the matter (Dig into the chromedriver launching code) and I thought of "moving" the extension loading code to the end of the "ready" event handler and that did the trick.
So bottom line, if you're loading extensions into Electron, you should do that at the end of the "ready" event handler. Otherwise, the chromedriver will attach to the first extension's background page.