Skip to main content

Semantic intent-based self-healing test locators for QE and test automation

Project description

CANVAS

Context-Aware Navigation and Visual Anchoring System for Selectors

An open source research prototype for semantic intent-based self-healing test locators, built for the QE and test automation community.

Why CANVAS

Existing self-healing tools use attribute-based matching — CSS selectors, XPath, element IDs, class names. These break whenever a UI undergoes structural redesign, even when the element's function is unchanged.

CANVAS takes a different approach: semantic intent anchoring. At record time it encodes what an element does — its role, accessible label, workflow position, and surrounding context — into a dense vector using a local sentence-transformers model. At runtime it embeds live DOM candidates and finds the nearest semantic match, then gates the decision:

  • Auto-heal if confidence is high enough
  • Request human confirmation if confidence is in a grey zone
  • Fail explicitly if no confident match exists

This means a "Submit Order" button that moves from a sidebar to a modal, or gets its ID changed from #btn-submit to #cta-primary, can still be found — because its intent is preserved even when its address is not.

Status

All 4 phases complete. The core pipeline (descriptor, embedder, confidence-gated resolver) is implemented and tested, and the adversarial test suite covering DOM restructuring, attribute churn, semantic paraphrase, and false-positive detection is in place — all tests passing.

Roadmap

Phase Name Status
1 Semantic Element Descriptor Complete
2 Intent Embedding Complete
3 Confidence-Gated Resolver Complete
4 Adversarial Testing Complete

Structure

canvas/         — core source code
  descriptor.py — DOM element descriptor extraction
  embedder.py   — sentence-transformers embedding pipeline
  resolver.py   — confidence-gated semantic resolver + SQLite intent store
tests/          — unit tests and adversarial test scenarios
docs/           — technical documentation

Quick Start

pip install -r requirements.txt
python -m playwright install chromium
python -m pytest tests/ -v

Contributing

CANVAS is in early prototype stage. Community feedback, issues, and pull requests are welcome once Phase 4 (adversarial testing) is complete. Watch the repo or open a discussion if you want to get involved earlier.

License

MIT — see 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

canvas_heal-0.2.0.tar.gz (72.2 kB view details)

Uploaded Source

Built Distribution

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

canvas_heal-0.2.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file canvas_heal-0.2.0.tar.gz.

File metadata

  • Download URL: canvas_heal-0.2.0.tar.gz
  • Upload date:
  • Size: 72.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for canvas_heal-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7e07032ff41263e9e0dae8b086efdb43c1ebb58195a6270322b6587b4475a7e2
MD5 4d40716da318aedb2194e7c503b95946
BLAKE2b-256 48047bd43c7730c37b1526fc33a4dad6e452ba221a1d43f18e257e46aac43f92

See more details on using hashes here.

File details

Details for the file canvas_heal-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: canvas_heal-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for canvas_heal-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a23b7f1da9177c0446d26051d72cd1ce751673237bfe0cfec728d860ed8def21
MD5 2db8dc506ed51bd073aad7146f6bd091
BLAKE2b-256 baf290a0bdb0900cdb75cb357cccbae87a048296713c01fa0ef4f9650e3734ab

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