关于 qe-mobile-testing
qe-mobile-testing 是用于验证原生、混合及移动 Web 应用的测试技能,涵盖设备覆盖规划、平台差异、手势、离线行为等移动场景。
主要功能
- 01规划设备覆盖范围
- 02检查 iOS 与 Android 差异
- 03验证触控手势
- 04测试离线及中断场景
- 05提供模拟器与真机测试指导
适用场景
- 01规划跨平台回归测试
- 02检查权限流程与推送通知
- 03验证离线行为及网络切换
- 04准备应用商店提交
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ proffesor-for-testing/ agentic-qe --skill qe-mobile-testing安装后在 Claude Code 中输入/qe-mobile-testing确认已加载。
详细介绍
移动端测试
<default_to_action> 测试移动应用时:
- 定义设备覆盖矩阵(Tier 1:60%,Tier 2:30%,Tier 3:10%)
- 测试平台差异(iOS ≠ Android:返回按钮、权限、UI)
- 验证触摸手势(轻触、滑动、捏合、长按)
- 测试移动端专属场景(离线、低电量、中断)
- 关键路径使用真机,快速反馈使用模拟器
移动端快速检查清单:
- 在最新的 iOS 和 Android 旗舰设备上测试
- 测试离线模式和网络切换
- 验证推送通知是否正常工作
- 测试手势交互(滑动、捏合)
- 检查权限流程(相机、位置、通知)
关键成功因素:
- 80% 的测试使用模拟器,20% 的关键路径使用真机
- 在用户实际使用的设备上测试(参考分析数据)
- 设备碎片化是 Android 面临的最大挑战 </default_to_action>
快速参考卡
适用场景
- 原生应用开发(iOS/Android)
- 混合应用(React Native、Flutter)
- 移动 Web / PWA
- 准备提交应用商店
iOS 与 Android 的差异
| 方面 | iOS | Android |
|---|---|---|
| OS 版本 | 支持 2-3 个版本 | 有 10+ 个版本在使用 |
| 设备 | 约 40 款机型 | 1000+ 种型号 |
| 返回按钮 | 手势/导航 | 硬件/软件 |
| 权限 | 单次提示 | 运行时细粒度权限 |
| 应用商店 | 严格审核 | Google Play + 侧载 |
设备覆盖层级
| 层级 | 覆盖率 | 设备 |
|---|---|---|
| Tier 1 | 60% 的用户 | iPhone 15、Galaxy S24、iPad |
| Tier 2 | 30% 的用户 | iPhone 14/13、Pixel 8 |
| Tier 3 | 10% 的用户 | 较旧设备、其他制造商的设备 |
移动端性能目标
| 指标 | 目标 |
|---|---|
| 应用启动 | < 2 秒 |
| 屏幕切换 | < 300ms |
| 帧率 | 60 FPS |
| 电池消耗 | 后台运行时 < 5%/小时 |
触摸手势测试
// 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
});
移动端专属场景
// 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 驱动的移动端测试
// 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 协作提示
记忆命名空间
aqe/mobile-testing/
├── device-matrix/* - Device coverage strategy
├── platform-tests/* - iOS/Android specific tests
├── gesture-library/* - Reusable gesture patterns
└── performance/* - Mobile performance metrics
集群协作
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'
});
相关技能
请记住
移动端不是缩小版的桌面端,而是一个不同的平台。 60% 以上的 Web 流量来自移动端。设备碎片化(1000+ 款 Android 设备)、触摸手势、传感器、权限、离线场景——都需要专门测试。
关键流程要在真机上测试。 模拟器能发现 80% 的缺陷,但实际性能、传感器行为和平台特性都需要真机测试。
使用 Agent 时: qe-test-executor 会协调跨设备云的测试、管理平台差异,并在 10+ 台设备上并行测试。将移动端测试时间从数天缩短至数小时。
评论
支持 Markdown