Agent Skills › software-mansion/argent › argent-test-ui-flow

argent-test-ui-flow

GitHub

自动测试iOS或Android应用UI流程,通过截图、元素定位和交互操作验证登录、导航及视觉行为。支持React Native及标准应用,提供基线截图与视觉回归对比能力。

packages/skills/skills/argent-test-ui-flow/SKILL.md software-mansion/argent

Trigger Scenarios

测试UI流程 验证登录功能 测试导航逻辑 运行UI测试场景 手动QA步骤 检查可见UI变更

Install

npx skills add software-mansion/argent --skill argent-test-ui-flow -g -y
More Options

Non-standard path

npx skills add https://github.com/software-mansion/argent/tree/main/packages/skills/skills/argent-test-ui-flow -g -y

Use without installing

npx skills use software-mansion/argent@argent-test-ui-flow

指定 Agent (Claude Code)

npx skills add software-mansion/argent --skill argent-test-ui-flow -a claude-code -g -y

安装 repo 全部 skill

npx skills add software-mansion/argent --all -g -y

预览 repo 内 skill

npx skills add software-mansion/argent --list

SKILL.md

Frontmatter
{
    "name": "argent-test-ui-flow",
    "description": "Autonomously test an app UI (iOS or Android) by running interact-screenshot-verify loops using argent MCP tools. Use when testing UI flows, verifying login works, testing navigation, running UI test scenarios, manual QA steps, visible UI changes, or visual behavior."
}

Before testing

Resolve the device first: call list-devices, use the platform the user named or else prefer a device that is already running, and don't pick a cabled phone without explicit intent. Setup: argent-ios-simulator-setup / argent-android-emulator-setup. The interaction tool names are identical on iOS and Android.

Physical iPhone (kind: "device"): read argent-ios-device-interact first. launch-app before anything; describe fails while the app is backgrounded.

1. Workflow

For implementation tasks that modify visible UI, this workflow also serves as a visual acceptance path.

  1. Baseline screenshot: call screenshot to see the current UI state. For visual regression comparison or UI change verification, capture the baseline at scale: 1.0 with includeImageInContext: false and keep the returned path before editing whenever feasible.
  2. Find target: get element coordinates from a discovery tool before tapping:
    • App screens (React Native included), in-app modals and system dialogs: describe. Fall back to screenshot only if an overlay is not exposed reliably. When the app raises its own permission dialog, answer it here; that's the real flow under test. To take a prompt out of the flow, use argent-settings-permissions during setup.
    • Fallback: use screenshot to estimate where the component is, then verify immediately after the action.
  3. Interact: perform the action (gesture-tap, gesture-swipe, keyboard, button, ...); you receive a screenshot automatically.
  4. Verify: check the returned screenshot. If it shows a loading/transitional state, block with await-ui-element (expected element visible, or a spinner hidden) rather than a guessed delay (its result carries the new screenshot and element tree), but only with a selector you can trust (text/identifier/role) that the screen is known to have or that you saw in a prior describe; a guessed one just times out. Otherwise use a short fixed wait. Pick evidence by what's being asserted:
    • Visual (layout, spacing, color, typography, image/icon rendering, clipping, overflow, text rendering): prefer screenshot-diff against the step 1 baseline: it surfaces pixel-visible changes the auto-screenshot might miss. Fall back to inspecting the auto-screenshot only when a stable baseline isn't available.
    • Structural (navigation state, element existence, accessibility labels/values, selection, hierarchy, route): verify with describe, debugger-component-tree, or native-describe-screen.
    • Runtime / log / network (console errors, API calls, persistence, timing): verify with view-network-logs, debugger-log-registry, debugger-evaluate, or targeted tests. A not_connected result from the debugger tools is not evidence about the app: follow its guidance, then re-verify.
    • Mixed: collect evidence for each relevant class.
    • Report the combined verdict: expected behavior, observed behavior, evidence used, and any blocker for requested visual diffing.
  5. Repeat for each step in the flow.

2. Example: login flow

1. screenshot → see login screen
2. gesture-tap { x: 0.5, y: 0.4 }  → tap email field
3. keyboard { text: "user@example.com" }
4. gesture-tap { x: 0.5, y: 0.55 } → tap password field
5. keyboard { text: "{{secret:APP_PASSWORD}}" }
6. gesture-tap { x: 0.5, y: 0.7 }  → tap Login button
7. screenshot → verify home screen appeared

Credentials: never type plaintext credentials; use a {{secret:<NAME>}} placeholder (keyboard's text parameter lists where it is read from and what to do when a name is missing). Never invent credentials or echo secret values into reports or saved files.

3. Recovery Pattern

  • Screen mid-transition or loading: wait with await-ui-element as in step 4, then re-check. Fall back to a fixed wait + screenshot only when no element reliably marks the transition. Don't poll with repeated screenshots.
  • Tap misses the target: re-run describe and retry once with new coordinates. If it fails twice, stop and report that the element was not found.
  • Permission dialog or modal visible: re-run describe first. Stay in screenshot-driven navigation only while the overlay is not exposed reliably: tap one visible button at a time, verify with the returned screenshot, and switch back to describe as soon as it is dismissed.
  • A saved e2e test fails during e2e-execute replay (as opposed to the live steps above): follow argent-create-e2e's Diagnose a replay failure: classify the failure, inspect the actual screen, repair the smallest justified unit, then replay the full e2e test.

Record for replay: if a tested flow is likely to be repeated, use the argent-create-e2e skill to record it as a .yaml test, so it can be replayed later with a single e2e-execute call.

Related Skills

Skill When to use
argent-device-interact Tool usage for tapping, swiping, typing (iOS + Android)
argent-screenshot-diff Visual regression and before/after screenshot comparison
argent-ios-simulator-setup Booting and connecting an iOS simulator
argent-android-emulator-setup Booting and connecting an Android emulator
argent-react-native-app-workflow Starting the app, Metro, build issues
argent-metro-debugger Console logs, JS evaluation, component inspection
argent-create-e2e Record a test sequence as a replayable e2e test

Version History

  • b965c94 Current 2026-11-07 15:13
  • 617db8d 2026-11-02 18:48

    优化 list-devies 工具,当使用非默认 adb 服务器时,返回包含连接前缀的提示,确保 Agent 能正确执行 adb 命令以访问设备。

  • f0e04a6 2026-10-19 02:09
  • 3c1f2ae 2026-09-22 07:44

    移除对 Breakpoints(断点)能力的错误描述,因底层无对应工具实现;更新技能索引以反映实际支持的 Console logs、JS evaluation 和组件检查功能。

  • b6576ef 2026-09-09 02:11

    修复 iOS 物理设备支持相关细节,包括签名信息处理、设备选择逻辑优化、手势滑动语义说明及设备设置技能文档更新。

  • b1abdec 2026-08-15 02:59

    重构技能结构,将 argent-create-flow 拆分为参考文档并新增 argent-qa-flows 用于生成可重复的回归测试用例。

  • a0460ee 2026-07-24 11:28

    修复安全审计发现:将示例中的硬编码密码替换为密钥系统引用,防止明文凭证泄露;更新描述以澄清主动记录流程的适用范围。

  • bc04c3b 2026-07-06 19:59

Same Skill Collection

packages/skills/skills/argent-android-emulator-setup/SKILL.md
packages/skills/skills/argent-create-e2e/SKILL.md
packages/skills/skills/argent-create-flow/SKILL.md
packages/skills/skills/argent-device-interact/SKILL.md
packages/skills/skills/argent-ios-device-interact/SKILL.md
packages/skills/skills/argent-ios-device-setup/SKILL.md
packages/skills/skills/argent-ios-simulator-setup/SKILL.md
packages/skills/skills/argent-lens/SKILL.md
packages/skills/skills/argent-metro-debugger/SKILL.md
packages/skills/skills/argent-native-profiler/SKILL.md
packages/skills/skills/argent-react-native-app-workflow/SKILL.md
packages/skills/skills/argent-react-native-optimization/SKILL.md
packages/skills/skills/argent-react-native-profiler/SKILL.md
packages/skills/skills/argent-screen-recording/SKILL.md
packages/skills/skills/argent-screenshot-diff/SKILL.md
packages/skills/skills/argent-tv-interact/SKILL.md
packages/skills/skills/argent-qa-e2e/SKILL.md
packages/skills/skills/argent-qa-flows/SKILL.md
packages/skills/skills/argent-settings-permissions/SKILL.md

Metadata

Files
0
Version
b965c94
Hash
f046e218
Indexed
2026-07-06 19:59

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-07 17:27
浙ICP备14020137号-1