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.
63 lines
2.9 KiB
Plaintext
63 lines
2.9 KiB
Plaintext
# maps_navigate — search Google Maps for a place.
|
|
#
|
|
# Edit this file by hand. Steps name the text Artemis must find on screen; it
|
|
# taps the centre of the element it matched. There are no coordinates here on
|
|
# purpose, so this recipe survives a Maps redesign (FR-4).
|
|
#
|
|
# Run it with:
|
|
# artemis run maps_navigate query="Melbourne Museum"
|
|
|
|
task: maps_navigate
|
|
description: Search Google Maps for a place and show the matching result list.
|
|
app: com.google.android.apps.maps
|
|
|
|
# The caller must supply these.
|
|
param: query
|
|
|
|
step_timeout: 20s
|
|
total_timeout: 180s
|
|
|
|
# Screens Artemis must never tap on. Each one fails the run with the reason, so
|
|
# a wrong tap is impossible (FR-8). Maps on this phone is signed in, so the only
|
|
# screen that can get in the way of the search box is the account and settings
|
|
# sheet (labels taken from a live dump of that sheet).
|
|
guard "Manage your Google Account" => Maps is showing its account sheet; press back on the phone and retry
|
|
guard "Turn on Incognito mode" => Maps is showing its account sheet; press back on the phone and retry
|
|
|
|
steps:
|
|
# 1. Make sure Maps is up. Launching an app that is already open is a no-op,
|
|
# so this is safe to repeat.
|
|
- launch
|
|
- foreground 30s
|
|
|
|
# 2. Open the search box. The box is the EditText with resource id
|
|
# "search_omnibox_text_box". It is addressed by id, not by its label,
|
|
# because its label is a rotating hint: it reads "Search here" one day and
|
|
# "Try petrol stations, ATMs" the next, so a text match here broke in a
|
|
# re-verification run. The resource id is stable, and it is still a named
|
|
# match rather than a coordinate (FR-4). Tapping it opens the search screen
|
|
# with the box focused and a suggestions list below it.
|
|
- wait id:search_omnibox_text_box 30s retry 2
|
|
- tap id:search_omnibox_text_box
|
|
|
|
# 3. The search screen is a new screen, and the wedge check sits here. If the
|
|
# tap was delivered but Maps never acted on it, the screen does not change:
|
|
# expect_change waits a bounded time, then fails with the distinct reason
|
|
# "the app stopped consuming input". "retry 2" presses the tap again first,
|
|
# because a dropped tap is more common than a wedged app.
|
|
- expect_change 15s retry 2
|
|
|
|
# 4. Type the place name into the focused box. The suggestions list redraws
|
|
# underneath it.
|
|
- type "{query}"
|
|
|
|
# 5. Same wedge check for the typing: a wedged app draws its old screen, so
|
|
# the box keeps the old text and this fails on its own reason.
|
|
- expect_change 15s retry 2
|
|
|
|
# 6. The result list must name the place the caller asked for. The first
|
|
# suggestion row for the query carries the place as its title and as the
|
|
# label of its own row button ("Activate to enter suggestion <place> into
|
|
# search bar"), so a match here is a real suggestion row, not an empty box.
|
|
- wait "{query}" 30s else "the Maps result list did not name the place"
|