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
10 changes: 10 additions & 0 deletions data/runs.json
Original file line number Diff line number Diff line change
Expand Up @@ -732,5 +732,15 @@
"output": "tapped testid=busyRowB at (540, 1095)\ngray box: waited 307 ms for the app to go idle (busy: quiet)",
"caption": "`mobium tap testid=busyRowB` on MobiumApp's Busy Demo, Android 15 emulator, launched with `--gray-box`: the tap waited for the quiet refresh to finish, and Row B is the new generation's",
"after": "/img/shots/app_tap-3-after.jpg"
},
"app_hook[0]": {
"tool": "app_hook",
"index": 0,
"command": "mobium hook raiseToast \"Toast raised by test script\"",
"verbatim": true,
"exit": 0,
"output": "hook raiseToast answered: \"shown\"\ngray box: the app was idle",
"caption": "`mobium hook raiseToast \"Toast raised by test script\"` on MobiumApp, Android 15 emulator, launched with `--gray-box`: the app's own toast says what the hook was sent",
"after": "/img/shots/app_hook-0-after.jpg"
}
}
12 changes: 12 additions & 0 deletions examples/canonical.json
Original file line number Diff line number Diff line change
Expand Up @@ -903,5 +903,17 @@
"name": "mobium-test"
}
}
],
"app_hook": [
{
"title": "Call a hook the app registered, and get back what it answered",
"cli": "mobium hook raiseToast \"Toast raised by test script\"",
"args": {
"hook": "raiseToast",
"args": [
"Toast raised by test script"
]
}
}
]
}
5 changes: 5 additions & 0 deletions examples/dotnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
{
"code": "device.Shutdown(\"mobium-test\");"
}
],
"app_hook": [
{
"code": "device.LaunchWithGrayBox(\"dev.mobium.mobiumapp\");\nvar answer = device.Hook(\"raiseToast\", \"Toast raised by test script\"); // \"shown\""
}
]
},
"members": {
Expand Down
5 changes: 5 additions & 0 deletions examples/go.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
{
"code": "if err := dev.Shutdown(ctx, \"mobium-test\"); err != nil {\n\treturn err\n}"
}
],
"app_hook": [
{
"code": "if err := dev.LaunchWithGrayBox(ctx, \"dev.mobium.mobiumapp\"); err != nil {\n\treturn err\n}\nanswer, err := dev.Hook(ctx, \"raiseToast\", \"Toast raised by test script\")\nif err != nil {\n\treturn err\n}\nfmt.Println(answer) // shown"
}
]
},
"members": {
Expand Down
5 changes: 5 additions & 0 deletions examples/java.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
{
"code": "device.shutdown(\"mobium-test\");"
}
],
"app_hook": [
{
"code": "device.launchWithGrayBox(\"dev.mobium.mobiumapp\");\nObject answer = device.hook(\"raiseToast\", \"Toast raised by test script\"); // \"shown\""
}
]
},
"members": {
Expand Down
5 changes: 5 additions & 0 deletions examples/javascript.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
{
"code": "await device.shutdown('mobium-test')"
}
],
"app_hook": [
{
"code": "await device.launch('dev.mobium.mobiumapp', { grayBox: true })\nconsole.log(await device.hook('raiseToast', 'Toast raised by test script')) // shown"
}
]
},
"members": {
Expand Down
5 changes: 5 additions & 0 deletions examples/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
{
"code": "device.shutdown(\"mobium-test\")"
}
],
"app_hook": [
{
"code": "device.launch(\"dev.mobium.mobiumapp\", gray_box=True)\nprint(device.hook(\"raiseToast\", \"Toast raised by test script\")) # shown"
}
]
},
"members": {
Expand Down
4 changes: 4 additions & 0 deletions scripts/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def app_screen(name):
dict(tool="app_launch", i=0, setup=[f"terminate {SETTINGS}"], after=True),
# MobiumApp links Mobium's gray-box library; the launch says the app answered.
dict(tool="app_launch", i=1, setup=[f"terminate {APP}"]),
# A gray-box hook: MobiumApp's raiseToast draws its message in a toast.
dict(tool="app_hook", i=0, setup=[f"terminate {APP}", f"launch --gray-box {APP}"], after=True,
caption="`mobium hook raiseToast \"Toast raised by test script\"` on MobiumApp, Android 15 emulator, "
"launched with `--gray-box`: the app's own toast says what the hook was sent"),
dict(tool="app_map", i=0, setup=settings_root(), after=True),
dict(tool="app_text", i=0, setup=settings_root(), after=True),
dict(tool="app_find", i=0, setup=settings_root(), after=True),
Expand Down
Binary file added static/img/shots/app_hook-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.
Loading