@sir_hlony_letaoana/wdio-heal-service
v0.1.1
Published
WDIO service plugin for self-healing selector suggestions
Readme
@sir_hlony_letaoana/wdio-heal-service
WDIO service plugin that intercepts test failures, captures the DOM/page-source, and emits self-healing selector suggestions via heal-core.
Install
npm install @sir_hlony_letaoana/wdio-heal-serviceSetup
Add to your wdio.conf.ts:
import type { Options } from "@wdio/types";
export const config: Options.Testrunner = {
// ...
services: [
[
"@sir_hlony_letaoana/wdio-heal-service",
{
outputPath: "reports/heal-report.json",
maxSuggestions: 5,
verbose: true,
},
],
],
};Options
| Option | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable/disable the service |
| outputPath | string | "heal-report.json" | Path to write the healing report |
| maxSuggestions | number | 5 | Max suggestions per failure |
| verbose | boolean | true | Log suggestions to stdout in real-time |
Output
On test completion, writes a heal-report.json artifact:
[
{
"original": "~loginButton",
"testName": "Login > should log in with valid credentials",
"healedAt": 1712345678000,
"suggestions": [
{
"selector": "[accessibility-id=\"loginButton\"]",
"score": 6,
"confidence": "high",
"reason": "stable test-id / accessibility attribute"
}
]
}
]This file is consumed by heal-cli and the GitHub Action for offline analysis and PR feedback.
Console output
[wdio-heal-service] ❌ Failed selector: "~loginButton"
Test: Login > should log in with valid credentials
Suggestions:
✅ [score 6] [accessibility-id="loginButton"] (stable test-id / accessibility attribute)
⚠️ [score 3] [content-desc="Login"] (stable test-id / accessibility attribute)
🔻 [score 1] //*[contains(@text, "Login")] (text-based fallback)Platform support
Works with both web (HTML DOM) and mobile (Appium XML page source). Platform is auto-detected from browser.capabilities.platformName.
