mobile-testing
Test native, React Native, hybrid, and Flutter mobile apps with Appium 3.x, Detox, Maestro, and Patrol. Covers device farm setup (BrowserStack, Sauce Labs), gesture simulation, deep link and cold-start testing, push notifications, biometric (Face ID) auth, offline/poor-network simulation, and iOS/Android permission dialog handling. Use when: "mobile test," "Appium," "Detox," "Maestro," "Patrol," "Flutter test," "iOS test," "Android test," "device farm," "deep link," "biometric," "Face ID," "permission dialog," "React Native test." Not for: device/browser matrix strategy in the abstract — use cross-browser-testing; app startup/memory/battery profiling depth — use performance-testing; mobile screenshot diffing — use visual-testing. Related: ci-cd-integration, cross-browser-testing, performance-testing, test-data-management, test-reliability.
petrkindlmann · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add petrkindlmann/qa-skills --skill mobile-testing技能说明
name: mobile-testing description: >- Test native, React Native, hybrid, and Flutter mobile apps with Appium 3.x, Detox, Maestro, and Patrol. Covers device farm setup (BrowserStack, Sauce Labs), gesture simulation, deep link and cold-start testing, push notifications, biometric (Face ID) auth, offline/poor-network simulation, and iOS/Android permission dialog handling. Use when: "mobile test," "Appium," "Detox," "Maestro," "Patrol," "Flutter test," "iOS test," "Android test," "device farm," "deep link," "biometric," "Face ID," "permission dialog," "React Native test." Not for: device/browser matrix strategy in the abstract — use cross-browser-testing; app startup/memory/battery profiling depth — use performance-testing; mobile screenshot diffing — use visual-testing. Related: ci-cd-integration, cross-browser-testing, performance-testing, test-data-management, test-reliability. license: MIT metadata: author: kindlmann version: "2.0" category: automation
Quick Route
| Situation | Go to |
|---|---|
| Picking a framework for an app type | Framework Decision |
| Native/hybrid Appium setup + selectors + gestures | Appium 3.x → references/appium-patterns.md |
| React Native suite | Detox → references/detox-and-maestro.md |
| Low-friction cross-platform YAML | Maestro → references/detox-and-maestro.md |
| Cloud device matrix (P0/P1/P2) | Device Farm → references/device-farm.md |
| Deep links, push, biometrics, offline, permissions | Mobile-Specific Patterns → references/mobile-patterns.md |
Discovery Questions
Check .agents/qa-project-context.md in the project root first — if it exists, use it and skip any question it already answers.
- App type: Native iOS/Android, React Native, Flutter, or hybrid (Cordova/Capacitor)? This picks the framework (see Framework Decision).
- Real devices or emulators? Real devices for release validation and performance; emulators/simulators for development speed. Most teams need both.
- Device farm: BrowserStack App Automate, Sauce Labs, AWS Device Farm, or self-hosted? Budget and CI integration decide.
- OS coverage: Minimum iOS and Android versions? Read analytics for actual user distribution before building the matrix — do not target the newest hardware by default.
- Existing CI pipeline: Where do mobile tests run — local machines, CI runners with emulators, or cloud device farms?
- App distribution: How are test builds distributed — TestFlight, Firebase App Distribution, direct APK/IPA? This determines how the farm gets the binary.
Core Principles
-
Real devices for release, emulators for speed. Emulators miss touch latency, GPS drift, camera quirks, push notification timing, and battery behavior. Use emulators in development and PR checks; reserve real device farms for nightly and release pipelines.
-
Gesture simulation is framework-specific. Appium W3C Actions, Detox device APIs, and platform-native gesture recognizers each handle swipes, pinches, and long-presses differently. Do not assume cross-framework portability.
-
Deep links and push notifications are unique to mobile. Web testing frameworks cannot reach them. Dedicated patterns exist for each — treat them as first-class scenarios, not afterthoughts.
-
Permission dialogs break assumptions. iOS and Android handle runtime permissions differently. Camera, location, contacts, and notification permissions need explicit handling in setup or the test hangs waiting for a dialog it cannot dismiss.
-
Network conditions matter more on mobile. Users switch between WiFi, LTE, 3G, and offline. Test degraded and absent connectivity — not just happy-path WiFi.
-
Anything platform-specific needs a platform guard. A shell command, selector, or device API that works on Android may not exist on iOS (and vice versa). Branch on
platformNamebefore issuing platform-specific commands, or the test fails silently on the other platform.
Framework Decision
| App type | Primary choice | Why |
|---|---|---|
| Native iOS/Android, hybrid | Appium 3.x | Driver-based, mature ecosystem, deepest native + gesture coverage |
| React Native | Detox | Gray-box, synchronizes with the RN bridge, fastest feedback, least flake |
| Cross-platform, mixed-skill team | Maestro | Declarative YAML, native AI commands, lowest authoring friction |
| Flutter | Patrol 4.x | Flutter-native integration testing; 4.0 added web support (via Playwright) and richer native interaction APIs |
Appium 3.x
Appium 3.x (current stable line, 2026) keeps the driver-based plugin architecture introduced in 2.0 — the server is a thin shell; drivers provide platform-specific automation. Upgrade from 2.x is mostly a Node-version bump and dependency cleanup; most capabilities carry over, but Appium 3 dropped several long-deprecated commands and changed plugin/driver handling, so check the 3.x migration notes for removed legacy commands.
Selector priority: Accessibility ID > platform-specific selector (iOS class chain / Android UIAutomator) > XPath (last resort — slow, brittle).
Guard platform-specific commands. Branch on platformName before any platform-only shell co