Skip to content

Commit cc9c25b

Browse files
committed
scroll-to: the horizontal pager beside scrolling down
Both examples now run on a device, each with before and after pictures on every surface: Settings scrolled down to System, and MobiumApp's Pager Demo scrolled right from Card 1 to Card 8. The pager's caption says what the picture shows: scroll-to stops as soon as Card 8 is in the pager's view and tappable, which there is its left edge.
1 parent 5b85b80 commit cc9c25b

6 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎data/runs.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"app_scroll_to[0]": {
7373
"tool": "app_scroll_to",
7474
"index": 0,
75+
"before": "/img/shots/app_scroll_to-0-before.jpg",
7576
"command": "mobium scroll-to text=System",
7677
"verbatim": true,
7778
"exit": 0,
@@ -634,5 +635,16 @@
634635
"output": "tapped testid=oneButtonBtn at (540, 877)\nanswered by a dialog rule on the way: \"Discard changes?\" — pressed \"Keep Editing\"",
635636
"caption": "With `mobium dialogs --when \"Discard changes\" --press \"Keep Editing\"` declared, `mobium tap testid=oneButtonBtn` met the Discard dialog in its way, pressed Keep Editing, and went on — its own alert is up, and the line under the title says what the app received — on an Android 15 emulator",
636637
"after": "/img/shots/app_dialogs-tap-testid-onebuttonbtn-after.jpg"
638+
},
639+
"app_scroll_to[1]": {
640+
"tool": "app_scroll_to",
641+
"index": 1,
642+
"before": "/img/shots/app_scroll_to-1-before.jpg",
643+
"command": "mobium scroll-to \"label=Card 8\" --direction right",
644+
"verbatim": true,
645+
"exit": 0,
646+
"output": "label=Card 8 is on screen after 7 scrolls right — @e5 Card 8 (button)",
647+
"caption": "`mobium scroll-to \"label=Card 8\" --direction right` on MobiumApp's Pager Demo, Android 15 emulator: from Card 1 to where Card 8 is in the pager's view and can be tapped — it stops as soon as it is, so here only Card 8's left edge shows, at the right",
648+
"after": "/img/shots/app_scroll_to-1-after.jpg"
637649
}
638650
}

‎scripts/capture.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ def app_screen(name):
6666
dict(tool="app_current", i=0),
6767
dict(tool="app_state", i=0),
6868
dict(tool="app_tap", i=0, setup=settings_root(), before=True, after=True),
69-
dict(tool="app_scroll_to", i=0, setup=settings_root(), after=True),
69+
dict(tool="app_scroll_to", i=0, setup=settings_root(), before=True, after=True),
70+
# The horizontal case, on MobiumApp's Pager Demo: Card 8 starts off screen
71+
# to the right, as mobium-app.sh checks.
72+
dict(tool="app_scroll_to", i=1, setup=app_screen("Pager Demo") + ["wait 'label=Card 1'"], before=True, after=True,
73+
caption="`mobium scroll-to \"label=Card 8\" --direction right` on MobiumApp's Pager Demo, Android 15 "
74+
"emulator: from Card 1 to where Card 8 is in the pager's view and can be tapped — it stops as soon "
75+
"as it is, so here only Card 8's left edge shows, at the right"),
7076
dict(tool="app_swipe", i=0, setup=settings_root(), before=True, after=True),
7177
dict(tool="app_batch", i=0, setup=settings_root(), files={"steps.json": "steps"}, after=True),
7278
dict(tool="app_press", i=1, setup=settings_root(), after=True),
-1.75 KB
Loading
30.9 KB
Loading
19.3 KB
Loading
18.2 KB
Loading

0 commit comments

Comments
 (0)