From c4fd1bbbc7210a24db24a064691c1315602ff583 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Mon, 19 Aug 2024 22:38:13 +0100 Subject: [PATCH 1/6] chore: update peerdep range for wdio --- packages/wdio-electron-service/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wdio-electron-service/package.json b/packages/wdio-electron-service/package.json index 943ccb8c..602cf606 100644 --- a/packages/wdio-electron-service/package.json +++ b/packages/wdio-electron-service/package.json @@ -67,7 +67,7 @@ ], "peerDependencies": { "electron": "*", - "webdriverio": "*" + "webdriverio": ">9.0.0" }, "peerDependenciesMeta": { "electron": { From f8e1131f0aecf7c3ae513b0f8bb6fc8e25e04b1d Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Mon, 19 Aug 2024 23:11:21 +0100 Subject: [PATCH 2/6] chore: update pnpm --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6230ae61..1782b7ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- - uses: pnpm/action-setup@v3 with: - version: 9.7.0 + version: 9.7.1 run_install: false - name: Set pnpm store path run: | @@ -90,7 +90,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- - uses: pnpm/action-setup@v3 with: - version: 9.7.0 + version: 9.7.1 run_install: false - name: Set pnpm store path run: | From 33acee3ba964eab0403e9cbb5e67eaaf93c5afd8 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Mon, 19 Aug 2024 23:13:17 +0100 Subject: [PATCH 3/6] docs: move chromedriver manual config note to main readme --- README.md | 6 ++++++ docs/configuration/chromedriver-configuration.md | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2fe5d462..24dfefe3 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,12 @@ export const config = { }; ``` +## Chromedriver Configuration + +**If your app uses a version of Electron which is lower than v26 then you will need to [manually configure Chromedriver](./docs/configuration/chromedriver-configuration.md#user-managed).** + +This is because WDIO uses Chrome for Testing to download Chromedriver, which only provides Chromedriver versions of v115 or newer. + ## Documentation **[Service Configuration](./docs/configuration/service-configuration.md)** \ diff --git a/docs/configuration/chromedriver-configuration.md b/docs/configuration/chromedriver-configuration.md index 02b80d1c..68224927 100644 --- a/docs/configuration/chromedriver-configuration.md +++ b/docs/configuration/chromedriver-configuration.md @@ -24,10 +24,6 @@ export const config = { ## User Managed -**If your app uses a version of Electron which is lower than v26 then you will need to manually configure Chromedriver.** - -This is because WDIO uses Chrome for Testing to download Chromedriver, which only provides Chromedriver versions of v115 or newer. - In order to manage Chromedriver yourself you can install it directly or via some other means like [`electron-chromedriver`](https://github.com/electron/chromedriver), in this case you will need to tell WebdriverIO where your Chromedriver binary is through its custom [`wdio:chromedriverOptions`](https://webdriver.io/docs/capabilities#webdriverio-capabilities-to-manage-browser-driver-options) capability. For example, in order to use WDIO with an Electron v19 app, you will have to download Chromedriver `102.0.5005.61` from https://chromedriver.chromium.org/downloads. You should then specify the binary path in the WDIO config as follows: From bde2041e546fbde0321ab082d10d902b013cb00f Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Mon, 19 Aug 2024 23:19:33 +0100 Subject: [PATCH 4/6] docs: add extensions issue, update xvfb text --- docs/common-issues-debugging.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/common-issues-debugging.md b/docs/common-issues-debugging.md index 0ffddde9..ae552771 100644 --- a/docs/common-issues-debugging.md +++ b/docs/common-issues-debugging.md @@ -53,6 +53,12 @@ module.exports = { ### DevToolsActivePort file doesn't exist -This is a Chromium error which may appear when using Docker or CI. Most of the "fixes" discussed online are based around passing different combinations of args to Chromium - you can set these via [`appArgs`](./configuration/service-configuration.md#appargs-string), though in most cases using xvfb has proven to be more effective; the service itself uses a [github action](https://github.com/coactions/setup-xvfb) to achieve this when running E2Es on CI. +This is a Chromium error which may appear when using Docker or CI. Most of the "fixes" discussed online are based around passing different combinations of args to Chromium - you can set these via [`appArgs`](./configuration/service-configuration.md#appargs-string), though in most cases using xvfb has proven to be more effective; the service itself uses xvfb when running E2Es on Linux CI. See this [discussion](https://github.com/webdriverio-community/wdio-electron-service/discussions/60) for more details. + +### Module not found: wdio-electron-service/preload + +This is a result of the preload script not being found when trying to access the electron APIs via `execute`. If you are loading extensions into Electron, you should do that at the end of the "ready" event handler. Otherwise, chromedriver will attach to the first extension's background page. + +See this [discussion](https://github.com/webdriverio-community/wdio-electron-service/discussions/667) for more details. From 5b552648e148976a49902233d7a36e59bf6a4dd3 Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Mon, 19 Aug 2024 23:40:11 +0100 Subject: [PATCH 5/6] docs: update release text --- docs/development.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/development.md b/docs/development.md index 1fb876f8..19a7b05f 100644 --- a/docs/development.md +++ b/docs/development.md @@ -110,7 +110,7 @@ Project maintainers can publish a release or pre-release of the npm package by m ### Publish a Release -To publish a release, run the release workflow on Github with the defaults for **Branch** `main` and **NPM Tag** `latest`, and set the appropriate **Release Type** (`major`, `minor`, or `patch`). This will: +To publish a release, run the [release workflow](https://github.com/webdriverio-community/wdio-electron-service/actions/workflows/release.yml) with the defaults for **Branch** `main` and **NPM Tag** `latest`, and set the appropriate **Release Type** (`major`, `minor`, or `patch`). This will: - Create a Git tag - Create a GitHub Release @@ -118,7 +118,7 @@ To publish a release, run the release workflow on Github with the defaults for * ### Publish a Pre-Release -To publish a pre-release, also referred to as a test release, run the workflow with the **NPM Tag** `next`. This will: +To publish a pre-release, also referred to as a test release, run the [pre-release workflow](https://github.com/webdriverio-community/wdio-electron-service/actions/workflows/pre-release.yml) with the **NPM Tag** `next`. This will: - Create a Git tag with the `-next.0` suffix - Create a GitHub Pre-Release @@ -126,11 +126,18 @@ To publish a pre-release, also referred to as a test release, run the workflow w Use the **Release Type** to control which version to increment for the pre-release. The following table provides examples for publishing a pre-release from the current version `6.3.1`: -| Release Type | Pre-Release Version | -| ------------- | ------------------- | -| `major` | `7.0.0-next.0` | -| `minor` | `6.4.0-next.0` | -| `patch` | `6.3.2-next.0` | -| `pre-release` | `6.3.1-next.0` | - -Consecutive pre-releases can increment the `pre-release` version in the suffix. For example, if the current version is `6.3.1-next.0`, the next `pre-release` will be `6.3.1-next.1`. +| Release Type | Pre-Release Version | +| ------------ | ------------------- | +| `major` | `7.0.0-next.0` | +| `minor` | `6.4.0-next.0` | +| `patch` | `6.3.2-next.0` | +| `existing` | `6.3.1-next.0` | + +To create consecutive pre-releases you can select `existing` which will increment the pre-release version in the suffix. For example, if the current version is `6.3.1-next.3`, the following will be published: + +| Release Type | Pre-Release Version | +| ------------ | ------------------- | +| `major` | `7.0.0-next.0` | +| `minor` | `6.4.0-next.0` | +| `patch` | `6.3.2-next.0` | +| `existing` | `6.3.1-next.4` | From b361808d18ff51bed2057bff9e420c5cb9bd9a7c Mon Sep 17 00:00:00 2001 From: goosewobbler Date: Tue, 20 Aug 2024 00:40:20 +0100 Subject: [PATCH 6/6] docs: add npm badges, tweaks --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 24dfefe3..c0b12a49 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # WDIO Electron Service + + + + + +
+ **WebdriverIO service for testing Electron applications** Enables cross-platform E2E testing of Electron apps via the extensive WebdriverIO ecosystem. @@ -8,10 +15,10 @@ Spiritual successor to [Spectron](https://github.com/electron-userland/spectron) ### Features -Using the service makes testing Electron applications much easier: +Makes testing Electron applications much easier via: - 🚗 auto-setup of required Chromedriver -- 📦 automatic path detection of your Electron application - supports [Electron Forge](https://www.electronforge.io/) and [Electron Builder](https://www.electron.build/) +- 📦 automatic path detection of your Electron application - supports [Electron Forge](https://www.electronforge.io/), [Electron Builder](https://www.electron.build/) and unpackaged apps - 🧩 access Electron APIs within your tests - 🕵️ mocking of Electron APIs via a Vitest-like API @@ -118,7 +125,7 @@ Read the [development doc](./docs/development.md) if you are interested in contr ## Example Integrations -Check out our [Electron boilerplate](https://github.com/webdriverio/electron-boilerplate) project that showcases how to integrate WebdriverIO in an example application. You can also have a look at the [Example Apps](./apps/) and [E2Es](./packages/e2e/) directories in this repository. +Check out our [Electron boilerplate](https://github.com/webdriverio/electron-boilerplate) project that showcases how to integrate WebdriverIO in an example application. You can also have a look at the [Example Apps](./apps/) and [E2Es](./e2e/) directories in this repository. ## Support