A comprehensive demo app that exercises every public feature in pythonnative. It's the target of the top-level Maestro E2E suite and doubles as a living reference for the framework's surface area.
It's structured for automated testing. Each PythonNative feature gets a dedicated screen that:
- Renders a stable, unique title (so Maestro can wait for the screen to appear).
- Exposes interactive controls with stable, unique labels (so Maestro can tap them).
- Prints a "Result:" line that reflects the feature's state (so Maestro can assert behavior, not just rendering).
From the repo root:
cd examples/e2e-suite
pn run android # or: pn run iosThen, in another shell:
# Android
maestro test tests/e2e/android.yaml
# iOS (use --platform ios if Android is also connected)
maestro --platform ios test tests/e2e/ios.yamlapp/main.pydefinesRoot, a module-levelpn.StackNavigatorbuilt from the registry. Every demo is apn.Screennamed after its registryid, so route names stay stable for the flows.Appwraps it in apn.NavigationContainerbound to the app-widepn.NavigationRefinapp/navigation_ref.py.- A
pn.ThemeProvidersupplies the suite's light and dark themes fromapp/app_theme.py, apn.Themesubclass with one extra token. The provider follows the color scheme, so a demo that callspn.appearance.set_color_schemerepaints the app and the navigator chrome. app/theme.pyholds the shared styles: layout styles on apn.StyleSheetclass and theme colors on a class built withpn.use_styles.app/screens/scaffold.pyholds the components every demo renders:DemoScreen,DemoSection,ResultText,Hint,Label, andButtonsRow.- Screens are components, and their parameters are their route params. The category list opens a demo with
nav.push(Demo()), and demos navigate with typed targets such asnav.push(ParamsPassingDemo(value="alpha")).
- Add a screen module under
app/screens/<category>/<feature>.pyexporting apn.component-decorated function annotated-> pn.Node. Give every parameter a default so the category list can open it with no arguments. - Register it in
app/registry.pywith a uniqueid. - Add a Maestro flow at
tests/e2e/flows/<category>/<feature>.yamlthat opens the screen through its category and asserts the expected behavior, and list it in the category's suite undertests/e2e/suites/and intests/e2e/android.yamlandtests/e2e/ios.yaml. - Re-run
scripts/check-e2e-coverage.pyto make sure every public symbol inpythonnative.__all__is covered by a flow.
From the repo root:
uv run pytest -q tests/test_e2e_suite_renders.py # renders every demo headlessly
uv run pn lint examples/e2e-suite/app
uv run scripts/check-e2e-coverage.py
(cd examples/e2e-suite && uv run --project ../.. mypy --strict app)The root mypy.ini excludes this app because its top-level package is named app, like the other examples, so it's type-checked from its own directory.
See tests/e2e/AGENTS.md for a deeper tour of how AI agents should interact with this suite.