fix: address the Maps search box by id, and re-prove Phase 5
The Maps omnibox hint rotates: it read "Search here" in the Phase 5 run and "Try petrol stations, ATMs" in the AUD-128 re-verification, so the recipe's text match on it failed. The resource id does not rotate. - internal/ui: add Find/FindID and the "id:" selector; Find dispatches an id: selector to the resource id and everything else to text as before. - internal/recipe: wait/tap/wait_gone/tap_if and the tap helper use Find, so a recipe may name a resource id. Guards stay text-only. - recipes/maps_navigate.recipe: wait/tap id:search_omnibox_text_box. - tests for the id selector; docs and README updated. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -245,14 +245,14 @@ func cmdDump(r *adb.Runner) error {
|
||||
|
||||
func cmdFind(r *adb.Runner, args []string) error {
|
||||
if len(args) != 1 {
|
||||
return fmt.Errorf("usage: artemis find <text>")
|
||||
return fmt.Errorf("usage: artemis find <text|id:resource_id>")
|
||||
}
|
||||
return ensurePhone(r, func() error {
|
||||
h, err := ui.Dump(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
matches := h.FindText(args[0], false)
|
||||
matches := h.Find(args[0], false)
|
||||
if len(matches) == 0 {
|
||||
return fmt.Errorf("no element matching %q", args[0])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user