e2e-testing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI E2E Testing — 8 Platforms, Zero Test Code

AI端到端测试——支持8大平台,无需编写测试代码

Give your AI agent eyes and hands inside any running app.
flutter-skill is an MCP server that connects AI agents to running apps. The agent can see screenshots, tap elements, enter text, scroll, navigate, inspect UI trees, and verify state — all through natural language.
为你的AI Agent赋予在任意运行中应用内的「眼」和「手」。
flutter-skill是一款MCP服务器,可将AI Agent与运行中的应用连接。Agent能够通过自然语言完成截图、点击元素、输入文本、滚动、导航、检查UI树以及验证状态等操作。

Supported Platforms

支持的平台

PlatformSetup
Flutter (iOS/Android/Web)
flutter pub add flutter_skill
React Native
npm install flutter-skill-react-native
Electron
npm install flutter-skill-electron
iOS (Swift/UIKit)SPM:
FlutterSkillSDK
Android (Kotlin)Gradle:
flutter-skill-android
Tauri (Rust)
cargo add flutter-skill-tauri
KMP DesktopGradle dependency
.NET MAUINuGet package
Test scorecard: 562/567 (99.1%) across all 8 platforms.
平台配置方式
Flutter (iOS/Android/Web)
flutter pub add flutter_skill
React Native
npm install flutter-skill-react-native
Electron
npm install flutter-skill-electron
iOS (Swift/UIKit)SPM:
FlutterSkillSDK
Android (Kotlin)Gradle:
flutter-skill-android
Tauri (Rust)
cargo add flutter-skill-tauri
KMP DesktopGradle依赖
.NET MAUINuGet包
测试评分:全8大平台共567项测试,通过562项(通过率99.1%)。

Install

安装

bash
undefined
bash
undefined

npm (recommended)

npm(推荐)

npm install -g flutter-skill
npm install -g flutter-skill

Homebrew

Homebrew

brew install ai-dashboad/flutter-skill/flutter-skill
brew install ai-dashboad/flutter-skill/flutter-skill

Or download binary from GitHub Releases

或从GitHub Releases下载二进制文件

undefined
undefined

MCP Configuration

MCP配置

Add to your AI agent's MCP config (Claude Desktop, Cursor, Windsurf, OpenClaw, etc.):
json
{
  "mcpServers": {
    "flutter-skill": {
      "command": "flutter-skill",
      "args": ["server"]
    }
  }
}
添加到你的AI Agent的MCP配置中(Claude Desktop、Cursor、Windsurf、OpenClaw等):
json
{
  "mcpServers": {
    "flutter-skill": {
      "command": "flutter-skill",
      "args": ["server"]
    }
  }
}

OpenClaw

OpenClaw

If using OpenClaw, add to your gateway config under
mcp.servers
:
yaml
mcp:
  servers:
    flutter-skill:
      command: flutter-skill
      args: ["server"]
如果使用OpenClaw,在网关配置的
mcp.servers
下添加:
yaml
mcp:
  servers:
    flutter-skill:
      command: flutter-skill
      args: ["server"]

Quick Start

快速开始

1. Initialize your app (one-time)

1. 初始化你的应用(仅需一次)

bash
cd /path/to/your/app
flutter-skill init
Auto-detects project type and patches your app with the testing bridge.
bash
cd /path/to/your/app
flutter-skill init
自动检测项目类型,并为你的应用添加测试桥接补丁。

2. Launch and connect

2. 启动并连接

bash
flutter-skill launch .
bash
flutter-skill launch .

3. Test with natural language

3. 使用自然语言测试

Tell the agent what to test:
"Test the login flow — enter admin@test.com and password123, tap Login, verify Dashboard appears"
The agent will automatically:
  1. screenshot()
    → see the current screen
  2. inspect_interactive()
    → discover all tappable/typeable elements with semantic refs
  3. tap(ref: "button:Login")
    → tap using stable semantic reference
  4. enter_text(ref: "input:Email", text: "admin@test.com")
    → type into field
  5. wait_for_element(key: "Dashboard")
    → verify navigation
  6. screenshot()
    → confirm final state
告诉Agent你要测试的内容:
"测试登录流程——输入admin@test.com和password123,点击登录按钮,验证仪表盘页面是否出现"
Agent会自动执行以下操作:
  1. screenshot()
    → 捕获当前屏幕
  2. inspect_interactive()
    → 发现所有可点击/可输入元素及其语义引用
  3. tap(ref: "button:Login")
    → 使用稳定的语义引用点击按钮
  4. enter_text(ref: "input:Email", text: "admin@test.com")
    → 在输入框中输入文本
  5. wait_for_element(key: "Dashboard")
    → 验证页面导航
  6. screenshot()
    → 确认最终状态

Available MCP Tools

可用的MCP工具

Core Actions

核心操作

ToolDescription
screenshot
Capture current screen as image
tap
Tap element by key, text, ref, or coordinates
enter_text
Type text into a field
scroll
Scroll up/down/left/right
swipe
Swipe gesture between points
long_press
Long press an element
drag
Drag from point A to B
go_back
Navigate back
press_key
Send keyboard key events
工具描述
screenshot
捕获当前屏幕为图片
tap
通过键、文本、引用或坐标点击元素
enter_text
在输入框中输入文本
scroll
向上/向下/向左/向右滚动
swipe
在两点间执行滑动手势
long_press
长按元素
drag
从A点拖动到B点
go_back
返回上一页
press_key
发送键盘按键事件

Inspection (v0.8.0+)

检查功能(v0.8.0+)

ToolDescription
inspect_interactive
NEW — Get all interactive elements with semantic ref IDs
get_elements
List all elements on screen
find_element
Find element by key or text
wait_for_element
Wait for element to appear (with timeout)
get_element_properties
Get detailed properties of an element
工具描述
inspect_interactive
新增 — 获取所有带语义引用ID的可交互元素
get_elements
列出屏幕上的所有元素
find_element
通过键或文本查找元素
wait_for_element
等待元素出现(带超时机制)
get_element_properties
获取元素的详细属性

Text Manipulation

文本操作

ToolDescription
set_text
Replace text in a field
clear_text
Clear a text field
get_text
Read text content
工具描述
set_text
替换输入框中的文本
clear_text
清空输入框
get_text
读取文本内容

App Control

应用控制

ToolDescription
get_logs
Read app logs
clear_logs
Clear log buffer
工具描述
get_logs
读取应用日志
clear_logs
清空日志缓冲区

Semantic Refs (v0.8.0)

语义引用(v0.8.0)

inspect_interactive
returns elements with stable semantic reference IDs:
button:Login          → Login button
input:Email           → Email text field
toggle:Dark Mode      → Dark mode switch
button:Submit[1]      → Second Submit button (disambiguated)
Format:
{role}:{content}[{index}]
7 roles:
button
,
input
,
toggle
,
slider
,
select
,
link
,
item
Use refs for reliable element targeting that survives UI changes:
tap(ref: "button:Login")
enter_text(ref: "input:Email", text: "test@example.com")
inspect_interactive
会返回带有稳定语义引用ID的元素:
button:Login          → 登录按钮
input:Email           → 邮箱输入框
toggle:Dark Mode      → 暗黑模式开关
button:Submit[1]      → 第二个提交按钮(已区分)
格式:
{角色}:{内容}[{索引}]
7种角色:
button
input
toggle
slider
select
link
item
使用引用进行可靠的元素定位,即使UI发生变化也不受影响:
tap(ref: "button:Login")
enter_text(ref: "input:Email", text: "test@example.com")

Testing Workflow

测试工作流

Basic Flow

基础流程

screenshot() → inspect_interactive() → tap/enter_text → screenshot() → verify
screenshot() → inspect_interactive() → tap/enter_text → screenshot() → 验证

Comprehensive Testing

全面测试

"Explore every screen of this app. Test all buttons, forms, navigation, and edge cases. Report any bugs you find."
The agent will systematically:
  • Navigate every screen via tab bars, menus, links
  • Interact with every interactive element
  • Test form validation (empty, invalid, valid inputs)
  • Test edge cases (long text, special characters, emoji)
  • Verify navigation flows (forward, back, deep links)
  • Take screenshots at each step for verification
"探索应用的每一个页面。测试所有按钮、表单、导航和边缘情况。报告发现的任何Bug。"
Agent会系统性地执行以下操作:
  • 通过标签栏、菜单、链接导航到每一个页面
  • 与所有可交互元素进行交互
  • 测试表单验证(空值、无效值、有效值输入)
  • 测试边缘情况(长文本、特殊字符、表情符号)
  • 验证导航流程(前进、后退、深度链接)
  • 在每一步截图以便验证

Example Prompts

示例提示词

Quick smoke test:
"Tap every tab and screenshot each page"
Form testing:
"Fill the registration form with edge case data — emoji name, very long email, short password — and verify error messages"
Navigation:
"Test the complete user journey: sign up → create post → like → comment → delete → sign out"
Accessibility:
"Check every screen for missing labels, small tap targets, and contrast issues"
快速冒烟测试:
"点击每个标签页并截图每个页面"
表单测试:
"用边缘情况数据填写注册表单——表情符号名称、超长邮箱、短密码——并验证错误提示"
导航测试:
"测试完整用户旅程:注册→创建帖子→点赞→评论→删除→登出"
无障碍测试:
"检查每个页面是否存在缺失标签、点击目标过小和对比度问题"

Tips

小贴士

  1. Always start with
    screenshot()
    — see before you act
  2. Use
    inspect_interactive()
    to discover elements
    — don't guess at selectors
  3. Prefer
    ref:
    selectors
    — more stable than text or coordinates
  4. wait_for_element()
    after navigation
    — apps need time to transition
  5. Screenshot after every action — verify the expected effect
  6. Use
    press_key
    for keyboard shortcuts
    — test keyboard navigation
  1. 始终从
    screenshot()
    开始
    — 先查看再操作
  2. 使用
    inspect_interactive()
    发现元素
    — 不要猜测选择器
  3. 优先使用
    ref:
    选择器
    — 比文本或坐标更稳定
  4. 导航后使用
    wait_for_element()
    — 应用需要时间完成过渡
  5. 每次操作后截图 — 验证预期效果
  6. 使用
    press_key
    测试键盘快捷键
    — 测试键盘导航

Links

相关链接