devassure

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DevAssure Skill

DevAssure技能

This skill helps you set up, configure, and use the DevAssure CLI (
@devassure/cli
) — a command-line tool for running end-to-end UI tests from natural language instructions and YAML/CSV files. DevAssure uses an AI agent to execute browser-based tests described in plain English.
Use this skill whenever the user asks about DevAssure, DevAssure CLI, DevAssure Invisible Agent, or wants to set up, configure, write, or run end-to-end UI tests using the DevAssure CLI tool (
@devassure/cli
npm package). Trigger this skill for any mention of: devassure, devassure cli, devassure init, devassure run, devassure tests, .devassure folder, DevAssure test cases, DevAssure YAML test files, DevAssure CSV tests, DevAssure CI/CD integration, DevAssure actions, DevAssure tools, DevAssure test data, DevAssure personas, DevAssure preferences, or natural-language UI test automation with DevAssure. Also trigger when the user wants to write YAML test cases for DevAssure, configure DevAssure projects, set up DevAssure in a CI/CD pipeline, filter or run DevAssure tests by tag/priority/folder, view DevAssure reports, or manage DevAssure sessions. Even if the user just says "set up e2e tests with devassure" or "write devassure test cases" or "run end to ene tests", "set up e2e tests", "run e2e tests", "execute the tests", "execute the tests from csv", use this skill.
本技能可帮助你设置、配置和使用DevAssure CLI
@devassure/cli
)——这是一款命令行工具,支持通过自然语言指令和YAML/CSV文件运行端到端UI测试。DevAssure使用AI Agent执行以简明英语描述的浏览器端测试。
当用户询问DevAssure、DevAssure CLI、DevAssure Invisible Agent,或者想要使用DevAssure CLI工具(
@devassure/cli
npm包)设置、配置、编写或运行端到端UI测试时,请使用本技能。当提及以下任意内容时触发本技能:devassure、devassure cli、devassure init、devassure run、devassure tests、.devassure文件夹、DevAssure测试用例、DevAssure YAML测试文件、DevAssure CSV测试、DevAssure CI/CD集成、DevAssure actions、DevAssure工具、DevAssure测试数据、DevAssure personas、DevAssure偏好设置,或是基于DevAssure的自然语言UI测试自动化。当用户想要为DevAssure编写YAML测试用例、配置DevAssure项目、在CI/CD流水线中搭建DevAssure、按标签/优先级/文件夹筛选或运行DevAssure测试、查看DevAssure报告,或是管理DevAssure会话时也需要触发本技能。即使用户仅提到“用devassure搭建e2e测试”、“编写devassure测试用例”、“运行端到端测试”、“搭建e2e测试”、“运行e2e测试”、“执行测试”、“从csv执行测试”,也请使用本技能。

Quick Reference

快速参考

For full CLI command reference, configuration file formats, actions, tools, and advanced examples, read:
  • references/cli-reference.md
    — Complete command list, all config file formats, actions, tools, library tools, FAQ, and examples.
  • references/cli-troubleshooting.md
    — Web app login issues ("Something went wrong"), VPN/host allowlist, and links to official troubleshooting docs.
Always consult the reference file before answering detailed questions about specific commands, flags, or config file schemas. Use the troubleshooting reference for login, VPN, and connectivity problems.
如需完整的CLI命令参考、配置文件格式、actions、工具和高级示例,请阅读:
  • references/cli-reference.md
    —— 完整命令列表、所有配置文件格式、actions、工具、库工具、常见问题及示例。
  • references/cli-troubleshooting.md
    —— Web应用登录问题(“出现未知错误”)、VPN/主机白名单,以及官方故障排查文档链接。
在回答有关特定命令、参数标志或配置文件模式的详细问题前,请始终查阅参考文件。遇到登录、VPN和连接问题时请使用故障排查参考文档。

Prerequisites

前置要求

Installation

安装

bash
npm install -g @devassure/cli
Verify:
bash
devassure version
Note: The package requires global installation.
npm install
(local) will fail.
bash
npm install -g @devassure/cli
验证安装:
bash
devassure version
注意: 该包需要全局安装。
npm install
(本地安装)会失败。

Core Workflow

核心工作流

1. Authenticate

1. 身份验证

bash
undefined
bash
undefined

Interactive (opens browser for OAuth2)

交互式(打开浏览器走OAuth2认证)

devassure login
devassure login

Token-based (for CI/CD)

令牌模式(用于CI/CD场景)

devassure add-token <your-token>
undefined
devassure add-token <your-token>
undefined

2. Initialize a project

2. 初始化项目

bash
devassure init
This creates a
.devassure/
folder with:
  • app.yaml
    — App description and rules
  • test_data.yaml
    — URLs, credentials, test data per environment
  • personas.yaml
    — User personas
  • preferences.yaml
    — Browser and execution settings
  • tests/
    — Folder for YAML test case files
  • actions/
    — Reusable action definitions
bash
devassure init
该命令会创建一个
.devassure/
文件夹,包含以下内容:
  • app.yaml
    —— 应用描述和规则
  • test_data.yaml
    —— 各环境对应的URL、凭证、测试数据
  • personas.yaml
    —— 用户角色(personas)
  • preferences.yaml
    —— 浏览器和执行设置
  • tests/
    —— 存放YAML测试用例文件的文件夹
  • actions/
    —— 可复用的action定义

3. Write test cases

3. 编写测试用例

Test cases are YAML files in
.devassure/tests/
.
Single test — one case per file as a mapping:
yaml
summary: Login and verify dashboard
steps:
  - Open the application url
  - Log in with admin credentials from test data
  - Verify dashboard loads and shows admin menu
  - Log out
priority: P0
tags:
  - smoke
  - login
Multiple tests — several cases in the same file when they belong to the same group or feature. Use a top-level list (each item is one test):
yaml
- summary: Login and verify dashboard
  steps:
    - Open the application url
    - Log in with admin credentials from test data
    - Verify dashboard loads and shows admin menu
    - Log out
  priority: P0
  tags: [smoke, login]

- summary: Login and verify user name with welcome message
  steps:
    - Open the application url
    - Log in with admin credentials from test data
    - Verify dashboard the welcome message contains the user name
  priority: P2
  tags: [login]
Only
summary
and
steps
are required. Steps are written in natural language — the DevAssure AI agent interprets and executes them in a browser.
测试用例是存放在
.devassure/tests/
下的YAML文件。
单测试 —— 单个文件对应一个用例,以映射形式编写:
yaml
summary: Login and verify dashboard
steps:
  - Open the application url
  - Log in with admin credentials from test data
  - Verify dashboard loads and shows admin menu
  - Log out
priority: P0
tags:
  - smoke
  - login
多测试 —— 当多个用例属于同一分组或功能时,可以放在同一个文件中。使用顶层列表(每一项对应一个测试):
yaml
- summary: Login and verify dashboard
  steps:
    - Open the application url
    - Log in with admin credentials from test data
    - Verify dashboard loads and shows admin menu
    - Log out
  priority: P0
  tags: [smoke, login]

- summary: Login and verify user name with welcome message
  steps:
    - Open the application url
    - Log in with admin credentials from test data
    - Verify dashboard the welcome message contains the user name
  priority: P2
  tags: [login]
summary
steps
为必填项。步骤使用自然语言编写 —— DevAssure AI Agent会解析这些步骤并在浏览器中执行。

4. Run tests

4. 运行测试

bash
undefined
bash
undefined

Run all tests

运行所有测试

devassure run-tests
devassure run-tests

Filter by tags, priority, or folder

按标签、优先级或文件夹筛选

devassure run-tests --tag=smoke,regression --priority=P0,P1
devassure run-tests --tag=smoke,regression --priority=P0,P1

Run from CSV file

从CSV文件运行测试

devassure run-tests --csv=test-cases.csv
devassure run-tests --csv=test-cases.csv

Archive reports after run

运行后归档报告

devassure run-tests --archive=./reports
undefined
devassure run-tests --archive=./reports
undefined

5. View reports

5. 查看报告

bash
devassure open-report --last
devassure summary --last --json
bash
devassure open-report --last
devassure summary --last --json

Key Concepts

核心概念

Test Data (
test_data.yaml
)

测试数据(
test_data.yaml

Define URLs, user credentials, and custom data per environment (default, uat, staging, etc.). The
default
environment is used when
--environment
is not specified.
定义各环境(默认、uat、预发等)对应的URL、用户凭证和自定义数据。未指定
--environment
参数时会使用
default
环境。

Actions (
.devassure/actions/
)

Actions(
.devassure/actions/

Reusable step sequences. Define an action in a YAML file with
name
,
description
, and
steps
. Reference actions by name in test steps.
可复用的步骤序列。在YAML文件中定义带有
name
description
steps
的action,在测试步骤中可通过名称引用对应的action。

Tools (
.devassure/tools/index.yaml
)

Tools(
.devassure/tools/index.yaml

Custom commands/scripts that the agent can invoke during test execution. Supports args, output markers, timeouts, and environment variables.
Agent在测试执行过程中可以调用的自定义命令/脚本。支持参数、输出标记、超时设置和环境变量。

Library Tools (
library.yaml
)

库工具(
library.yaml

Built-in tools like
faker
(synthetic data) and
authenticator
(TOTP codes).
内置工具,例如
faker
(生成模拟数据)和
authenticator
(生成TOTP验证码)。

Preferences (
preferences.yaml
)

偏好设置(
preferences.yaml

Configure browser (chromium/chrome/edge), resolution, headless mode, and worker count.
配置浏览器(chromium/chrome/edge)、分辨率、无头模式和并发worker数量。

CI/CD Integration

CI/CD集成

bash
undefined
bash
undefined

Authenticate with token (no browser needed)

使用令牌认证(无需浏览器)

devassure add-token $DEVASSURE_TOKEN
devassure add-token $DEVASSURE_TOKEN

Run tests with filters and archive results

带筛选条件运行测试并归档结果

devassure run-tests --tag=regression --priority=P0 --archive=./test-reports
devassure run-tests --tag=regression --priority=P0 --archive=./test-reports

Get JSON summary for CI parsing

获取JSON格式的汇总结果供CI解析

devassure summary --last --json
devassure summary --last --json

Clean up old sessions

清理旧的会话

devassure cleanup --retain-days 7

Supports proxy via `HTTP_PROXY` / `HTTPS_PROXY` environment variables.
devassure cleanup --retain-days 7

支持通过`HTTP_PROXY` / `HTTPS_PROXY`环境变量配置代理。

When Helping Users

帮助用户时的注意事项

  1. Setting up a new project: Walk them through
    login
    init
    → writing test cases →
    run-tests
    .
  2. Writing test cases: Help write YAML test files with natural language steps. Keep steps clear and action-oriented.
  3. CI/CD setup: Help configure token-based auth, test filtering, report archiving, and cleanup.
  4. Troubleshooting: Check Node.js version (18+), global install, authentication status. For web login errors, HTTPS/mixed content, firewall, and VPN host allowlists, see
    references/cli-troubleshooting.md
    .
  5. Advanced config: Refer to
    references/cli-reference.md
    for tools, actions, library tools, and full config schemas.
  1. 搭建新项目:引导用户按
    login
    init
    → 编写测试用例 →
    run-tests
    的流程操作。
  2. 编写测试用例:帮助编写带有自然语言步骤的YAML测试文件,保持步骤清晰、面向操作。
  3. CI/CD搭建:帮助配置令牌认证、测试筛选、报告归档和清理逻辑。
  4. 故障排查:检查Node.js版本(18+)、是否全局安装、认证状态。遇到网页登录错误、HTTPS/混合内容、防火墙和VPN主机白名单问题,请查阅
    references/cli-troubleshooting.md
  5. 高级配置:有关工具、actions、库工具和完整配置模式的内容,请参考
    references/cli-reference.md