Mobile Testing Guide

Testing Framework Comparison

FrameworkPlatformLanguageBest For
DetoxReact Native (iOS + Android)JavaScriptGray-box RN E2E; fast, stable
AppiumiOS + Android + WebJS/Python/Java/RubyCross-platform E2E, black-box, real devices
XCTest + XCUITestiOS onlySwift/Objective-CNative iOS unit + UI tests
EspressoAndroid onlyJava/KotlinNative Android UI tests, fast in-process
Flutter TestFlutter (cross-platform)DartFlutter widget tests + integration tests
MaestroiOS + AndroidYAML flowsSimple E2E flows without coding

Detox E2E Test (React Native)

// e2e/login.test.js describe('Login Flow', () => { beforeEach(async () => { await device.reloadReactNative(); }); it('should show dashboard after successful login', async () => { await element(by.id('email-input')).typeText('[email protected]'); await element(by.id('password-input')).typeText('password123'); await element(by.id('login-button')).tap(); await waitFor(element(by.id('dashboard-screen'))) .toBeVisible() .withTimeout(5000); await expect(element(by.text('Welcome back'))).toBeVisible(); }); it('should show error for wrong credentials', async () => { await element(by.id('email-input')).typeText('[email protected]'); await element(by.id('password-input')).typeText('wrong'); await element(by.id('login-button')).tap(); await expect(element(by.id('error-message'))).toBeVisible(); await expect(element(by.text('Invalid credentials'))).toBeVisible(); }); }); // package.json // "detox": { // "devices": { // "simulator": { "type": "ios.simulator", // "device": { "type": "iPhone 14" } } // }, // "apps": { "ios": { "binaryPath": "ios/build/app.app" } }, // "configurations": { // "ios.sim.release": { // "device": "simulator", "app": "ios" } // } // }

Mobile Testing Checklist

AreaTest Cases
Network conditionsOffline, slow 3G (Charles Proxy / Android emulator network settings)
InterruptionsIncoming call, push notification, app backgrounded
Device variationsDifferent screen sizes, notch, dynamic island, font size accessibility
OS versionsLatest + latest-1 + oldest supported version
PermissionsFirst-time permission requests, denied permissions (camera, location)
Deep linksUniversal links, custom URL schemes open correct screen
Memory pressureLow-memory scenarios, background kill and restore
OrientationPortrait โ†” landscape transition preserves state