tapilot docs

Your first test 你的第一个测试

This walkthrough takes you from a blank folder to a green run in under five minutes. You'll install the Tapilot CLI, write a short DSL file that drives a real Android app, and see the same test executed three ways — desktop, CLI, and through an MCP agent. 本教程带你在五分钟内,从一个空文件夹抵达一条通过的测试记录。 你将安装 Tapilot CLI、编写一个驱动真实 Android 应用的 DSL 文件, 并通过三种方式运行同一条测试:桌面端、命令行、以及 MCP Agent。

Updated 2026-04-18 · ~5 min read · Applies to v0.3+

Install Tapilot 安装 Tapilot #

Pick your platform. The tapilot CLI bundles the desktop UI, the MCP server, and the device bridges. 选择你的平台。tapilot CLI 已内置桌面端、MCP 服务和设备桥接。

shell
# Homebrew — includes desktop app, CLI and MCP server
brew install tapilot/tap/tapilot

# Verify
tapilot --version
# → tapilot 0.3.7 (darwin/arm64, mcp 0.3.7)

Prefer a Docker image for CI? See Deployment → Docker. 希望在 CI 中使用 Docker?查看 部署 → Docker

Write the DSL 编写 DSL #

Tapilot tests are YAML-flavored documents. A device key picks a target, and steps is an ordered list of actions from the 24-action DSL. Indentation nests control flow; there are no hidden hooks and no programming language to master. Tapilot 测试是 YAML 风格的文档。device 选择目标设备, steps 是一个有序的动作列表,来自 24 个 DSL 动作。缩进表示控制流嵌套,没有隐藏钩子,也不需要学习编程语言。

# tests/sign_in.tapilot.yml
device: android
vars:
  user: "alice@acme.dev"
  pin:  "654321"

steps:
  - open app: com.acme.shop
  - tap: "Sign in"
  - type: email = "{{ user }}"
  - type: pin   = "{{ pin }}"
  - tap: "Continue"
  - assert visible: "Welcome, Alice"
  - assert count: "Order" >= 1
  - screenshot: "home"
DEVICE
android, ios, web, or a named profile from tapilot.config.yml.
VARS & TEMPLATES
Any step can interpolate {{ var }} — including from env and secret stores. 任何步骤都可以使用 {{ var }} 插值,支持环境变量与密钥存储。

Run it 运行测试 #

Exactly the same test file, three entry points. Pick whichever fits the moment — iterate in the desktop app, wire it into CI with the CLI, or hand it to an LLM through MCP. 同一个测试文件,三种入口。桌面端用于迭代调试;CLI 用于接入 CI;MCP 让 LLM 直接调用。

# Opens the run in the desktop app — live DOM, video, and step timeline
tapilot open tests/sign_in.tapilot.yml
# → Pixel 7a (emulator-5554) · 14 steps · ✓ passed in 12.4s
Tip · 提示
Add --watch to the CLI to re-run on file changes. Pair it with --only "step label" to iterate on a single step without replaying the whole flow. 在 CLI 加上 --watch 可监听文件变化自动重跑;配合 --only "步骤名" 可只重跑单个步骤,调试效率更高。

Read the report 查看报告 #

Every run produces a report pack — a zipped folder that is also a valid markdown document, so it renders cleanly in GitHub, Slack, Linear, and any LLM context window. 每次运行都会生成一个报告包——既是压缩文件夹,也是合法的 Markdown 文档,可以在 GitHub、Slack、Linear 及各类 LLM 上下文中直接渲染。

out/sign_in/ report pack
├─ run.md # human-readable summary + inline screenshots
├─ run.json # machine-readable timeline & assertions
├─ screenshots/
│ ├─ 01-open.png
│ ├─ 07-sign_in.png
│ └─ 14-home.png
├─ recording.mp4 # 24fps, hardware-encoded
├─ logcat.txt # device log, filtered to app PID
└─ perf.ndjson # frame times, memory, network
Note · 说明
Cloud runs upload the pack to your workspace automatically and post a link to Slack or Discord (see Webhooks). 云端运行会自动将报告包上传至你的工作区,并推送链接到 Slack 或 Discord(见 Webhooks)。

What to read next 下一步阅读 #