mobile-testing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mobile Testing

移动测试

<default_to_action> When testing mobile applications:
  1. DEFINE device coverage matrix (Tier 1: 60%, Tier 2: 30%, Tier 3: 10%)
  2. TEST platform differences (iOS ≠ Android: back button, permissions, UI)
  3. VALIDATE touch gestures (tap, swipe, pinch, long-press)
  4. TEST mobile-specific scenarios (offline, low battery, interruptions)
  5. USE real devices for critical paths, emulators for fast feedback
Quick Mobile Checklist:
  • Test on latest iOS + Android flagship devices
  • Test offline mode and network transitions
  • Verify push notifications work
  • Test gesture interactions (swipe, pinch)
  • Check permissions flow (camera, location, notifications)
Critical Success Factors:
  • Emulators for 80% of testing, real devices for 20% critical paths
  • Test on devices your users actually use (analytics)
  • Device fragmentation is Android's biggest challenge </default_to_action>
<default_to_action> 测试移动应用时:
  1. 定义设备覆盖矩阵(Tier 1:60%,Tier 2:30%,Tier 3:10%)
  2. 测试平台差异(iOS ≠ Android:返回按钮、权限、UI)
  3. 验证触摸手势(点击、滑动、捏合、长按)
  4. 测试移动专属场景(离线、低电量、中断)
  5. 关键路径使用真实设备测试,模拟器用于快速反馈
快速移动测试检查清单:
  • 在最新iOS + Android旗舰设备上测试
  • 测试离线模式和网络切换
  • 验证推送通知功能正常
  • 测试手势交互(滑动、捏合)
  • 检查权限流程(相机、位置、通知)
关键成功因素:
  • 80%的测试使用模拟器,20%的关键路径使用真实设备
  • 在用户实际使用的设备上测试(参考分析数据)
  • 设备碎片化是Android面临的最大挑战 </default_to_action>

Quick Reference Card

快速参考卡片

When to Use

适用场景

  • Native app development (iOS/Android)
  • Hybrid apps (React Native, Flutter)
  • Mobile web / PWAs
  • App store submission preparation
  • 原生应用开发(iOS/Android)
  • 混合应用(React Native、Flutter)
  • 移动网页 / PWA
  • 应用商店提交准备

iOS vs Android Differences

iOS与Android差异

AspectiOSAndroid
OS Versions2-3 supported10+ in use
Devices~40 models1000+ variants
Back ButtonGesture/navHardware/software
PermissionsSingle promptRuntime granular
App StoreStrict reviewGoogle Play + sideload
维度iOSAndroid
操作系统版本支持2-3个版本10+个版本在使用
设备~40款机型1000+种变体
返回按钮手势/导航栏硬件/软件按钮
权限单次提示运行时细粒度控制
应用商店严格审核Google Play + 侧载

Device Coverage Tiers

设备覆盖层级

TierCoverageDevices
Tier 160% usersiPhone 15, Galaxy S24, iPad
Tier 230% usersiPhone 14/13, Pixel 8
Tier 310% usersOlder devices, other manufacturers
层级覆盖用户比例设备示例
Tier 160%用户iPhone 15、Galaxy S24、iPad
Tier 230%用户iPhone 14/13、Pixel 8
Tier 310%用户旧款设备、其他品牌设备

Mobile Performance Goals

移动性能目标

MetricTarget
App launch< 2 seconds
Screen transition< 300ms
Frame rate60 FPS
Battery drain< 5%/hour background

指标目标值
应用启动时间< 2秒
页面切换时间< 300ms
帧率60 FPS
后台电池消耗< 5%/小时

Touch Gesture Testing

触摸手势测试

javascript
// Appium gesture examples
// Tap
await driver.touchAction({ action: 'tap', x: 100, y: 200 });

// Swipe (scroll down)
await driver.touchAction([
  { action: 'press', x: 200, y: 400 },
  { action: 'moveTo', x: 200, y: 100 },
  { action: 'release' }
]);

// Pinch to zoom
const finger1 = [
  { action: 'press', x: 100, y: 200 },
  { action: 'moveTo', x: 50, y: 150 },
  { action: 'release' }
];
const finger2 = [
  { action: 'press', x: 200, y: 200 },
  { action: 'moveTo', x: 250, y: 250 },
  { action: 'release' }
];
await driver.multiTouchAction([finger1, finger2]);

// Long press
await driver.touchAction({
  action: 'longPress',
  x: 100, y: 200,
  duration: 2000
});

javascript
// Appium gesture examples
// Tap
await driver.touchAction({ action: 'tap', x: 100, y: 200 });

// Swipe (scroll down)
await driver.touchAction([
  { action: 'press', x: 200, y: 400 },
  { action: 'moveTo', x: 200, y: 100 },
  { action: 'release' }
]);

// Pinch to zoom
const finger1 = [
  { action: 'press', x: 100, y: 200 },
  { action: 'moveTo', x: 50, y: 150 },
  { action: 'release' }
];
const finger2 = [
  { action: 'press', x: 200, y: 200 },
  { action: 'moveTo', x: 250, y: 250 },
  { action: 'release' }
];
await driver.multiTouchAction([finger1, finger2]);

// Long press
await driver.touchAction({
  action: 'longPress',
  x: 100, y: 200,
  duration: 2000
});

Mobile-Specific Scenarios

移动专属场景测试

javascript
// Offline mode testing
test('app works offline', async () => {
  await driver.toggleAirplaneMode();

  await driver.findElement('view-saved-items').click();
  const items = await driver.findElements('saved-item');
  expect(items.length).toBeGreaterThan(0);

  const banner = await driver.findElement('offline-banner');
  expect(banner.getText()).toContain('No internet');

  await driver.toggleAirplaneMode(); // Restore
});

// Location testing
test('location-based features', async () => {
  await driver.setGeoLocation({
    latitude: 37.7749,
    longitude: -122.4194,
    altitude: 0
  });

  const stores = await driver.findElement('stores-list');
  expect(stores.getText()).toContain('San Francisco');
});

// Permission testing (Android)
test('camera permission flow', async () => {
  await driver.findElement('take-photo').click();

  // Handle permission dialog
  await driver.findElement(
    'com.android.packageinstaller:id/permission_allow_button'
  ).click();

  expect(await driver.findElement('camera-view')).toBeDefined();
});

javascript
// Offline mode testing
test('app works offline', async () => {
  await driver.toggleAirplaneMode();

  await driver.findElement('view-saved-items').click();
  const items = await driver.findElements('saved-item');
  expect(items.length).toBeGreaterThan(0);

  const banner = await driver.findElement('offline-banner');
  expect(banner.getText()).toContain('No internet');

  await driver.toggleAirplaneMode(); // Restore
});

// Location testing
test('location-based features', async () => {
  await driver.setGeoLocation({
    latitude: 37.7749,
    longitude: -122.4194,
    altitude: 0
  });

  const stores = await driver.findElement('stores-list');
  expect(stores.getText()).toContain('San Francisco');
});

// Permission testing (Android)
test('camera permission flow', async () => {
  await driver.findElement('take-photo').click();

  // Handle permission dialog
  await driver.findElement(
    'com.android.packageinstaller:id/permission_allow_button'
  ).click();

  expect(await driver.findElement('camera-view')).toBeDefined();
});

Agent-Driven Mobile Testing

Agent驱动的移动测试

typescript
// Cross-platform mobile testing
await Task("Mobile Test Suite", {
  platforms: ['iOS', 'Android'],
  deviceTiers: [1, 2],
  tests: 'regression-suite',
  parallelDevices: 5,
  deviceFarm: 'browserstack'
}, "qe-test-executor");

// Device farm integration
await Task("Device Farm Execution", {
  service: 'browserstack',
  devices: [
    'iPhone 15 - iOS 17',
    'Samsung Galaxy S24 - Android 14'
  ],
  recordVideo: true,
  captureNetworkLogs: true
}, "qe-test-executor");

typescript
// Cross-platform mobile testing
await Task("Mobile Test Suite", {
  platforms: ['iOS', 'Android'],
  deviceTiers: [1, 2],
  tests: 'regression-suite',
  parallelDevices: 5,
  deviceFarm: 'browserstack'
}, "qe-test-executor");

// Device farm integration
await Task("Device Farm Execution", {
  service: 'browserstack',
  devices: [
    'iPhone 15 - iOS 17',
    'Samsung Galaxy S24 - Android 14'
  ],
  recordVideo: true,
  captureNetworkLogs: true
}, "qe-test-executor");

Agent Coordination Hints

Agent协作提示

Memory Namespace

内存命名空间

aqe/mobile-testing/
├── device-matrix/*      - Device coverage strategy
├── platform-tests/*     - iOS/Android specific tests
├── gesture-library/*    - Reusable gesture patterns
└── performance/*        - Mobile performance metrics
aqe/mobile-testing/
├── device-matrix/*      - Device coverage strategy
├── platform-tests/*     - iOS/Android specific tests
├── gesture-library/*    - Reusable gesture patterns
└── performance/*        - Mobile performance metrics

Fleet Coordination

集群协作

typescript
const mobileFleet = await FleetManager.coordinate({
  strategy: 'mobile-testing',
  agents: [
    'qe-test-executor',       // Cross-platform execution
    'qe-performance-tester',  // Mobile performance
    'qe-visual-tester'        // Screen size validation
  ],
  topology: 'parallel'
});

typescript
const mobileFleet = await FleetManager.coordinate({
  strategy: 'mobile-testing',
  agents: [
    'qe-test-executor',       // Cross-platform execution
    'qe-performance-tester',  // Mobile performance
    'qe-visual-tester'        // Screen size validation
  ],
  topology: 'parallel'
});

Related Skills

相关技能

  • accessibility-testing - VoiceOver, TalkBack
  • performance-testing - Mobile performance
  • compatibility-testing - Device compatibility

  • 可访问性测试 - VoiceOver、TalkBack
  • 性能测试 - 移动性能测试
  • 兼容性测试 - 设备兼容性测试

Remember

注意事项

Mobile is not a smaller desktop - it's a different platform. 60%+ of web traffic is mobile. Device fragmentation (1000+ Android devices), touch gestures, sensors, permissions, offline scenarios - all require specific testing.
Test on real devices for critical flows. Emulators catch 80% of bugs but real devices needed for actual performance, sensor behavior, and platform quirks.
With Agents:
qe-test-executor
orchestrates testing across device farms, manages platform differences, and tests 10+ devices in parallel. Reduces mobile testing from days to hours.
移动平台并非桌面平台的缩小版——它是一个完全不同的平台。 超过60%的网页流量来自移动设备。设备碎片化(1000+款Android设备)、触摸手势、传感器、权限、离线场景等都需要针对性测试。
关键流程务必使用真实设备测试。 模拟器能发现80%的问题,但真实设备才能测试实际性能、传感器行为和平台特性。
借助Agent:
qe-test-executor
可跨设备集群编排测试,处理平台差异,并行测试10+台设备。将移动测试时间从数天缩短至数小时。