Registry / testing / wdio-vscode-service

wdio-vscode-service

JSON →
library6.1.4jsnpmunverified

The `wdio-vscode-service` is a WebdriverIO service designed for comprehensive end-to-end testing of Visual Studio Code extensions. It currently stands at version 6.1.4 and receives regular updates, indicating an active development cycle. This service streamlines the testing process by automatically handling the installation of specified VSCode versions (stable, insiders, or specific releases) and downloading the corresponding Chromedriver. It differentiates itself by providing direct access to the VSCode API within tests, enabling robust interaction with the IDE. Furthermore, it supports testing both desktop and web extensions, and it comes with pre-bootstrapped page objects tailored to various VSCode versions. This project builds upon the concept of `vscode-extension-tester` but re-imagines it for the WebdriverIO ecosystem, offering a more integrated and familiar experience for WebdriverIO users.

npm install wdio-vscode-service
INSTALL
IMPORT
SIG · WDIO-VSCODE-SERVIC
W
wdio-vscode-service
testingjavascriptv6.1.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

config
export const config: WebdriverIO.Config = { // ... services: [['vscode', { /* options */ }]] };
module.exports.config = { /* ... */ };
The service is configured as part of the main `wdio.conf.ts` file, typically using ESM exports for TypeScript projects. The service name 'vscode' is used as a string in the `services` array.
vscode (service registration)
services: [ ['vscode', { cachePath: 'trace', // ... other service options }] ]
import { VscodeService } from 'wdio-vscode-service'; services: [new VscodeService()]
The `wdio-vscode-service` is registered in WebdriverIO's configuration by its string identifier, 'vscode', within the `services` array. It does not typically require a direct import of a class.
browser (global object)
import { browser } from '@wdio/globals'; await browser.openNotifications(); const workbench = await browser.getWorkbench();
import { browser } from 'webdriverio';
The `wdio-vscode-service` extends the global `browser` object (provided by `@wdio/globals`) with VSCode-specific commands and page objects, such as `openNotifications` and `getWorkbench`.

This quickstart configuration demonstrates how to integrate the `wdio-vscode-service` into a TypeScript-based WebdriverIO project. It specifies testing against a particular VSCode version, applies custom user settings, and includes the critical `wdio:enforceWebDriverClassic` option for WebdriverIO v9 compatibility. It also highlights where to define the extension path and other service-specific options.

// wdio.conf.ts import type { Options } from '@wdio/types'; export const config: Options.WebdriverIO = { outputDir: './trace', capabilities: [{ browserName: 'vscode', browserVersion: '1.86.0', // Can also be 'insiders' or 'stable' 'wdio:enforceWebDriverClassic': true, // Important for WebdriverIO v9 'wdio:vscodeOptions': { extensionPath: './dist', userSettings: { "editor.fontSize": 14, "window.zoomLevel": 0 } } }], services: ['vscode'], // ... other WebdriverIO configuration options // Optionally define the path WebdriverIO stores all VSCode binaries, e.g.: // services: [['vscode', { cachePath: __dirname }]] };
Debug
Known issues
breakingVersion 6.0.0 introduced significant internal changes, including a new mechanism for WebdriverIO driver setup and fixes for `TypeError: object is not iterable`. These changes may require updates to existing test configurations and how `executeWorkbench` behaves after VSCode restarts.
fix
Review the WebdriverIO upgrade guides for driver setup and adjust your `wdio.conf.ts` accordingly. Ensure your test suites account for potential changes in `executeWorkbench` behavior. Upgrade to v6.0.0 or later to benefit from the bug fixes.
affects: >=6.0.0
gotchaWhen using WebdriverIO v9, it is crucial to explicitly set `'wdio:enforceWebDriverClassic': true` within your capabilities configuration to ensure correct functionality and prevent unexpected issues with driver communication.
fix
Add `'wdio:enforceWebDriverClassic': true` to the `capabilities` object in your `wdio.conf.ts` file.
affects: >=6.0.0
gotchaFor testing VSCode versions 1.86.0 and higher, `webdriverio` version 8.14.0 or newer is a prerequisite. Using older WebdriverIO versions with recent VSCode versions may lead to issues with automatic Chromedriver installation and setup.
fix
Ensure your `webdriverio` peer dependency is `^8.14.0` or higher when targeting VSCode v1.86.0+ in your tests.
affects: >=6.0.0
gotchaPrior to version 6.1.4, the service used unreliable string comparison for the `browserVersion` option, which could lead to incorrect VSCode version resolution during installation or unexpected behavior.
fix
Upgrade `wdio-vscode-service` to version `6.1.4` or higher to utilize robust semver comparison for `browserVersion`, ensuring accurate VSCode version targeting.
affects: <6.1.4
deprecatedThe `cachePath` service option in versions prior to 6.0.2 had known problems, potentially causing issues with how VSCode binaries are stored and retrieved, leading to test setup failures or inconsistencies.
fix
Upgrade to `wdio-vscode-service` version `6.0.2` or higher to resolve known issues with the `cachePath` option. Verify your `cachePath` configuration points to a writable and accessible directory.
affects: <6.0.2
Errors
Common errors & fixes
TypeError: object is not iterable
An internal API change or incorrect data handling within the service's interaction with WebdriverIO or VSCode APIs, addressed in `v6.0.0`.
fix
Upgrade `wdio-vscode-service` to version `6.0.0` or later to resolve this specific error, which was patched in that release.
"Connection closed" errors when deleting the session for @wdio/cucumber-framework
A specific issue causing premature connection closure during session teardown, particularly when using the `@wdio/cucumber-framework`.
fix
Upgrade `wdio-vscode-service` to version `6.0.3` or later, which includes a fix to prevent these connection closed errors.
Failed to download Chromedriver / Chromedriver download URL issues
Outdated WebdriverIO dependencies within the service could lead to incorrect or broken Chromedriver download URLs.
fix
Upgrade `wdio-vscode-service` to version `6.0.1` or later to ensure updated WebdriverIO dependencies and correct Chromedriver download URLs.
Upgrade
Version history
6.1.4latest on npm
Audit
Dependencies
webdriveriorequiredThis is a WebdriverIO service and requires an active WebdriverIO installation to function as a peer dependency.
Agent activity
15 hits · last 30 days
node
14
Resources
wdio-vscode-service — npm install wdio-vscode-service · libregistry