[Design] Self-Healing Locators for Datagrok UI Tests - #3776
Draft
LesiaPavlenko wants to merge 1 commit into
Draft
Conversation
See PR_DESCRIPTION.md for the rollout plan and review focus. This PR is design-only; no executable code lands here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Design] Self-Healing Locators for Datagrok UI Tests
TL;DR
UI tests in Datagrok (package tests on Puppeteer, plus a growing Playwright E2E
suite) break when the DOM, CSS, or labels shift. This proposal introduces a
two-phase self-healing locator system:
deterministic resolver walks a 4-tier priority hierarchy (semantic IDs →
stable structural → text content → visual/positional) using a
fingerprint captured during green test runs. A confidence score gates
the outcome: high → heal silently, mid → heal + flag for review, low →
fail the test.
unresolved cases land in a queue. A separate tool prompts Claude with the
fingerprint + accessibility tree, validates each proposed selector against
a live page in headless Puppeteer/Playwright, and opens a follow-up PR
with codemod'd test source updates.
The two phases share one fingerprint schema, one confidence model, and one
audit log format. The LLM is the last resort, not the first move.
What's in this PR (design only)
Decisions baked into this proposal
libraries/self-healing-locators+tools/self-healing-cli01-design.md04-runtime-flow.md,05-offline-flow.md05-offline-flow.md05-offline-flow.md§ "Model selection"libraries/self-healing-locators/registry/(not in this PR)02-fingerprint-spec.md§ "Storage"healing.anchor()API)api/healing-api.md02-fingerprint-spec.md§ "Visual layer"04-runtime-flow.md05-offline-flow.md§ "Codemod & PR"Review focus
Please read in this order — each doc is short and self-contained:
01-design.md— confirm overall shape and component boundaries07-policy.md— confirm the "what we heal vs what we let fail" boundary02-fingerprint-spec.md— confirm the schema before we lock it inprompts/system.md+prompts/user-template.md— confirm the contract with Claude03-confidence-model.md— confirm the weights and thresholds (these are calibratable, not hardcoded forever)Explicit non-goals
Any
getWidgetStatus()extensions or newdata-testidconventions arenoted as recommendations in
06-datagrok-integration.md, to be addressedseparately.
and test logic are out of scope. See
07-policy.mdfor the rationale.Open questions (please flag in review)
sibling directory, or in a single central registry? See
02-fingerprint-spec.md§ "Storage" for trade-offs.per week before we treat it as a signal that the platform needs more
stable test IDs?
reviewer? Test author? QA team? Code owners of the affected package?
pauses and asks for human approval.
After this PR is approved
libraries/self-healing-locatorscore types + fingerprint capturetools/self-healing-cliskeleton + Claude clientEach step is independently reviewable and shippable behind a feature flag.