argent-test-ui-flow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlatform-agnostic
跨平台兼容
The interaction tool names are identical on iOS and Android — , , , , , etc. — and the tool-server auto-dispatches based on the you pass (UUID-shape → iOS, adb serial → Android).
gesture-tapgesture-swipedescribescreenshotlaunch-appudidBefore testing, resolve which device to test on. Call and follow : prefer a running device on any platform;
list-devices<device_selection_rule>Once a platform is chosen, the per-platform setup skill takes over:
| Platform | Setup skill | Find devices with |
|---|---|---|
| iOS | | |
| Android | | |
iOS和Android上的交互工具名称完全一致 —— 、、、、等 —— 工具服务器会根据你传入的自动分发任务(UUID格式对应iOS,adb序列号对应Android)。
gesture-tapgesture-swipedescribescreenshotlaunch-appudid测试前,请确定要测试的设备。 调用并遵循:优先选择任意平台上正在运行的设备;
list-devices<device_selection_rule>选定平台后,对应平台的设置技能将接管后续流程:
| 平台 | 设置技能 | 设备查找方式 |
|---|---|---|
| iOS | | |
| Android | | |
1. Workflow
1. 工作流程
All interactions go through argent MCP tools. Ensure the simulator/emulator is ready before starting.
- Baseline screenshot: Call to see the current UI state.
screenshot - Find target: Before tapping, use a discovery tool to get element coordinates:
- React Native apps: use — it returns component names with (tap: x,y) coordinates. This is the preferred tool for RN apps on either platform. To use it, resolve the
debugger-component-treeskill for setup; on Android you must also runargent-react-native-app-workflowso Metro is reachable from the device.adb -s <serial> reverse tcp:8081 tcp:8081 - Standard app screens and in-app modals: use . On iOS this returns the AX tree (falls back to native-devtools when AX is empty); on Android it returns the uiautomator tree in the same DescribeNode shape.
describe - Permission prompts / system modal overlays: try first. Fall back to
describeonly if the overlay is not exposed reliably.screenshot - Fallback: use to estimate where the desired component is, then verify immediately after the action.
screenshot
- React Native apps: use
- Interact: Perform the action (,
gesture-tap,gesture-swipe,keyboard, ...) — you receive a screenshot automatically.button - Verify: Check the returned screenshot for expected results. If it shows a loading/transitional state, retake with .
screenshot - Repeat for each step in the flow.
所有交互均通过argent MCP工具完成。开始前请确保模拟器/模拟器已就绪。
- 基准截图:调用查看当前UI状态。
screenshot - 定位目标元素:点击前,使用发现工具获取元素坐标:
- React Native应用:使用—— 它会返回组件名称及(点击坐标:x,y)。这是RN应用在任一平台上的首选工具。使用前需调用
debugger-component-tree技能完成设置;Android平台上还需运行argent-react-native-app-workflow,确保设备可访问Metro。adb -s <serial> reverse tcp:8081 tcp:8081 - 标准应用界面与应用内弹窗:使用。iOS平台会返回AX树(AX为空时 fallback 到原生开发工具);Android平台会返回同DescribeNode格式的uiautomator树。
describe - 权限提示/系统弹窗覆盖层:优先尝试。仅当覆盖层无法可靠识别时,才 fallback 到
describe。screenshot - 最终方案:使用估算目标组件位置,操作后立即验证。
screenshot
- React Native应用:使用
- 执行交互:执行操作(、
gesture-tap、gesture-swipe、keyboard等)—— 系统会自动返回截图。button - 验证结果:检查返回的截图是否符合预期。若显示加载/过渡状态,使用重新截图。
screenshot - 重复执行:针对流程中的每一步重复上述操作。
2. Template
2. 模板
Goal: Test [feature name]
Steps:
1. screenshot → see current state (baseline)
2. [Navigate / tap / type to reach starting point] → verify auto-screenshot
3. [Perform the action to test] → verify auto-screenshot
4. Report: pass / fail with details目标:测试[功能名称]
步骤:
1. screenshot → 查看当前状态(基准)
2. [导航/点击/输入以到达起始点] → 验证自动截图
3. [执行待测试操作] → 验证自动截图
4. 报告:通过/失败及详细信息3. Examples
3. 示例
Login flow
登录流程
1. screenshot → see login screen
2. gesture-tap { x: 0.5, y: 0.4 } → tap email field
3. paste { text: "user@example.com" }
4. gesture-tap { x: 0.5, y: 0.55 } → tap password field
5. paste { text: "password123" }
6. gesture-tap { x: 0.5, y: 0.7 } → tap Login button
7. screenshot → verify home screen appeared1. screenshot → 查看登录界面
2. gesture-tap { x: 0.5, y: 0.4 } → 点击邮箱输入框
3. paste { text: "user@example.com" }
4. gesture-tap { x: 0.5, y: 0.55 } → 点击密码输入框
5. paste { text: "password123" }
6. gesture-tap { x: 0.5, y: 0.7 } → 点击登录按钮
7. screenshot → 验证首页已显示Scroll and navigation
滚动与导航
1. screenshot → see list at top
2. gesture-swipe { fromY: 0.7, toY: 0.3 } → scroll down
3. gesture-tap item at visible position → verify auto-screenshot
4. screenshot → verify detail view opened
5. button { button: "back" }
6. screenshot → verify returned to list1. screenshot → 查看列表顶部
2. gesture-swipe { fromY: 0.7, toY: 0.3 } → 向下滚动
3. gesture-tap 可见位置的项目 → 验证自动截图
4. screenshot → 验证详情页已打开
5. button { button: "back" }
6. screenshot → 验证已返回列表4. Recovery Pattern
4. 恢复机制
- If screenshot shows loading/transition: wait 500ms, retake with .
screenshot - If tap misses target: re-run discovery tool (/
describe), retry once with new coordinates.debugger-component-tree - If a permission dialog or modal is visible: re-run first. Stay in screenshot-driven navigation only when the overlay is not exposed reliably, then switch back to
describe/describeas soon as it is dismissed.debugger-component-tree - If tap fails twice at same coordinates: stop, re-discover, report if element not found.
- If a saved flow fails during replay (as opposed to live test steps above): follow
flow-executeskill §10 for structured diagnosis and correction.argent-create-flow
- 若截图显示加载/过渡状态:等待500ms,使用重新截图。
screenshot - 若点击未命中目标:重新运行发现工具(/
describe),使用新坐标重试一次。debugger-component-tree - 若权限弹窗或模态框可见:先重新运行。仅当覆盖层无法可靠识别时,才采用截图驱动导航,覆盖层消失后立即切换回
describe/describe。debugger-component-tree - 若同一坐标连续两次点击失败:停止操作,重新查找元素,若未找到则上报。
- 若已保存的流程在重放时失败(与上述实时测试步骤不同):遵循
flow-execute技能第10节进行结构化诊断与修正。argent-create-flow
Tips
提示
- Use for text entry on iOS — faster and more reliable than key-by-key
paste.keyboardis iOS-only; on Android usepasteinstead.keyboard - Use for long-press context menus (800ms hold).
gesture-custom - Report clearly: state what you expected, what you saw, and the verdict.
- Coordinate estimation: center = 0.5, 0.5; top-third ~ 0.2; bottom-third ~ 0.8.
- Permission modals: try first. Use
describeonly as fallback, tap one visible button at a time, and verify with the returned screenshot before continuing.screenshot - Record for replay: If a tested flow is likely to be repeated, use the skill to record it as a
argent-create-flowscript. This lets you replay the entire sequence later with a single.yamlcall instead of re-running each step manually.flow-execute
- iOS文本输入使用—— 比逐键输入
paste更快更可靠。keyboard仅支持iOS;Android平台请使用paste。keyboard - 长按上下文菜单使用(按住800ms)。
gesture-custom - 清晰报告:说明预期结果、实际结果及判定结论。
- 坐标估算:中心为0.5, 0.5;上三分之一约为0.2;下三分之一约为0.8。
- 权限弹窗:优先尝试。仅作为最后手段使用
describe,每次点击一个可见按钮,继续操作前需通过返回的截图验证结果。screenshot - 录制流程以便重放:若测试的流程可能重复执行,使用技能将其录制为
argent-create-flow脚本。后续只需调用一次.yaml即可重放整个序列,无需手动重复每一步。flow-execute
Related Skills
相关技能
| Skill | When to use |
|---|---|
| Tool usage for tapping, swiping, typing (iOS + Android) |
| Booting and connecting an iOS simulator |
| Booting and connecting an Android emulator |
| Starting the app, Metro, build issues |
| Breakpoints, console logs, JS evaluation |
| Record a test sequence as a replayable flow |
| 技能名称 | 使用场景 |
|---|---|
| iOS和Android平台的点击、滑动、输入等工具使用 |
| 启动并连接iOS模拟器 |
| 启动并连接Android模拟器 |
| 应用启动、Metro配置、构建问题处理 |
| 断点设置、控制台日志查看、JS代码评估 |
| 将测试序列录制为可重放的流程 |