healify-selenium
Adapter de Python para Healify: cuando
find_element falla, sondea el DOM real de la página, pide una curación verificada al
motor de Healify y reintenta antes de fallar el test. Local y sin IA — heurística +
verificación contra la página, nunca inventa un selector.
Instalación
pip install healify-selenium
También necesitás Node.js instalado y @healify/cli accesible por npx en tu proyecto:
npm install --save-dev @healify/cli
Este paquete es un cliente delgado: no reimplementa la heurística, llama al motor real de
Healify (@healify/cli heal/probe-script) vía subproceso.
Uso
from selenium import webdriver
from selenium.webdriver.common.by import By
from healify_selenium import HealifySeleniumWrapper
driver = webdriver.Chrome()
healify = HealifySeleniumWrapper(driver, project_root=".")
el = healify.find_element(By.CSS_SELECTOR, "#comprar-ahora-a1b2c3")
el.click()
for event in healify.events:
print(event)
Si el selector se rompió, find_element sondea la página (mismo script que usan los
plugins de Selenium/WebdriverIO en JS), pide una curación y reintenta con lo que devuelva —
por CSS o XPath, según corresponda. Si nada sirve, deja pasar el NoSuchElementException
original tal cual, sin inventar nada.
Opciones
HealifySeleniumWrapper(
driver,
project_root=".", # dónde vive @healify/cli y .healify/history.jsonl
confidence_threshold=0.9, # piso de confianza para probar una sugerencia
dry_run=False, # curar pero nunca aplicar (solo registra el evento)
record_history=True, # grabar curaciones verificadas en .healify/history.jsonl
)
healify.current_test_file = "tests/test_checkout.py" (opcional, por ejemplo en un fixture
de pytest) permite que el repertorio compartido scopee por archivo, igual que hacen
Playwright/Cypress en JS.
El repertorio es compartido entre lenguajes
.healify/history.jsonl usa el mismo formato en todos los adapters (JS, Python, Java, C#):
una curación verificada en Playwright puede resolver un selector roto en un test de Python
sin sondear nada, si corren contra el mismo repo.
Qué NO hace
Envuelve solo find_element — no cada método de interacción de Selenium (mismo alcance
acotado que @healify/selenium-plugin en JS). No genera healify-report.html/json/md; eso
queda para una integración más completa, más adelante.
Verificado
De punta a punta con Selenium 4.46 + Chrome real (Selenium Manager resuelve el
chromedriver solo, sin configuración).
Licencia
MIT. Ver LICENSE.
Metadata
Release files for healify-selenium 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| healify_selenium-0.1.0.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| healify_selenium-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.9 kB
Release files / healify_selenium-0.1.0.tar.gz
| Download URL | healify_selenium-0.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7154f862c75f544b33740b09d27d60442d39bf0affb39ebbf93f38ffdb01a62a
|
|
BLAKE2b-256 checksum How to use checksums |
859d59e4d0b5340b27f0a5a8a0f11ebc4815d68929f228b367d9ec4559425645
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / healify_selenium-0.1.0-py3-none-any.whl
| Download URL | healify_selenium-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55892004c504d3e25157aabb43a1744a09ac1072abcfee045e4829709640cff4
|
|
BLAKE2b-256 checksum How to use checksums |
691d298fab6c96e319c0a0d0a8a57fc97563e44b910817e9b6295fc1ac1a1a45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|