https://github.com/redhat-developer/vscode-extension-tester-example
This is a Hello World example extension that shows you how to set up and run simple UI tests for VS Code extensions using the ExTester.
https://github.com/redhat-developer/vscode-extension-tester-example
Last synced: 5 months ago
JSON representation
This is a Hello World example extension that shows you how to set up and run simple UI tests for VS Code extensions using the ExTester.
- Host: GitHub
- URL: https://github.com/redhat-developer/vscode-extension-tester-example
- Owner: redhat-developer
- License: apache-2.0
- Created: 2024-10-08T11:29:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-15T21:52:10.000Z (5 months ago)
- Last Synced: 2025-08-15T22:43:57.896Z (5 months ago)
- Language: TypeScript
- Size: 1.21 MB
- Stars: 7
- Watchers: 8
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Hello World ExTester
This is a Hello World example extension that shows you how to set up and run simple UI tests for VS Code extensions using the ExTester.
## Motivation
Our example extension gives us the ability to call the `Hello World` command, one that shows a notification saying `Hello World!`. We would like to write automated regression tests for this feature.

## Dependencies and Requirements
In order to run the ExTester, the extension needs 2 packages as (dev)Dependencies:
- `vscode-extension-tester` - the extension testing framework itself
- `mocha` - Mocha test framework is required, as the ExTester uses it for writing and running its tests
This example also uses `chai` as the assertion framework of choice, but feel free to use any assertion package you like.
Also note that the folder `test-resources` (which stores all the required binaries for testing) is excluded from typescript compiler and ESLint. This is necessary for both to work when building your project. We also recommend adding the folder into your `.gitignore` file.
## Running the Tests
- Run `npm install` in terminal to install dependencies
- Run `npm run ui-test` in terminal. This will:
- Compile the code
- Download the latest version of VS Code
- Download the adequate version of ChromeDriver
- Run the downloaded VS Code binary using ChromeDriver
- Run the tests located in `src/ui-test`
To check the `ui-test` script, see the `script` section inside `package.json`.
To check the test code, see the `src/ui-test/*-test.ts` files.