Skip to content

Commit

Permalink
Merge pull request #729 from webdriverio-community/sm/v9-update
Browse files Browse the repository at this point in the history
v9 release updates
  • Loading branch information
goosewobbler authored Aug 19, 2024
2 parents 1946cb2 + b361808 commit 5bc5724
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# WDIO Electron Service

<a href="https://www.npmjs.com/package/wdio-electron-service" alt="NPM Version">
<img src="https://img.shields.io/npm/v/wdio-electron-service" /></a>
<a href="https://www.npmjs.com/package/wdio-electron-service" alt="NPM Downloads">
<img src="https://img.shields.io/npm/dw/wdio-electron-service" /></a>

<br />

**WebdriverIO service for testing Electron applications**

Enables cross-platform E2E testing of Electron apps via the extensive WebdriverIO ecosystem.
Expand All @@ -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

Expand Down Expand Up @@ -96,6 +103,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)** \
Expand All @@ -112,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

Expand Down
8 changes: 7 additions & 1 deletion docs/common-issues-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 0 additions & 4 deletions docs/configuration/chromedriver-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 17 additions & 10 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,34 @@ 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
- Publish to npm

### 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
- Publish to npm

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` |
2 changes: 1 addition & 1 deletion packages/wdio-electron-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
],
"peerDependencies": {
"electron": "*",
"webdriverio": "*"
"webdriverio": ">9.0.0"
},
"peerDependenciesMeta": {
"electron": {
Expand Down

0 comments on commit 5bc5724

Please sign in to comment.