ExtesterRunner - redhat-developer/vscode-extension-tester GitHub Wiki
ExTester Runner
Quick Start
- Install the ExTester Runner extension from the VS Code marketplace
- Open your VS Code extension project
- Click the ExTester Runner icon in the Activity Bar
- Find your test in the Test Explorer
- Click the play button (▶️) to run it
What is ExTester Runner?
ExTester Runner is a VS Code extension that provides a comprehensive UI for running and managing UI tests for VS Code extensions using the ExTester framework. It offers a seamless testing experience directly within VS Code, eliminating the need to switch between different tools or environments.
The extension integrates into VS Code's Activity Bar and provides three main views:
- UI Tests: A hierarchical view of test files and their structure (Mocha
describe/it
blocks) - Screenshots: A view of screenshot image files captured during test runs
- Logs: A view of log files generated during test executions
How it Works
Core Functionality
-
Test Discovery and Organization
- Automatically discovers test files based on configured glob patterns
- Organizes tests in a hierarchical structure matching your project's folder layout
- Supports Mocha's test structure with
describe
andit
blocks - Provides visual indicators for test status and modifiers (
.only
,.skip
)
-
Test Execution
- One-click test running for individual files, folders or all tests
- Supports running tests at different levels:
- Test file (all tests in a file)
- All test files in a folder
- All tests in the workspace
-
Test, Logs and Screenshots Management
- Automatic refresh of views when test files change
- Provides quick navigation to test source code
- Displays screenshots from test runs with automatic refresh
- Provides quick access to view captured screenshots
- Maintains and organizes test logs with refresh
- Enables quick opening of log files
Configuration
The extension is highly configurable through VS Code settings:
-
View Configuration
testFileGlob
: Pattern to locate test files (default:**/ui-test/**/*.test.ts
)excludeGlob
: Pattern to exclude paths from test search (default:**/node_modules/**
)ignorePathPart
: Pattern to hide specific path segments in the test view
-
Test Execution Settings
outputFolder
: Directory for compiled test filesrootFolder
: Root source directory for test filestempFolder
: Directory for temporary test filesvsCodeVersion
: VS Code version for test executionvsCodeType
: VS Code build type (stable/insider)additionalArgs
: Additional CLI arguments for test runner
-
Log Management
hideEmptyLogFolders
: Controls visibility of empty log directories
Setup and Configuration
Initial Setup
The extension provides a built-in walkthrough to help you get started quickly. To access it:
- Open VS Code
- Go to the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Type "Get Started with ExTester Runner" and select it
The walkthrough will guide you through the essential configuration steps:
-
Configure Root and Output Directories
- Set up your test environment by configuring:
- Root Folder: Where your test files are located
- Output Folder: Where compiled tests are stored
- Set up your test environment by configuring:
-
Configure Test File Pattern
- Set up the pattern that ExTester Runner will use to find your test files
- Default pattern:
**/ui-test/**/*.test.ts
-
Configure Excluded Paths
- Specify which paths should be excluded from test file searches
- Default exclusion:
**/node_modules/**
-
Customize Path Display (Optional)
- Improve test view readability by hiding specific path segments
-
Additional Arguments (Optional)
- Configure additional command line arguments for ExTester
Manual Configuration
If you prefer to configure the extension manually, you can access all settings through VS Code's settings panel:
-
Open VS Code Settings (Ctrl+, / Cmd+,)
-
Search for "ExTester Runner"
-
Configure the following settings:
-
View Configuration
testFileGlob
: Pattern to locate test files (default:**/ui-test/**/*.test.ts
)excludeGlob
: Pattern to exclude paths from test search (default:**/node_modules/**
)ignorePathPart
: Pattern to hide specific path segments in the test view
-
Test Execution Settings
outputFolder
: Directory for compiled test filesrootFolder
: Root source directory for test filestempFolder
: Directory for temporary test filesvsCodeVersion
: VS Code version for test executionvsCodeType
: VS Code build type (stable/insider)additionalArgs
: Additional CLI arguments for test runner
-
Log Management
hideEmptyLogFolders
: Controls visibility of empty log directories
Getting Started
- Install the ExTester Runner extension from the VS Code marketplace
- Open your VS Code extension project
- Configure the necessary settings through VS Code's settings panel
- Use the Activity Bar to access the ExTester Runner views
The extension includes a built-in walkthrough to help users get started quickly, guiding them through the essential configuration steps.