redhat-developer/vscode-extension-tester
소개
ExTester: Visual Studio Code 확장 프로그램을 위한 필수 UI 테스트 도구입니다! Selenium WebDriver로 UI 테스트를 원활하게 실행해 확장 프로그램 개발의 견고성과 신뢰성을 보장합니다. VS Code 확장 프로그램의 UI 테스트를 간소화하고 사용자 인터페이스의 품질을 손쉽게 높여 보세요.
개발 도구What you can do
- Ready-made test environment — downloads a test instance of VS Code (stable or insiders, any supported version) and the ChromeDriver build that matches it.
- Installs your extension into that instance, optionally together with the extensions it depends on.
- Page Object API for the activity bar, side bar, editors, bottom panel, status bar, title bar, dialogs, notifications, web views and more.
- Mocha and TypeScript — tests are ordinary Mocha suites with full type definitions.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalUI testing framework for Visual Studio Code extensions
Features • 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.
Features
- Ready-made test environment — downloads a test instance of VS Code (stable or insiders, any supported version) and the ChromeDriver build that matches it.
- Installs your extension into that instance, optionally together with the extensions it depends on.
- Page Object API for the activity bar, side bar, editors, bottom panel, status bar, title bar, dialogs, notifications, web views and more.
- Mocha and TypeScript — tests are ordinary Mocha suites with full type definitions.
- Screenshots of failed tests out of the box, and code coverage with a single flag.
- Custom page objects and locators to cover your own extension's UI.
- CLI and API — run from an npm script with
extest, or drive the same steps from your own code.
Packages
| 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 |
Requirements
| 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.
Quick start
Add ExTester to your extension's
devDependencies:npm install --save-dev vscode-extension-testerWrite 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
extestat the compiled tests, then run it:"ui-test": "extest setup-and-run './out/ui-test/**/*.test.js'"npm run ui-testTo skip compiling the tests, install
tsxas a dev dependency and target the sources instead, e.g.extest setup-and-run './src/ui-test/**/*.test.ts'— see TypeScript Tests.
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.
ExTester Runner
The ExTester Runner extension lists your UI tests in VS Code's Testing view, runs or debugs everything, a folder, a file, a describe block or a single test, and shows the result of each test with its error, stack trace and failure screenshot. The Screenshots and Logs views below the tests keep the files of each run. It is also available on Open VSX. See the ExTester Runner guide.
Documentation
The full documentation is at redhat-developer.github.io/vscode-extension-tester.
- Installation and Supported Versions
- Writing Simple Tests
- Test Setup — CLI commands, environment variables and
extester.config.json - Mocha Configuration
- Debugging Tests, Taking Screenshots and Code Coverage
- Custom Page Objects
- Page Object Reference
For a complete, runnable project see the vscode-extension-tester-example repository.
Known issues
Platform caveats and answers to the most common problems are collected in KNOWN_ISSUES.md.
Getting help
- Questions and ideas: GitHub Discussions
- Bugs and feature requests: open an issue
- Security vulnerabilities: follow the security policy
Contributing
Contributions are welcome. The Contribution Guide explains how to build the project, run the test suite and submit a pull request.
License
관련 프로젝트 살펴보기
불러오는 중…