Skip to main content

Selenium adapter for Healify: heals broken selectors verified against the real DOM, no AI, no network.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

healify_selenium-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

healify_selenium-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file healify_selenium-0.1.0.tar.gz.

File metadata

  • Download URL: healify_selenium-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for healify_selenium-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7154f862c75f544b33740b09d27d60442d39bf0affb39ebbf93f38ffdb01a62a
MD5 f38801db254c40261d735aa9f8ed85bf
BLAKE2b-256 859d59e4d0b5340b27f0a5a8a0f11ebc4815d68929f228b367d9ec4559425645

See more details on using hashes here.

File details

Details for the file healify_selenium-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for healify_selenium-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55892004c504d3e25157aabb43a1744a09ac1072abcfee045e4829709640cff4
MD5 0a8e931ed3999a72f5e3c60da4a86afd
BLAKE2b-256 691d298fab6c96e319c0a0d0a8a57fc97563e44b910817e9b6295fc1ac1a1a45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page