mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
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:
1 parent
6e551e9559
commit
f02a65772b
2 files changed
+16
-1
No files matched your search
@@ -64,7 +64,15 @@ func TranslateStringSelector(selector string) (string, bool, error) {
|
||||
return `:is([data-testid="` + escaped + `"], [id="` + escaped + `"])`, false, nil
|
||||
case "testID", "testid", "data-testid":
|
||||
return `[data-testid="` + cssEscape(value) + `"]`, false, nil
|
||||
case "placeholder", "placeholderValue", "hintText":
|
||||
case "placeholder":
|
||||
// The attribute the markup writes. hintText and placeholderValue name
|
||||
// the accessible-name ladder above it instead (fieldHint in driver.go),
|
||||
// which no CSS says, so they fall through to a match that reaches
|
||||
// nothing and the step fails by name. Building this selector for them
|
||||
// tapped a field whose hint is its aria-label and whose placeholder
|
||||
// happens to carry the value, which is an element neither matcher
|
||||
// names: a selector reaches here only where the dump resolved it to no
|
||||
// coordinates at all.
|
||||
return `[placeholder="` + cssEscape(value) + `"]`, false, nil
|
||||
default:
|
||||
if !attrNamePattern.MatchString(kind) {
|
||||
|
||||
Reference in new issue
Block a user