This E2E (End-to-End) test framework automates testing of the CMSIS Solution VS Code extension using Playwright. It validates the complete user workflow from extension installation through project building across multiple example projects.
The framework follows a 3-layer architecture for maintainability and reusability:
src/e2e-tests/
├── infrastructure/ # Core VS Code & Playwright setup
├── drivers/ # UI component interaction wrappers
├── utils/ # Test helpers and utilities
└── build.test.ts # Main test suite-
Build and package the extension before running tests:
npm run build npm run package
-
Example repositories: Tests automatically clone required repositories on first run
-
VS Code: Framework downloads VS Code stable automatically via
@vscode/test-electron
# Run all E2E tests
npm run e2e
# Run with specific log level
E2E_LOG_LEVEL=debug npm run e2e
# View test report after run
npx playwright show-report --port 9324Tests are configured via test_data.config.json:
{
"examples": [
{
"name": "Hello",
"contexts": [".Debug+AVH", ".Release+AVH"],
"skipTest": false,
"selectCompiler": false
}
],
"repositories": [
"https://github.com/Test-software/Test-Stream"
],
"cloneDirectory": "data"
}Configuration Options:
name: Example project directory namecontexts: Build contexts to test (e.g.,.Debug+AVH)skipTest: Skip this example in test runsselectCompiler: Whether to handle compiler selection dialogrepositories: Git repositories to clonecloneDirectory: Target directory for cloned examples
Global test settings in playwright.config.ts:
{
timeout: 180000, // 3 minutes per test
workers: 1, // Serial execution (VS Code limitation)
fullyParallel: false, // Sequential test execution
reporter: 'html', // HTML test report
webServer: {
port: 9324 // Report server port
}
}The framework uses a centralized logging system with 4 levels:
| Level | Usage | Default Shown |
|---|---|---|
error |
Critical failures | ✅ Yes |
warn |
Warnings and issues | ✅ Yes |
info |
Test progress and milestones | ❌ No |
debug |
Detailed execution steps | ❌ No |
Set the E2E_LOG_LEVEL environment variable:
# Show only errors
E2E_LOG_LEVEL=error npm run e2e
# Show errors and warnings (default)
E2E_LOG_LEVEL=warn npm run e2e
# Show info level (test progress)
E2E_LOG_LEVEL=info npm run e2e
# Show everything (debug mode)
E2E_LOG_LEVEL=debug npm run e2eAll logs are prefixed with their level:
[INFO] 🚀 Starting test setup...
[DEBUG] 🔄 Switching to workspace: C:/path/to/workspace
[ERROR] ❌ Build failed: compilation error
[WARN] ⚠️ Extension not found, retrying...