Skip to content

Mobile App Testing Patterns

Your React Native app works flawlessly on the iPhone 15 Pro sitting on your desk. Then the crash reports roll in: Android 12 on Samsung Galaxy A13, iOS 16 on iPhone SE (2nd gen), and a tablet layout that overlaps every text element. Mobile testing is a combinatorial explosion — dozens of devices, multiple OS versions, varying screen sizes, and platform-specific behaviors. AI tools cannot test on every device, but they can generate the tests that cover the most ground.

  • Cross-platform test generation for React Native and Flutter applications
  • Device matrix strategies that maximize coverage without testing every permutation
  • Platform-specific testing patterns for gestures, navigation, and permissions
  • Responsive layout testing across screen sizes and orientations
  • AI prompts for generating Detox and Maestro test suites
Generate Detox E2E tests for our React Native app's onboarding flow:
Flow: Splash -> Welcome -> Permission Requests -> Profile Setup -> Home
1. Splash screen: Verify logo displays, auto-navigates after 2 seconds
2. Welcome: Swipe through 3 carousel pages, tap "Get Started"
3. Permissions: Handle push notification permission dialog (allow and deny paths)
4. Profile: Fill name, select avatar, tap "Complete"
5. Home: Verify the user name appears, main navigation tabs are visible
Platform-specific handling:
- iOS: Use system dialog matchers for permission requests
- Android: Use UiAutomator for permission dialogs
Test both:
- Happy path (all permissions granted)
- Permissions denied path (verify graceful degradation)
- Back navigation at each step
Save to /e2e/onboarding.e2e.ts

You cannot test on every device. Choose strategically.

“Detox tests pass on simulator but fail on real devices.” Simulators and emulators do not perfectly replicate real device behavior. Gestures, performance, and system dialogs behave differently. Run critical path tests on at least one real device through a cloud service (BrowserStack, AWS Device Farm).

“Tests are flaky due to animation timing.” Mobile animations cause timing issues. Disable animations in test builds (UIView.setAnimationsEnabled(false) on iOS, Settings > Developer options > Animation scale 0x on Android) or use Detox’s synchronization.

“Android tests behave differently across manufacturers.” Samsung, Xiaomi, and OnePlus add custom UI layers that affect system dialogs and navigation. Test on the top 3 manufacturers in your analytics, not just the stock Pixel emulator.

“Our CI is too slow for mobile tests.” Mobile test suites are inherently slower than web tests. Run smoke tests (3-5 critical flows) on every PR and the full suite nightly. Use cloud device farms for parallel execution.