fix(chrome): a hint target is not tapped by the placeholder attribute

TapSelector is a third resolver, and it built [placeholder="..."] for
hintText and placeholderValue too. Now that both matchers read the
accessible-name ladder, that CSS names a field whose hint is its
aria-label and whose placeholder happens to carry the value, which is an
element neither matcher named.

No CSS says what the ladder says, so both keys fall through to a match
that reaches nothing and the step fails naming the selector, the way
every other derived key in this file already does. A selector reaches
here only where the dump resolved it to no coordinates at all.
This commit is contained in:
pj committed 2026-08-19 10:37:03 +05:30
1 parent 6e551e9559
commit f02a65772b
2 files changed
+16 -1

No files matched your search

+7
View File
@@ -44,6 +44,13 @@ func TestTranslateStringSelector_KnownKeys(t *testing.T) {
{"testTag:submit", `:is([data-testid="submit"], [id="submit"])`, false},
{"testID:submit", `[data-testid="submit"]`, false},
{"placeholder:Email", `[placeholder="Email"]`, false},
// hintText and placeholderValue name the accessible-name ladder, which
// no CSS says, so they reach nothing here rather than the field whose
// placeholder happens to carry the value and whose hint is its
// aria-label. Both matchers name that field by its aria-label alone, so
// a tap by placeholder acts on an element nobody selected.
{"hintText:Email", `[hintText*="Email"]`, false},
{"placeholderValue:Email", `[placeholderValue*="Email"]`, false},
}
for _, testCase := range cases {
got, isXPath, err := TranslateStringSelector(testCase.selector)