Skip to content

A recording names what map named: quoted locators, and text for a page element with no id (CHALLENGES 314) - #207

Merged
lana-20 merged 1 commit into
mainfrom
inspect-locators
Oct 13, 2026
Merged

lana-20 merged 1 commit into
mainfrom
inspect-locators

Conversation

@lana-20

@lana-20 lana-20 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

These are the two leads written into ROADMAP's "A recording as code" (#202). Both were confirmed in the code, then fixed.

  • Quotes were dropped. `map` derives every native locator as the whole value and checks that it names one element. The inspector rebuilt it without `Exact`, so it recorded `text=Welcome`, which "Welcome back" meets too: the race of CHALLENGES 233. Recordings now quote each locator, e.g. `testid="username"`.
  • Refs were recorded. A page element with no `id` or `data-testid` had no locator, so the recorder wrote its ref, which names it on that screen only. That covers most links on a real page. `map` now gives such an element the locator its whole text names it by, adding its role where the text names several. It is checked against the page the way a locator is resolved (Locators inside a WebView, and find answering from the page (CHALLENGES 312) #204). Only an element that nothing names alone still gets a ref.

Checked in Safari on the iPhone 17 Pro simulator:

  • example.com's link mapped as `text="Learn more"`, and a tap by it went to iana.org.
  • The inspector, driven through its own page's calls, showed that target and recorded `{"tap": "text="Learn more""}`.
  • `frames.sh`, `web-actionability.sh` and `ios-webview.sh` passed.

The inspector guide gets a dated note. Its 2026-09-29 example is real output, so it is left as it is. New unit tests: `TestARecordedLocatorKeepsItsQuotes` and `TestAPageElementWithNoIDGetsALocator`. `make ci` passes.

…ement with no id gets its text as a locator, not a ref (CHALLENGES 314)
@lana-20
lana-20 merged commit 027bb47 into main Oct 13, 2026
3 checks passed
@lana-20
lana-20 deleted the inspect-locators branch October 13, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant