open-index/open-npm huggingface dataset:
npm package: @sir_hlony_letaoana/heal-cli
Description: CLI for offline self-healing selector analysis
Latest version: 0.1.1

# @sir_hlony_letaoana/heal-cli

CLI tool for offline self-healing selector analysis. Replays `heal-report.json` artifacts from `wdio-heal-service` and suggests replacement selectors.

## Install

```bash
npm install -g @sir_hlony_letaoana/heal-cli
# or use without installing:
npx @sir_hlony_letaoana/heal-cli <command>
```

## Commands

### `heal analyze <file>`

Analyse a `heal-report.json` produced by `wdio-heal-service`.

```bash
heal analyze reports/heal-report.json
heal analyze reports/heal-report.json --output enriched.json
```

Output:

```
[1] Login Flow > should log in with valid credentials
  Original: ~loginButton
  ✅  high  score=6  [accessibility-id="loginButton"]  (stable test-id / accessibility attribute)
  ⚠️   med  score=3  [content-desc="Login"]             (stable test-id / accessibility attribute)
  🔻  low  score=1  //*[contains(@text, "Login")]       (text-based fallback)
```

### `heal suggest <selector> --dom <file>`

Suggest healing alternatives for a raw selector against a saved DOM file.

```bash
heal suggest "~loginButton" --dom snapshots/page.xml
heal suggest "~loginButton" --dom snapshots/page.xml --max 3
```

### `heal candidates <dom-file>`

List all extractable candidate selectors from a DOM/page-source file.

```bash
heal candidates snapshots/page.xml
```

## Options

| Flag | Description |
|---|---|
| `-o, --output <path>` | Write enriched JSON output to file (`analyze` only) |
| `--dom <path>` | Path to DOM/page-source snapshot (`suggest` only, required) |
| `-n, --max <n>` | Max suggestions to show (default: 5) |

## CI usage

```bash
# In a GitHub Action or CI step after test run:
npx @sir_hlony_letaoana/heal-cli analyze reports/heal-report.json --output heal-output.json
```
npm package: @sir_hlony_letaoana/heal-core
Description: Core selector healing engine for WDIO self-healing toolkit
Latest version: 0.1.1

# @sir_hlony_letaoana/heal-core

Core selector healing engine for the WDIO self-healing toolkit.

Provides candidate extraction, scoring, and ranking logic used by `wdio-heal-service` and `heal-cli`.

## Install

```bash
npm install @sir_hlony_letaoana/heal-core
```

## API

### `heal(context, maxSuggestions?)`

Generates ranked selector suggestions from a DOM/page-source snapshot.

```ts
import { heal } from "@sir_hlony_letaoana/heal-core";

const result = heal({
  selector: "~loginButton",
  dom: "<hierarchy>...</hierarchy>",
  testName: "Login > should log in",
  platform: "android",
});

console.log(result.suggestions);
// [
//   { selector: '[accessibility-id="loginButton"]', score: 6, confidence: "high", reason: "..." },
//   ...
// ]
```

### `generateCandidates(dom)`

Extracts all candidate selectors from a DOM string.

```ts
import { generateCandidates } from "@sir_hlony_letaoana/heal-core";

const candidates = generateCandidates(dom);
```

### `extractSelectorFromError(error)`

Parses a selector string from a WDIO or Appium error message.

```ts
import { extractSelectorFromError } from "@sir_hlony_letaoana/heal-core";

const selector = extractSelectorFromError(error);
```

## Scoring model

| Signal | Weight |
|---|---|
| `data-testid` / `accessibility-id` | +5 |
| `resource-id` | +4 |
| `aria-label` / `content-desc` | +3 |
| `name` / `id` | +2 |
| Levenshtein similarity to original | 0–2 |
| Positional selector penalty | −3 |
| Text XPath penalty | −1 |

Confidence: `high` (score ≥ 5), `medium` (≥ 2), `low` (< 2).

## Types

```ts
interface SelectorFailureContext {
  selector: string;
  dom: string;
  testName: string;
  platform?: "web" | "android" | "ios";
  errorMessage?: string;
}

interface HealingSuggestion {
  selector: string;
  score: number;
  reason: string;
  confidence: "high" | "medium" | "low";
}

interface HealResult {
  original: string;
  suggestions: HealingSuggestion[];
  healedAt: number;
  testName: string;
}
```
npm package: @sir_hlony_letaoana/wdio-heal-reporter
Description: WDIO reporter that captures failures for the self-healing toolkit
Latest version: 0.1.1

# @sir_hlony_letaoana/wdio-heal-reporter

WDIO reporter that captures test failures and writes a structured `heal-failures.json` artifact for use with `heal-cli` and the GitHub Action.

## Install

```bash
npm install @sir_hlony_letaoana/wdio-heal-reporter
```

## Setup

Add to your `wdio.conf.ts`:

```ts
import type { Options } from "@wdio/types";

export const config: Options.Testrunner = {
  // ...
  reporters: [
    "spec",
    [
      "@sir_hlony_letaoana/wdio-heal-reporter",
      {
        outputDir: "reports",
      },
    ],
  ],
};
```

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `outputDir` | `string` | `"."` | Directory to write `heal-failures.json` |

## Output

Writes `heal-failures.json` to `outputDir` on run completion:

```json
[
  {
    "suite": "Login Flow",
    "test": "Login Flow > should log in with valid credentials",
    "error": "Element with selector '~loginButton' not found",
    "timestamp": 1712345678000
  }
]
```

## Usage with wdio-heal-service

Use both together for full coverage — the service generates healing suggestions, the reporter provides the structured failure log:

```ts
services: [['@sir_hlony_letaoana/wdio-heal-service', { outputPath: 'reports/heal-report.json' }]],
reporters: [['@sir_hlony_letaoana/wdio-heal-reporter', { outputDir: 'reports' }]],
```
npm package: @sir_hlony_letaoana/wdio-heal-service
Description: WDIO service plugin for self-healing selector suggestions
Latest version: 0.1.1

# @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

```bash
npm install @sir_hlony_letaoana/wdio-heal-service
```

## Setup

Add to your `wdio.conf.ts`:

```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:

```json
[
  {
    "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`.
npm package: @sir_koty/digit-formatter
Description: digit formatter by thousands with customable space character
Author: BLEU Koty
Latest version: 0.0.1

# DigitFormatter

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.7.

# Description

This library helps you to format all your numbers per thousand with a custom space character. By default the space character is ' '

# Demo

stackblitz : https://stackblitz.com/edit/format-number

# Usage 

### app.module.ts
...
    import { DigitFormatterModule} from '@sir_koty/digit-formatter';
...
    @NgModule({
    ...
    imports: [
        ...
        DigitFormatterModule,
        ...
    ],
    providers: [{ provide: FormErrorDisplayerService, useValue: service}],
    bootstrap: [AppComponent]
    })
    export class AppModule { }


### app.component.html
    ...
    <input type="text" libDigitFormatter spacingCaracter='.' />
    ...
npm package: @sir_koty/form-error-displayer
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
Latest version: 0.0.1

# FormErrorDisplayer

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.

## Description

This library allows you to display input error messages in an angular form, in a configurable way

## Installation 

Run `npm i @sir_koty/form-error-displayer`

## Usage

#### ==> app.module.ts

@import { FormErrorDisplayerModule, FormErrorDisplayerService } from '@sir_koty/form-error-displayer';
// Create your custom error message 
const errorList = [ {key: 'required_name' , message: 'name field is required' }, // key = error_key + formControlName (in reactive form)
                    {key: 'pattern_name' , message: 'the name field does not match to the pattern' }
]
const myCustService = new FormErrorDisplayerService(errorList);
@NgModule({
  ...
  imports: [
    ...
    FormErrorDisplayerModule,
    ...
  ],
  providers: [
      ...,
      { provider: FormErrorDisplayerService, useValue: myCustService }
  ]
  bootstrap: [AppComponent]
})
export class AppModule { }

####  ==> app.component.html

" div [formGroup]="myForm"
"   input id="xxx" libFormErrorDisplayer formControlName='name'  type='text'
" div

#### ==> app.component.ts

myForm: FormGroup;
constructor(private fb: FormBuilder) {
    this.myForm = fb.group({
        name: ['', [ Validators.required, Validators.pattern(/\d/)] ]
    })
}
npm package: @sir_koty/phone-formatter
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
Author: Koty BLEU
Latest version: 0.0.2

# @sir_koty/phone-formatter

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.

## Description

This library exposes a directive (libPhoneFormatter) that format the text entered like this 12345678 => 12 34 56 78

## Installation 

Run `npm i @sir_koty/phone-formatter`

## Usage
==> app.module.ts

@import { PhoneFormatterModule } from '@sir_koty/phone-formatter';
@NgModule({
  ...
  imports: [
    ...
    PhoneFormatterModule,
    ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

==> app.component.html

<input libPhoneFormatter type="text"/>