(@wdio/cli): Simplified Electron setup#11406
Conversation
652ec93 to
97da817
Compare
erwinheitzman
left a comment
There was a problem hiding this comment.
LGTM, fine improvements 👏
| ## More Information | ||
|
|
||
| You can learn more about how to configure the [`wdio-electron-service`](https://www.npmjs.com/package/wdio-electron-service) in the [service docs](/docs/wdio-electron-service). | ||
| You can learn more about how to configure the [`wdio-electron-service`](https://www.npmjs.com/package/wdio-electron-service) in the [service docs](/docs/wdio-electron-service). Make sure to check out our [Electron boilerplate project](https://github.com/webdriverio/electron-boilerplate/actions/runs/6490587562/job/17626575914) that showcases how to intergate WebdriverIO in an example application. |
There was a problem hiding this comment.
Do you mean to link to the CI output here?
There was a problem hiding this comment.
Oh, good catch!
| const isTest = process.env.NODE_ENV === 'test' | ||
| if (isTest) { | ||
| import('wdio-electron-service/main'); | ||
| require('wdio-electron-service/main'); |
There was a problem hiding this comment.
I noticed this change in the boilerplate project too, are there issues using dynamic import here?
There was a problem hiding this comment.
This I believe fails if your Electron project is forced to use a CJS setup in your tsconfig.json. AFAIK the Electron ecosystem still has no good support for ESM. While it is not impossible to get it working (looking at the service example), I wanted to make sure to not have it failing either due to type issues and using require here is just a safe way to demonstrate it.
Proposed changes
After releasing
v5.2.0of our Electron service, we can simplify the setup required for running tests on Electron Applications.Types of changes
Checklist
Further comments
This setup was tested on the Electron Boilerplate.
Reviewers: @webdriverio/project-committers