.app (iOS), upload it to a channel/tag, run
momentic-mobile. No Flutter-specific test tooling is involved. The app under
test is the same binary your users install.
Produce a testable build
- Android (APK)
- iOS (simulator .app)
flutter build apk --debug also works for local iteration.Upload and run
Add the CLI as a dev dependency so the lockfile pins the version in CI:smoke.test.yaml
Flutter pitfalls
- Semantics drive what Momentic sees. Momentic reads the native
accessibility tree. Flutter renders everything on a canvas, so elements are
only visible to the tester when they produce semantics nodes. Most Material
and Cupertino widgets do this automatically; custom
CustomPaintercontent and decorative widgets may needSemanticswrappers orexcludeSemanticstuning. If a check cannot find a control the user can see, the widget tree is missing semantics. Keyvalues do not reach the accessibility tree.ValueKey('login-button')is invisible to Momentic; keys exist for Flutter’s own finder APIs. For a stable hook, wrap the widget inSemantics(label:)or give it atooltip. Prefer natural-language targets so tests survive renames.- Splash and async init. A Flutter app often shows a splash while
main()awaits. Rather than a fixedwait, assert on the first real screen:assert: The home screen is visiblewith atimeout. - DevTools/
--dart-defineconfig does not reach the installed binary. Embed test config via--dart-defineat build time so the shipped artifact carries it. - Impeller vs. Skia rendering does not change what the accessibility tree exposes; either engine works.
- WebView content on Android needs
WebView.setWebContentsDebuggingEnabled(true).
In CI
.github/workflows/mobile.yml
--channel/--tag on run select the asset this job just uploaded. iOS builds
need runs-on: macos-latest with flutter build ios --simulator before the
upload step.