Repository navigation
fix(wait): ignore an editable field's typed value in wait text - #4489
Conversation
After fill, wait text matched the field's own value and passed before the app stored anything. An editable node now satisfies wait text only by its identifier or by a label distinct from its value, in the snapshot path and the iOS runner's native findText, pinned by one golden table. Fixes #4479 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
5 issues found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="test/integration/provider-scenarios/android-find.test.ts">
<violation number="1" location="test/integration/provider-scenarios/android-find.test.ts:118">
P3: This comment incorrectly says only the identifier can satisfy `wait text`; the fixture's distinct `Search` label also matches editable fields. Mention both the identifier and labels distinct from the current value.</violation>
</file>
<file name="contracts/fixtures/wait-text-policy.json">
<violation number="1" location="contracts/fixtures/wait-text-policy.json:17">
P2: This golden table does not cover Android `EditText` nodes whose native type identifies them as editable but whose `editable` fact is absent. Add a type-based editable case and extend the shared fixture/test contract so the typed value is asserted not to match for that shape; otherwise the advertised policy is not pinned for all Android editable fields.</violation>
</file>
<file name="packages/contracts/src/wait.ts">
<violation number="1" location="packages/contracts/src/wait.ts:76">
P2: This drops a visible Android hint when Appium cannot report hint state: the producer retains the same text as both label and value, so the matcher removes the label and `wait text` times out. Preserve a hint-equal label when hint state is unknown.
(Based on your team's feedback about Android field metadata.)</violation>
</file>
<file name="packages/contracts/src/wait.test.ts">
<violation number="1" location="packages/contracts/src/wait.test.ts:8">
P3: This comment points contributors to a nonexistent Swift test file. Update it to `RunnerTests+InteractionTests.swift` so the cross-runtime golden-table test remains discoverable.</violation>
</file>
<file name="packages/command-surface/src/capture/wait.ts">
<violation number="1" location="packages/command-surface/src/capture/wait.ts:62">
P2: This description narrows the exclusion to user-typed values, but the matcher excludes the current value of every editable field, including prefilled or app-supplied content. Say that editable fields never match their current value, while non-editable nodes may match by value.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex SentinelVerdict: 4 finding(s): 4 minor. 🟡 Minor (4)
1 finding below Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment |
There was a problem hiding this comment.
Apex Sentinel: 4 new findings on 7ae01f9. The verdict and the full list are in the summary comment.
Move the wait text rule beside checkWaitText and decide editability with isNodeEditable, so an Android EditText without an editable fact (fallback or Appium) is covered and a disabled field's value still matches. A field whose value equals its placeholder is showing its hint, so it matches like any node; iOS reports an empty field that way. The runner predicate and the golden table follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Web captures publish no editable fact, so isFillableType decided and answered false for ARIA text inputs: editable=true missed web fields, fill warned it was attempting anyway, and wait text matched a web field's typed value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 14 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…dule A separate module added one eagerly evaluated module to every importer of the selectors entry, which the closure budget refuses. matchesWaitText now lives beside isNodeEditable, which the closure already evaluates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…wait text A field that reports its hint hidden holds typed text even when that text equals the placeholder. The placeholder comparison stays the fallback when the producer does not report hint state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Apex Sentinel could not review commit Apex Sentinel hit an internal error and could not finish this review. This is a problem on Sentinel's side, not with the change; if it keeps happening, tell whoever runs Sentinel for this repository. Push a new commit or comment |
|
@apex-sentinel-staging review |
|
This PR is ready at aa5c21b. I found no problems in the code. No conflicts. 21 of 22 checks pass. The only one not passing is an external review check that is still queued. It runs no build or test code, so the diff does not affect it. Nothing else must happen before merge. Not blocking, and you can take or leave these: (1) matchesWaitText reuses isNodeEditable, and isFillableType returns true for an empty type (https://github.com/callstack/agent-device/blob/aa5c21b/packages/selectors/src/internal/node.ts#L38), so an untyped node such as {label:"Total", value:"$5"} no longer satisfies I did not run the provider scenarios or the Swift unit test. I checked the regression by reading the old findNodeByLabel path. The Swift test evaluates NSPredicate against a dictionary, so whether XCUIElementQuery resolves placeholderValue the same way on a live element rests on your iOS live run at 1dcee88. The live iOS and Android runs are as you reported them. I did not re-run them. I also could not tell whether any producer emits untyped snapshot nodes, and I did not check whether the macOS lane that runs RunnerTests is part of required CI. |
Summary
After
fill,wait textmatched the field's own typed value and passed before Save/OK stored anything. Now an editable field never matches by its current value, or by a label repeating it (Android reports typed text as both), unless the value is its shown placeholder. Applies to every editable field. Editability comes fromisNodeEditable(theeditablefact, else the platform type). One rule in the snapshot path (matchesWaitText,@agent-device/selectors) and the iOS runner's nativefindText, pinned bycontracts/fixtures/wait-text-policy.json.Scope expansion:
isFillableTypetreats webtextbox/searchboxas fillable. Web captures have no editable fact, soeditable=truemissed web fields andfillwarned on them. 14 files; help and docs updated.Fixes #4479
Validation
Base
eec35e9, headb1790c1(live runs at the SHAs named below; later commits move the rule intointernal/node.tsand honorhintShowing, with no change to these runs).android-find.test.ts(no editable fact),ios-wait-selector.test.ts. Golden table in TS; Swift twin in the macOS host lane.benchad: 0.21.31 passes in 276 ms; head1dcee88times out (3012 ms)."First name"and empty-field placeholders match; the saved name matches in 103 ms.android-helper0.21.37-dev), Device name,fill bench-ad: 0.21.31 passes in 20 ms; headf1c0a01→wait_target_absent, still absent at the warning dialog, then matches the stored name in 116 ms.check:affected: CI validates the pushed head.🤖 Generated with Claude Code