FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: pass Android e2e on CI's small emulator and in plugin builds · pythonnative/pythonnative@d8ab818 · GitHub

Commit d8ab818

Browse files
committed
fix: pass Android e2e on CI's small emulator and in plugin builds
CI's Android shards failed while every iOS shard passed. - Codegen compared shared View props with Python equality, so a plugin manifest loaded from JSON (lists, not tuples) renamed built-in types such as PNViewWidth and broke the inbox app's Kotlin compile. Compare JSON forms, stop naming the union in ScrollViewManager, regenerate the inbox extension's manifest, and test both. - The Android Keyboard module never saw the keyboard: under adjustResize the content view reads a zero IME inset. Observe the decor view, and assert the keyboard's visibility in the Android flow. - Demos and flows written for a tall phone missed controls on CI's 320x640 screen. Flows scroll their targets into view, the Keyboard and Stack options demos move their controls above the field and the nested stack, and reduce-motion checks no longer assume the setting is off (CI's emulator disables animations, which Android reports as Reduce Motion). - Split the hooks suite in two and rebalance the Android shards so none outlasts the emulator's roughly ten-minute stable session.
1 parent c588d11 commit d8ab818

23 files changed

Lines changed: 2082 additions & 180 deletions

File tree

‎.github/workflows/e2e.yml‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
# app, dies). Sharding the run into a few balanced groups, each on
3333
# its own freshly booted emulator, keeps every session under the
3434
# limit, and parallelizes the Android pass as a bonus. Groups are
35-
# sized so none exceeds ~12 heavy flows: ``components`` (35 flows
36-
# after the graphics additions) dropped offline at ~11.5 minutes
37-
# when split in two, so it runs as three parts; ``hooks`` (23 quick
38-
# flows, ~10 minutes of driving) gets a dedicated emulator; the
39-
# remaining categories are grouped to similar totals.
35+
# sized to about nine minutes of driving or less: ``components``
36+
# (39 flows) runs as three parts; ``hooks`` (26 flows) dropped
37+
# offline at ~11.5 minutes in one session, so it runs as two parts;
38+
# the remaining categories pair up to similar totals, and ``misc``
39+
# (14 flows) runs alone.
4040
# ``fail-fast: false`` so one shard's failure still lets the others
4141
# report.
4242
strategy:
@@ -49,12 +49,18 @@ jobs:
4949
suites: components-b
5050
- name: components-c
5151
suites: components-c
52-
- name: hooks
53-
suites: hooks
54-
- name: nav-gestures-layout-styling
55-
suites: navigation gestures layout styling
56-
- name: anim-misc
57-
suites: animations assets misc
52+
- name: hooks-a
53+
suites: hooks-a
54+
- name: hooks-b
55+
suites: hooks-b
56+
- name: nav-gestures
57+
suites: navigation gestures
58+
- name: layout-styling
59+
suites: layout styling
60+
- name: anim-assets
61+
suites: animations assets
62+
- name: misc
63+
suites: misc
5864
- name: inbox
5965
suites: inbox
6066

‎examples/e2e-suite/app/screens/device/keyboard.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Focusing the field brings up the software keyboard; ``Keyboard.add_listener``
44
mirrors every [`KeyboardEvent`][pythonnative.KeyboardEvent] into the
55
readouts, ``Keyboard.is_visible()`` answers the current state, and the
6-
"Dismiss keyboard" button (outside the field) calls ``Keyboard.dismiss()``,
6+
"Dismiss keyboard" button (above the field) calls ``Keyboard.dismiss()``,
77
which resigns the focused input so ``on_blur`` fires and the visibility
88
readout flips back to "no".
99
"""
@@ -44,6 +44,9 @@ def dismiss() -> None:
4444
"Keyboard.is_visible, add_listener, and dismiss.",
4545
section(
4646
"Keyboard module",
47+
# The button sits above the field: the software keyboard covers
48+
# the lower half of a short screen while the field is focused.
49+
pn.Button("Dismiss keyboard", on_press=dismiss),
4750
result_text("Focused", "ON" if focused else "OFF"),
4851
result_text("Keyboard visible", "yes" if visible else "no"),
4952
result_text("Keyboard events", events),
@@ -64,7 +67,6 @@ def dismiss() -> None:
6467
font_size=16,
6568
),
6669
),
67-
pn.Button("Dismiss keyboard", on_press=dismiss),
6870
hint("Maestro focuses the field, then dismisses the keyboard from Python."),
6971
),
7072
)

‎examples/e2e-suite/app/screens/hooks/use_reduce_motion.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
"""Demo screen for [`pn.use_reduce_motion`][pythonnative.use_reduce_motion].
22
33
The hook mirrors the system Reduce Motion setting and re-renders when it
4-
changes. CI emulators run with the setting off, so the flow asserts
5-
"no"; the demo also shows how an app would shorten an animation when it
6-
is on.
4+
changes. The setting differs between CI devices (Android reports it on
5+
when animations are disabled, as CI's emulator runs), so the flow checks
6+
that the hook agrees with ``AccessibilityInfo.is_reduce_motion_enabled()``
7+
rather than a fixed value. The demo also shows how an app would shorten
8+
an animation when the setting is on.
79
"""
810

911
from __future__ import annotations
@@ -17,6 +19,7 @@ def UseReduceMotionDemo() -> pn.Element:
1719
"""Render the Reduce Motion flag and the animation duration derived from it."""
1820
reduce_motion = pn.use_reduce_motion()
1921
duration = 0 if reduce_motion else 300
22+
agrees = reduce_motion == pn.AccessibilityInfo.is_reduce_motion_enabled()
2023

2124
return demo_screen(
2225
"use_reduce_motion",
@@ -25,6 +28,7 @@ def UseReduceMotionDemo() -> pn.Element:
2528
"Reduce motion",
2629
result_text("Reduce motion", "yes" if reduce_motion else "no"),
2730
result_text("Animation duration", duration),
28-
hint("Maestro asserts 'Reduce motion: no' on the stock emulator."),
31+
result_text("Matches AccessibilityInfo", "yes" if agrees else "no"),
32+
hint("Maestro checks the hook against AccessibilityInfo on any device."),
2933
),
3034
)

‎examples/e2e-suite/app/screens/navigation/stack_options.py‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,21 @@ def _run() -> None:
117117
result_text("Guard", "ON" if guard else "OFF"),
118118
result_text("Vetoes", vetoes),
119119
result_text("Last veto", last_veto),
120+
# The controls sit above the nested stack: a short screen can't show
121+
# the readouts, the stack, and three rows of buttons at once, and the
122+
# flow reads the stack's header titles from its top edge.
123+
buttons_row(
124+
pn.Button("Push Compose", on_press=act("push", "Compose")),
125+
pn.Button("Push Preview", on_press=act("push", "Preview")),
126+
),
127+
buttons_row(
128+
pn.Button("Push Plain", on_press=act("push", "Plain")),
129+
pn.Button("Pop to Home", on_press=act("pop_to", "Home")),
130+
),
131+
buttons_row(
132+
pn.Button("Enable guard", on_press=lambda: set_guard(True)),
133+
pn.Button("Disable guard", on_press=lambda: set_guard(False)),
134+
),
120135
pn.View(
121136
_Bus.Provider(
122137
_Stack.Navigator(
@@ -136,18 +151,6 @@ def _run() -> None:
136151
),
137152
style=pn.style(height=200, border_radius=8, background_color="#F8FAFC", overflow="hidden"),
138153
),
139-
buttons_row(
140-
pn.Button("Push Compose", on_press=act("push", "Compose")),
141-
pn.Button("Push Preview", on_press=act("push", "Preview")),
142-
),
143-
buttons_row(
144-
pn.Button("Push Plain", on_press=act("push", "Plain")),
145-
pn.Button("Pop to Home", on_press=act("pop_to", "Home")),
146-
),
147-
buttons_row(
148-
pn.Button("Enable guard", on_press=lambda: set_guard(True)),
149-
pn.Button("Disable guard", on_press=lambda: set_guard(False)),
150-
),
151154
hint("Header titles: screen beats group beats navigator. The guard vetoes pop_to."),
152155
),
153156
)

‎examples/inbox-extension/src/inbox_extension/api.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@
66
from typing import Any, Callable, Literal
77
from pythonnative.mutations import UNSET, UnsetType
88
from pythonnative.sdk.types import decode_value, resolve_type
9+
from pythonnative.style import DynamicColor as PNDynamicColor
910
from pythonnative.style import EdgeInsets as PNEdgeInsets
1011
from inbox_extension import InboxBatch as PNInboxBatch
1112
from inbox_extension import InboxRecord as PNInboxRecord
1213
from pythonnative.style import ShadowOffset as PNShadowOffset
1314
from pythonnative.style import Style as PNStyle
15+
from pythonnative.style import TransformPerspective as PNTransformPerspective
1416
from pythonnative.style import TransformRotate as PNTransformRotate
17+
from pythonnative.style import TransformRotateX as PNTransformRotateX
18+
from pythonnative.style import TransformRotateY as PNTransformRotateY
19+
from pythonnative.style import TransformRotateZ as PNTransformRotateZ
1520
from pythonnative.style import TransformScale as PNTransformScale
1621
from pythonnative.style import TransformScaleX as PNTransformScaleX
1722
from pythonnative.style import TransformScaleY as PNTransformScaleY
23+
from pythonnative.style import TransformSkewX as PNTransformSkewX
24+
from pythonnative.style import TransformSkewY as PNTransformSkewY
1825
from pythonnative.style import TransformTranslate as PNTransformTranslate
1926

2027
from pythonnative.native_modules.registry import native_module

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL