FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnative/tests/e2e/flows/components/scroll_view.yaml at main · pythonnative/pythonnative · GitHub
pythonnative
pythonnative
Repository navigation
Code
Issues
11
(11)
Pull requests
5
(5)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnative
/
tests
/
e2e
/
flows
/
components
/
scroll_view.yaml
Copy path
More file actions
More file actions
Latest commit
History
History
History
85 lines (85 loc) · 3.45 KB
Breadcrumbs
pythonnative
/
tests
/
e2e
/
flows
/
components
/
scroll_view.yaml
Copy path
File metadata and controls
85 lines (85 loc) · 3.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
Tests ScrollView reveals rows that started off-screen after scrolling, that
#
on_scroll delivers a ScrollEvent, and that a horizontal ScrollView with
#
content_container_style / snap_to_interval reports on_scroll_begin_drag.
#
#
Demo screen: examples/e2e-suite/app/screens/components/scroll_view.py
#
Source under test: src/pythonnative/components/layout.py :: ScrollView
#
#
The demo sizes the inner ScrollView (~400 dp) so it overlaps the
#
vertical center of the screen on both the iOS and Android CI
#
emulators. That lets us use Maestro's standard ``scrollUntilVisible``
#
(which always swipes from the screen center); its built-in
#
adaptive swiping handles per-platform fling differences automatically
#
and uses a single, viewport-aware visibility check, which avoids the
#
tree-vs-viewport mismatch we hit with a custom ``while: notVisible``
#
loop on Android API 31 (where off-screen ``NestedScrollView``
#
children can be present in the accessibility tree even though
#
clipped, causing the loop to exit before the row is actually in the
#
viewport).
appId
:
${APP_ID}
---
-
runFlow
:
file
:
../../helpers/open_demo.yaml
env
:
CATEGORY
:
Components
DEMO_TITLE
:
ScrollView
-
assertVisible
:
"
ScrollRow 1
"
-
assertVisible
:
"
Scrolled: OFF
"
#
Target the last row: the inner box is a fixed 400 dp on every device, so
#
the early rows (~1-21) are on-screen without scrolling. Asserting a row
#
that *is* already visible would let Maestro short-circuit with zero
#
swipes (it does exactly that for "ScrollRow 20" on iOS), and then
#
on_scroll never fires. The last row must land beyond the *physical
#
screen* (not just the 400 dp box): clipped ScrollView children keep
#
their content-coordinate accessibility frames, and Maestro treats
#
anything within the screen bounds as visible, so the demo renders 60
#
rows to push the last one past every simulator's screen height.
#
Reaching row 60 takes several slow swipes, and each visibility check
#
snapshots the whole hierarchy; allow a slow simulator the time.
-
scrollUntilVisible
:
element
:
"
ScrollRow 60
"
direction
:
DOWN
timeout
:
60000
visibilityPercentage
:
100
centerElement
:
false
-
assertVisible
:
"
ScrollRow 60
"
#
on_scroll fired during the swipe(s): the ScrollEvent carried a positive y
#
offset (the readout under the box), and the readout above the box
#
flipped. Android hands the end of an inner scroll to the page, which can
#
push that upper readout off-screen, so scroll back up to it; "Scrolled"
#
stays ON once set.
-
assertVisible
:
"
Offset y positive: yes
"
-
scrollUntilVisible
:
element
:
"
Scrolled: ON
"
direction
:
UP
timeout
:
60000
centerElement
:
false
#
Horizontal section: surface the tiles, then swipe *from a tile* so the
#
gesture lands inside the horizontal box rather than the page. The swipes
#
may have to carry the inner box back to its end first.
-
scrollUntilVisible
:
element
:
text
:
"
HRow 1
"
direction
:
DOWN
timeout
:
60000
-
assertVisible
:
"
Drag: OFF
"
-
swipe
:
from
:
text
:
"
HRow 2
"
direction
:
LEFT
duration
:
400
-
extendedWaitUntil
:
visible
:
"
Drag: ON
"
timeout
:
5000
#
The inner scroll's height plus the readouts push the demo's "Back to
#
list" button below the fold; close_demo taps it without scrolling, so
#
surface it first here (no-op when it's already visible).
-
scrollUntilVisible
:
element
:
text
:
"
Back to list
"
direction
:
DOWN
timeout
:
20000
-
runFlow
:
file
:
../../helpers/close_demo.yaml
env
:
CATEGORY
:
Components
Back
|
FazBrowse Home
|
New Git URL