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
14 changes: 12 additions & 2 deletions data/runs.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
"command": "mobium alert",
"verbatim": true,
"exit": 0,
"output": "a dialog is on screen: \"Discard changes?\\nThey will be lost.\"",
"output": "a dialog is on screen: \"Discard changes?\\nThey will be lost.\"\nbuttons: \"KEEP EDITING\", \"DISCARD\"",
"after": "/img/shots/app_alert-0-after.jpg"
},
"app_locale[0]": {
Expand Down Expand Up @@ -480,7 +480,7 @@
"command": "mobium alert accept",
"verbatim": true,
"exit": 0,
"output": "accepted the dialog \"Discard changes?\\nThey will be lost.\" — this answered it and did not choose an outcome: on a permission prompt accept and dismiss do not mean grant and deny, and on iOS they are the other way round. Tap the button by ref if you need a particular answer",
"output": "accepted the dialog \"Discard changes?\\nThey will be lost.\": pressed \"DISCARD\"",
"after": "/img/shots/app_alert-1-after.jpg"
},
"app_long_press:long-press testid=pressTarget": {
Expand Down Expand Up @@ -758,5 +758,15 @@
"verbatim": true,
"exit": 0,
"output": "saved …/heard.wav: 3.746s of audio: 0.0–0.5s silence, 0.5–0.6s sound, no one pitch (-46 dBFS), 0.6–2.6s 440 Hz (-42 dBFS), 2.6–3.7s silence — at media volume 5 of 15"
},
"app_alert[2]": {
"tool": "app_alert",
"index": 2,
"before": "/img/shots/app_alert-2-before.jpg",
"command": "mobium alert --button \"Don't Save\"",
"verbatim": true,
"exit": 0,
"output": "pressed \"DON'T SAVE\" on the dialog \"Save this draft?\\nYou can come back to it later.\"",
"after": "/img/shots/app_alert-2-after.jpg"
}
}
11 changes: 9 additions & 2 deletions examples/canonical.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,23 @@
],
"app_alert": [
{
"title": "Ask whether a system dialog is up, and what it says",
"title": "Ask whether a dialog is up, what it says, and its buttons",
"cli": "mobium alert",
"args": {}
},
{
"title": "Answer it with the platform's accept button",
"title": "Say yes to a dialog of one or two buttons",
"cli": "mobium alert accept",
"args": {
"action": "accept"
}
},
{
"title": "Press a button by its caption, on a dialog of three",
"cli": "mobium alert --button \"Don't Save\"",
"args": {
"button": "Don't Save"
}
}
],
"app_appearance": [
Expand Down
3 changes: 3 additions & 0 deletions examples/dotnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"code": "device.AnswerAlert(true);"
},
{
"code": "var pressed = device.PressAlertButton(\"Don't Save\");\nConsole.WriteLine($\"pressed {pressed}\");"
}
],
"app_appearance": [
Expand Down
3 changes: 3 additions & 0 deletions examples/go.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"code": "if err := dev.AnswerAlert(ctx, true); err != nil {\n\treturn err\n}"
},
{
"code": "pressed, err := dev.PressAlertButton(ctx, \"Don't Save\")\nif err != nil {\n\treturn err\n}\nfmt.Println(\"pressed\", pressed)"
}
],
"app_appearance": [
Expand Down
3 changes: 3 additions & 0 deletions examples/java.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"code": "device.answerAlert(true);"
},
{
"code": "String pressed = device.pressAlertButton(\"Don't Save\");\nSystem.out.println(\"pressed \" + pressed);"
}
],
"app_appearance": [
Expand Down
3 changes: 3 additions & 0 deletions examples/javascript.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"code": "await device.answerAlert(true)"
},
{
"code": "const result = await device.pressAlertButton(\"Don't Save\")\nconsole.log(`pressed ${result.pressed}`)"
}
],
"app_appearance": [
Expand Down
3 changes: 3 additions & 0 deletions examples/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"code": "device.answer_alert(accept=True)"
},
{
"code": "result = device.press_alert_button(\"Don't Save\")\nprint(\"pressed\", result[\"pressed\"])"
}
],
"app_appearance": [
Expand Down
1 change: 1 addition & 0 deletions scripts/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def app_screen(name):
dict(tool="app_alert", i=0, setup=app_screen("Dialog Demo") + ["tap 'text=Two-button alert'", "wait 'text=Discard changes?'"], after=True,
restore=["alert dismiss"]),
dict(tool="app_alert", i=1, setup=app_screen("Dialog Demo") + ["tap 'text=Two-button alert'", "wait 'text=Discard changes?'"], before=True, after=True),
dict(tool="app_alert", i=2, setup=app_screen("Dialog Demo") + ["tap 'text=Three-button alert'", "wait 'text=Save this draft?'"], before=True, after=True),
dict(tool="app_locale", i=0, after=False,
restore=["locale org.wikipedia ''"]),
dict(tool="app_locale", i=None, cmd="launch org.wikipedia",
Expand Down
Binary file modified static/img/shots/app_alert-0-after.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/shots/app_alert-1-after.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/img/shots/app_alert-1-before.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/shots/app_alert-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.
Binary file added static/img/shots/app_alert-2-before.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading