Browse pages
Mobile Testing
The mobile app proves its behavior at two boundaries: core tests without a device, and device tests that drive each screen on an emulator or device. This page states how it follows the testing principles in Frontend Testing and where each kind of test lives. A team that applies it while writing tests keeps fast tests fast and still proves every screen where users meet it.
Stack: any Layer: tests
Concepts#
Two Boundaries, Two Runners#
The core holds no platform type, so its tests run on the plain .NET runner with no emulator. Screens render through the platform toolkit, so their tests drive them on an emulator or a device. The release build adds one human walk on a physical device per platform before publishing.
Standards#
Test the Core as Plain .NET#
ruleruleguidancelitespec/frontend/mobile/testing#test-the-core-as-plain-netDomain, Application, Infrastructure, and Client tests MUST run as plain .NET test projects with no emulator.
Why
The core holds no platform type, so its tests need no emulator, device, or platform host. They run as plain .NET test projects in xunit.v3, the test framework the manifest pins. A core test that needs a device proves the layering already broke, and the fix belongs in the layering rather than in the test setup. This realizes litespec/frontend/testing#match-test-level-to-risk.
Checka reviewer answers
Reviewed forWhich core test projects need an emulator instead of running on the plain .NET runner? Look in the core test projects.
Marked guidance: a reviewer answers this question.
Prove Screens on a Device or Emulator#
ruleruleguidancelitespec/frontend/mobile/testing#prove-screens-on-a-device-or-emulatorEach screen a use case reaches MUST have a device test that drives it on an emulator or device.
Why
Screens render through the platform toolkit, so only a device test meets them where users do: layout, insets, back behavior, and accessibility. A screen no device test drives is proved by nothing, whatever the core tests cover. Driving each screen a use case reaches on an emulator or device keeps every reachable screen proved. This realizes litespec/frontend/testing#match-test-level-to-risk.
Checka reviewer answers
Reviewed forWhich screens a use case reaches lack a device test driving them on an emulator or device? Look in the device tests beside the screens.
Marked guidance: a reviewer answers this question.
Prove Touch and Text Accessibility on a Device#
ruleruleguidancelitespec/frontend/mobile/testing#prove-touch-and-text-accessibility-on-a-deviceA device test for each screen MUST check that every interactive view carries a content description and the platform-minimum touch target, and that text scales with the system font scale.
Why
A screen can render correctly at the default font size and still hide its commands from a screen reader, place a target a finger misses, or clip text a reader enlarged. Checking content descriptions, touch targets, and font scaling on a device meets the screen with the platform accessibility settings its visitors use, rather than with the settings the developer happened to keep. This proves litespec/frontend/mobile/screens#meet-touch-and-text-accessibility on each screen.
Checka reviewer answers
Reviewed forWhich screens lack a device test checking content descriptions, platform-minimum touch targets, and text scaling with the system font scale? Look in the device tests beside the screens.
Marked guidance: a reviewer answers this question.
Conventions#
Run the Release Build Before a Release#
conventiondefaultguidancelitespec/frontend/mobile/testing#run-the-release-build-before-a-releaseInstall and walk the release build on one physical device per platform before publishing, and record the device and result.
ReplacementA consumer can replace this default with an explicit local convention.
Why
Emulators approximate the device: performance, sensors, and vendor behavior differ on hardware. Walking the release build on one physical device per platform meets the app as users will, and the recorded device and result make the walk reviewable. A release without that record ships on emulator evidence alone.
Checka reviewer answers
Reviewed forWhich releases publish without a record naming one physical device per platform and the walk result? Look in the release records.
Marked guidance: a reviewer answers this question.