|
1 | | -# Swipe and gesture-based interactions. |
2 | | -# Tests: open, snapshot -i, swipe (with duration, count, pattern), scroll (direction + amount), |
3 | | -# back, wait, is exists, click, screenshot. |
4 | | -# Note: Coordinates target Pixel 7 emulator (~411x914 logical dp). |
| 1 | +# Swipe gestures. |
5 | 2 | context platform=android timeout=60000 retries=2 |
6 | 3 |
|
7 | 4 | open settings --relaunch |
8 | 5 | snapshot -i |
9 | 6 | is exists "label=Display || label=Battery || label=Apps || label=\"Network & internet\" || label=\"Network and internet\"" |
10 | 7 |
|
11 | | -# --- Swipe-scroll down through the Settings list --- |
12 | | -# Swipe from lower-center to upper-center to scroll down |
13 | 8 | swipe 206 700 206 250 300 |
14 | 9 | wait 500 |
15 | 10 | snapshot -i |
16 | 11 |
|
17 | | -# Swipe with repeat count |
18 | 12 | swipe 206 650 206 300 300 --count 2 --pause-ms 200 --pattern one-way |
19 | 13 | wait 500 |
20 | 14 | snapshot -i |
21 | 15 |
|
22 | | -# --- Scroll back to top using scroll command --- |
23 | 16 | scroll up 5 |
24 | 17 | wait 500 |
25 | 18 | snapshot -i |
26 | 19 | is exists "label=\"Network & internet\" || label=\"Network and internet\" || label=Apps || label=Notifications || label=\"Connected devices\"" |
27 | 20 |
|
28 | | -# --- Navigate into Display for gesture-based back --- |
29 | 21 | click "label=Display" |
30 | 22 | wait "label=Brightness || label=\"Brightness level\" || label=\"Dark theme\" || label=\"Screen timeout\"" 5000 |
31 | 23 | is exists "label=Brightness || label=\"Brightness level\" || label=\"Dark theme\" || label=\"Screen timeout\"" |
32 | 24 | screenshot "./test/screenshots/replays/android-swipe-before-back.png" |
33 | 25 |
|
34 | | -# --- Swipe from left edge for back gesture --- |
35 | 26 | swipe 10 450 300 450 300 |
36 | 27 | wait "label=Display || label=Battery || label=Apps" 3000 |
37 | 28 | snapshot -i |
38 | 29 | is exists "label=Display || label=Battery || label=Apps" |
39 | 30 |
|
40 | | -# --- Navigate in again and scroll within sub-screen --- |
41 | 31 | click "label=Display" |
42 | 32 | wait "label=Brightness || label=\"Brightness level\" || label=\"Dark theme\" || label=\"Screen timeout\"" 5000 |
43 | 33 |
|
44 | | -# Scroll down inside Display settings |
45 | 34 | scroll down 2 |
46 | 35 | snapshot -i |
47 | 36 | screenshot "./test/screenshots/replays/android-swipe-scroll.png" |
|
0 commit comments