{
  "name": "e2e_test",
  "title": "E2E端到端测试工具",
  "description": "基于Playwright的E2E端到端测试工具，支持模拟用户操作、截图对比、多浏览器并行测试、网络拦截Mock、测试视频回放。需要安装 Playwright 浏览器驱动：npx playwright install chromium",
  "example": "",
  "category": "浏览器自动化",
  "group": "web",
  "type": "function",
  "main": "./index.js",
  "strict": true,
  "add_params": false,
  "params": [
    {
      "name": "category",
      "title": "操作分类",
      "description": "E2E测试操作分类",
      "type": "string",
      "required": true,
      "enum": ["test", "navigation", "action", "screenshot", "visual", "network", "video", "browser", "assert"]
    },
    {
      "name": "action",
      "title": "操作类型",
      "description": "具体操作类型",
      "type": "string",
      "required": true
    },
    {
      "name": "testName",
      "title": "测试名称",
      "description": "测试用例名称（test/run操作使用）",
      "type": "string"
    },
    {
      "name": "testScript",
      "title": "测试脚本",
      "description": "测试步骤脚本（JSON格式），定义一系列操作步骤（test/run操作使用）",
      "type": "string"
    },
    {
      "name": "browserType",
      "title": "浏览器类型",
      "description": "浏览器类型",
      "type": "string",
      "default": "chromium",
      "enum": ["chromium", "firefox", "webkit"]
    },
    {
      "name": "browsers",
      "title": "多浏览器列表",
      "description": "并行测试的浏览器列表（test/runParallel操作使用）",
      "type": "string"
    },
    {
      "name": "headless",
      "title": "无头模式",
      "description": "是否以无头模式运行浏览器",
      "type": "boolean",
      "default": true
    },
    {
      "name": "url",
      "title": "目标URL",
      "description": "要导航到的URL",
      "type": "string"
    },
    {
      "name": "selector",
      "title": "CSS选择器",
      "description": "CSS选择器，用于定位元素",
      "type": "string"
    },
    {
      "name": "value",
      "title": "输入值",
      "description": "要输入的值或要点击的文本",
      "type": "string"
    },
    {
      "name": "options",
      "title": "操作选项",
      "description": "操作选项，JSON格式，如点击选项、输入选项等",
      "type": "string"
    },
    {
      "name": "path",
      "title": "保存路径",
      "description": "截图或视频的保存路径",
      "type": "string"
    },
    {
      "name": "baselinePath",
      "title": "基准截图路径",
      "description": "截图对比的基准图片路径（visual/compare操作使用）",
      "type": "string"
    },
    {
      "name": "threshold",
      "title": "对比阈值",
      "description": "截图对比的像素差异阈值（0-1），默认0.1（visual/compare操作使用）",
      "type": "number",
      "default": 0.1
    },
    {
      "name": "diffOutputPath",
      "title": "差异输出路径",
      "description": "截图对比差异图的输出路径（visual/compare操作使用）",
      "type": "string"
    },
    {
      "name": "routeUrl",
      "title": "拦截URL模式",
      "description": "要拦截的网络请求URL模式（network/intercept操作使用）",
      "type": "string"
    },
    {
      "name": "mockResponse",
      "title": "Mock响应数据",
      "description": "Mock的响应数据，JSON格式（network/mock操作使用）",
      "type": "string"
    },
    {
      "name": "mockStatus",
      "title": "Mock状态码",
      "description": "Mock响应的HTTP状态码（network/mock操作使用）",
      "type": "number",
      "default": 200
    },
    {
      "name": "waitFor",
      "title": "等待条件",
      "description": "等待条件，如选择器、超时等",
      "type": "string"
    },
    {
      "name": "waitTimeout",
      "title": "等待超时",
      "description": "等待的超时时间(毫秒)",
      "type": "number",
      "default": 30000
    },
    {
      "name": "viewport",
      "title": "视口大小",
      "description": "浏览器视口大小，JSON格式如{\"width\":1280,\"height\":720}",
      "type": "string"
    },
    {
      "name": "recordVideo",
      "title": "录制视频",
      "description": "是否录制测试视频回放",
      "type": "boolean",
      "default": false
    },
    {
      "name": "timeout",
      "title": "超时时间",
      "description": "操作的超时时间(毫秒)",
      "type": "number",
      "default": 30000
    }
  ],
  "returns": [
    {
      "name": "code",
      "type": "number",
      "description": "状态码，0表示成功"
    },
    {
      "name": "msg",
      "type": "string",
      "description": "状态描述信息"
    },
    {
      "name": "data",
      "type": "object",
      "description": "返回数据，包含操作结果详情"
    }
  ],
  "func_name": "main",
  "scope": "sys",
  "sort": 10,
  "state": 1,
  "show": 0,
  "end": false
}
