Skip to content

DX: failure triage + selector discovery (kill the read-the-XML-and-guess loop) #23

Description

@BenSheridanEdwards

What

Two related authoring/debugging gaps vs Playwright/Cypress, both rooted in the same tax: you must read page-source XML and guess the exact string, and an off-by-a-capital / trailing-space mismatch fails as a silent timeout identical to a genuinely-absent element.

A. Failure triage

On failure, onFailure/captureState writes page-source + screenshot, and the README documents a manual loop: "fail → grep -oE 'text=\"[^\"]+\"' the source for the real label → match it exactly." There's no Playwright-trace-viewer / Cypress-time-travel equivalent.

Cheap first step (high value, small): when a locator assertion times out, auto-dump the failing selector plus the nearest candidate labels from the live source — a "did you mean Open info and settings?" — so the exact-string mismatch is obvious without manual grep. The locator layer already extracts text/content-desc/label nodes; surface the closest few by string distance in the error.

Larger: a bundled per-run trace (per-step source + screenshot + the locator that ran + frames seen) viewable after the fact. Big build — scope separately; the cheap step above covers ~80% of triage.

B. Selector discovery

Authoring a selector means reading the XML and guessing. Playwright codegen and the Cypress selector playground remove this. Even a read-only nativeproof inspect (or --inspect) that prints candidate getByText / getByLabel / getByRole(...) for the current screen would cut authoring time and the silent-timeout class of bugs.

Why it matters

This is the single biggest DX gap vs the web tools for native work, where you can't just open devtools. The "fail → read the real attribute → match it" loop is behind most "element not found" mysteries (the README says as much).

Suggested order

  1. Nearest-candidate "did you mean" in locator timeout errors (small, in-package, testable on the fake driver).
  2. nativeproof inspect read-only selector dump for the live screen.
  3. (Stretch) per-run trace artifact + viewer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions