ExTester: Your Essential UI Testing Companion for Visual Studio Code Extensions! Seamlessly execute UI tests with Selenium WebDriver, ensuring robustness and reliability in your extension development journey. Simplify UI testing for your VS Code extensions and elevate the quality of your user interface effortlessly.
See the codeFeatures • Packages • Requirements • Quick start • ExTester Runner • Documentation • Known issues
ExTester runs Selenium WebDriver UI tests against a real instance of Visual Studio Code. It downloads VS Code and the matching ChromeDriver, installs your extension, launches the editor and runs your Mocha tests. A Page Object API covers the whole VS Code UI, so your tests never have to touch the editor's DOM.
extest, or drive the same steps from your own code.| Package | What it is | How you get it |
|---|---|---|
vscode-extension-tester | The framework: the extest CLI and the programmatic API | npm install --save-dev vscode-extension-tester |
@redhat-developer/page-objects | Page Object API for the VS Code UI, re-exported by the framework | installed automatically as a dependency |
@redhat-developer/locators | Version-specific element locators used by the page objects | installed automatically as a dependency |
| ExTester Runner | VS Code extension that lists and runs your UI tests | Marketplace · Open VSX |
| Node.js | Visual Studio Code | Operating system |
|---|---|---|
| 22 or newer; the latest LTS release is recommended | The latest 3 minor releases are tested; 1.90.0 and newer work on a best-effort basis | Linux, Windows and macOS; see Known issues for platform caveats |
The full policy, including how the tested VS Code range is kept up to date, is on the Supported Versions page.
Add ExTester to your extension's devDependencies:
npm install --save-dev vscode-extension-tester
Write a test, for example in src/ui-test/example.test.ts:
import { assert } from "chai";
import { ActivityBar } from "vscode-extension-tester";
describe("My extension", () => {
it("shows the Explorer view", async () => {
const control = await new ActivityBar().getViewControl("Explorer");
assert.isDefined(control);
});
});
Add an npm script that points extest at the compiled tests, then run it:
"ui-test": "extest setup-and-run './out/ui-test/**/*.test.js'"
npm run ui-test
extest setup-and-run downloads VS Code and ChromeDriver, packages and installs your extension, and runs the tests. Mocha's default 2 second timeout is rarely enough for UI tests, so raise it in a .mocharc.js file. Writing Simple Tests and Test Setup cover every option, including extester.config.json.
The ExTester Runner extension adds a view to the Activity Bar that lists your UI tests as a tree, runs a file, a folder or everything with one click, and shows the screenshots and logs from each run. It is also available on Open VSX. See the ExTester Runner guide.
The full documentation is at redhat-developer.github.io/vscode-extension-tester.
extester.config.jsonFor a complete, runnable project see the vscode-extension-tester-example repository.
Platform caveats and answers to the most common problems are collected in KNOWN_ISSUES.md.
Contributions are welcome. The Contribution Guide explains how to build the project, run the test suite and submit a pull request.
(top 30 of 33)
TypeScript
96.9%
JavaScript
1.5%
ExTester: Your Essential UI Testing Companion for Visual Studio Code Extensions! Seamlessly execute UI tests with Selenium WebDriver, ensuring robustness and reliability in your extension development journey. Simplify UI testing for your VS Code extensions and elevate the quality of your user interface effortlessly.
See the codeFeatures • Packages • Requirements • Quick start • ExTester Runner • Documentation • Known issues
ExTester runs Selenium WebDriver UI tests against a real instance of Visual Studio Code. It downloads VS Code and the matching ChromeDriver, installs your extension, launches the editor and runs your Mocha tests. A Page Object API covers the whole VS Code UI, so your tests never have to touch the editor's DOM.
extest, or drive the same steps from your own code.| Package | What it is | How you get it |
|---|---|---|
vscode-extension-tester | The framework: the extest CLI and the programmatic API | npm install --save-dev vscode-extension-tester |
@redhat-developer/page-objects | Page Object API for the VS Code UI, re-exported by the framework | installed automatically as a dependency |
@redhat-developer/locators | Version-specific element locators used by the page objects | installed automatically as a dependency |
| ExTester Runner | VS Code extension that lists and runs your UI tests | Marketplace · Open VSX |
| Node.js | Visual Studio Code | Operating system |
|---|---|---|
| 22 or newer; the latest LTS release is recommended | The latest 3 minor releases are tested; 1.90.0 and newer work on a best-effort basis | Linux, Windows and macOS; see Known issues for platform caveats |
The full policy, including how the tested VS Code range is kept up to date, is on the Supported Versions page.
Add ExTester to your extension's devDependencies:
npm install --save-dev vscode-extension-tester
Write a test, for example in src/ui-test/example.test.ts:
import { assert } from "chai";
import { ActivityBar } from "vscode-extension-tester";
describe("My extension", () => {
it("shows the Explorer view", async () => {
const control = await new ActivityBar().getViewControl("Explorer");
assert.isDefined(control);
});
});
Add an npm script that points extest at the compiled tests, then run it:
"ui-test": "extest setup-and-run './out/ui-test/**/*.test.js'"
npm run ui-test
extest setup-and-run downloads VS Code and ChromeDriver, packages and installs your extension, and runs the tests. Mocha's default 2 second timeout is rarely enough for UI tests, so raise it in a .mocharc.js file. Writing Simple Tests and Test Setup cover every option, including extester.config.json.
The ExTester Runner extension adds a view to the Activity Bar that lists your UI tests as a tree, runs a file, a folder or everything with one click, and shows the screenshots and logs from each run. It is also available on Open VSX. See the ExTester Runner guide.
The full documentation is at redhat-developer.github.io/vscode-extension-tester.
extester.config.jsonFor a complete, runnable project see the vscode-extension-tester-example repository.
Platform caveats and answers to the most common problems are collected in KNOWN_ISSUES.md.
Contributions are welcome. The Contribution Guide explains how to build the project, run the test suite and submit a pull request.
(top 30 of 33)
TypeScript
96.9%
JavaScript
1.5%