Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions data/runs.json
Original file line number Diff line number Diff line change
Expand Up @@ -777,5 +777,30 @@
"exit": 0,
"output": "asked Google Assistant (typed, not spoken): \"Open Clock\"\nit showed no text a screen read can see\nin front: com.google.android.deskclock\ncom.google.android.deskclock came forward",
"after": "/img/shots/app_assistant-0-after.jpg"
},
"app_speech[2]": {
"tool": "app_speech",
"index": 2,
"command": "mobium speech label=Pro",
"verbatim": true,
"exit": 0,
"output": "TalkBack says: \"not checked. Pro. Radio button\" — Pro (radio)",
"after": "/img/shots/app_speech-2-after.jpg"
},
"app_speech[0]": {
"tool": "app_speech",
"index": 0,
"command": "mobium speech",
"verbatim": true,
"exit": 0,
"output": "TalkBack says: \"not checked. Pro. Radio button\" — Pro (radio)"
},
"app_speech[1]": {
"tool": "app_speech",
"index": 1,
"command": "mobium speech --walk --limit 20",
"verbatim": true,
"exit": 0,
"output": "TalkBack says:\n 1. \"not checked. Team. Radio button\" — Team (radio)\n 2. \"OFF. Dark mode. Switch\" — Dark mode (switch)\n 3. \"Dark mode, for the whole app\" — Dark mode, for the whole app, not in map\n 4. \"Read-only\" — Read-only, not in map\n 5. \"This field cannot be edited. Edit box. disabled\"\n 6. \"notify=false terms=false plan=free theme=light\" — notify=false terms=false plan=free theme=light, not in map\n 7. (nothing)\n 8. \"Back. Button\" — Back (button)\n 9. \"Form\" — Form, not in map\n 10. \"not checked. Email me. Check box\" — Email me (checkbox)\n 11. \"not checked. Accept terms. Check box\" — Accept terms (checkbox)\n 12. \"checked. Free. Radio button\" — Free (radio)\n 13. \"not checked. Pro. Radio button\" — Pro (radio)\nended: the cursor came back round to the first element"
}
}
22 changes: 22 additions & 0 deletions examples/canonical.json
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,28 @@
}
}
],
"app_speech": [
{
"title": "Say what the screen reader says about the element its cursor is on",
"cli": "mobium speech",
"args": {}
},
{
"title": "Walk the screen in the screen reader's order, each sentence beside its element",
"cli": "mobium speech --walk --limit 20",
"args": {
"walk": true,
"limit": 20
}
},
{
"title": "Put the screen reader's cursor on an element, and hear what it says",
"cli": "mobium speech label=Pro",
"args": {
"target": "label=Pro"
}
}
],
"app_hit_test": [
{
"title": "Ask where a tap on an element would really land",
Expand Down
11 changes: 11 additions & 0 deletions examples/dotnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,17 @@
"code": "var got = device.Assistant(\"What is 15 times 3\", timeoutSeconds: 20);\nConsole.WriteLine(got[\"answer\"]);"
}
],
"app_speech": [
{
"code": "var said = device.Speech();\nConsole.WriteLine(said[\"steps\"]);"
},
{
"code": "var walk = device.Speech(walk: true, limit: 20);\nConsole.WriteLine($\"{walk[\"steps\"]} ended {walk[\"ended\"]}\");"
},
{
"code": "var said = device.Speech(\"label=Pro\");\nConsole.WriteLine(said[\"steps\"]);"
}
],
"app_hit_test": [
{
"code": "var hit = device.HitTest(\"testid=submit\");\nConsole.WriteLine(hit[\"reaches\"]);"
Expand Down
11 changes: 11 additions & 0 deletions examples/go.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,17 @@
"code": "got, err := dev.Assistant(ctx, \"What is 15 times 3\", mobium.AssistantOptions{Timeout: 20 * time.Second})\nif err != nil {\n\treturn err\n}\nfmt.Println(got.Answer)"
}
],
"app_speech": [
{
"code": "said, err := dev.Speech(ctx, mobium.SpeechOptions{})\nif err != nil {\n\treturn err\n}\nfmt.Println(said.Steps[0].Said)"
},
{
"code": "walk, err := dev.Speech(ctx, mobium.SpeechOptions{Walk: true, Limit: 20})\nif err != nil {\n\treturn err\n}\nfor _, step := range walk.Steps {\n\tfmt.Println(step.Said)\n}\nfmt.Println(\"ended:\", walk.Ended)"
},
{
"code": "said, err := dev.Speech(ctx, mobium.SpeechOptions{Target: \"label=Pro\"})\nif err != nil {\n\treturn err\n}\nfmt.Println(said.Steps[0].Said)"
}
],
"app_hit_test": [
{
"code": "hit, err := dev.HitTest(ctx, \"testid=submit\")\nif err != nil {\n\treturn err\n}\nfmt.Println(hit.Reaches)"
Expand Down
11 changes: 11 additions & 0 deletions examples/java.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,17 @@
"code": "Map<String, Object> got = device.assistant(\"What is 15 times 3\", null, 20);\nSystem.out.println(got.get(\"answer\"));"
}
],
"app_speech": [
{
"code": "Map<String, Object> said = device.speech(null, false, 0);\nSystem.out.println(said.get(\"steps\"));"
},
{
"code": "Map<String, Object> walk = device.speech(null, true, 20);\nSystem.out.println(walk.get(\"steps\") + \" ended \" + walk.get(\"ended\"));"
},
{
"code": "Map<String, Object> said = device.speech(\"label=Pro\", false, 0);\nSystem.out.println(said.get(\"steps\"));"
}
],
"app_hit_test": [
{
"code": "Map<String, Object> hit = device.hitTest(\"testid=submit\");\nSystem.out.println(hit.get(\"reaches\"));"
Expand Down
11 changes: 11 additions & 0 deletions examples/javascript.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,17 @@
"code": "const got = await device.assistant('What is 15 times 3', { timeout: 20 })\nconsole.log(got.answer)"
}
],
"app_speech": [
{
"code": "const said = await device.speech()\nconsole.log(said.steps)"
},
{
"code": "const walk = await device.speech({ walk: true, limit: 20 })\nconsole.log(walk.steps, walk.ended)"
},
{
"code": "const said = await device.speech({ target: 'label=Pro' })\nconsole.log(said.steps)"
}
],
"app_hit_test": [
{
"code": "const hit = await device.hitTest('testid=submit')\nconsole.log(hit.reaches)"
Expand Down
11 changes: 11 additions & 0 deletions examples/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,17 @@
"code": "got = device.assistant(\"What is 15 times 3\", timeout=20)\nprint(got[\"answer\"])"
}
],
"app_speech": [
{
"code": "said = device.speech()\nprint(said[\"steps\"][0][\"said\"])"
},
{
"code": "walk = device.speech(walk=True, limit=20)\nfor step in walk[\"steps\"]:\n print(step[\"said\"], step.get(\"element\", {}).get(\"label\"))"
},
{
"code": "said = device.speech(\"label=Pro\")\nprint(said[\"steps\"])"
}
],
"app_hit_test": [
{
"code": "hit = device.hit_test(\"testid=submit\")\nprint(hit[\"reaches\"])"
Expand Down
9 changes: 9 additions & 0 deletions scripts/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ def app_screen(name):
# terminated first, so the picture shows the assistant bringing it forward.
dict(tool="app_assistant", i=0, setup=["terminate com.google.android.deskclock", "press home"], after=True,
pause=2.0, restore=["terminate com.google.android.deskclock", "press home"]),
# The screen reader on the Form Demo, TalkBack turned on after the screen
# is up. The cursor is put on Pro first, so the picture shows TalkBack's
# green rectangle there and the plain read after it says Pro; the walk
# goes last, and TalkBack goes off. Needs TalkBack's log output level at
# VERBOSE, which is TalkBack's own setting: set it there before, and back.
dict(tool="app_speech", i=2, setup=app_screen("Form Demo") + ["wait label=Pro", "accessibility screen_reader on",
"$sleep 3"], after=True, pause=1.0),
dict(tool="app_speech", i=0),
dict(tool="app_speech", i=1, restore=["accessibility screen_reader off"]),
dict(tool="app_list_apps", i=0),
dict(tool="app_contexts", i=0, setup=app_screen("WebViews") + ["tap 'text=Plain page'", "wait text=Back"],
after=True),
Expand Down
Binary file added static/img/shots/app_speech-2-after.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading