跨浏览器与跨设备测试技能Skill browser-stack

该技能用于通过云端测试平台(如BrowserStack、Sauce Labs)自动化执行跨浏览器和跨设备的兼容性测试。核心功能包括:在多种真实浏览器和设备上运行测试、捕获屏幕截图、进行视觉回归测试、性能测试以及生成详细的兼容性报告。关键词:跨浏览器测试、跨设备测试、云端测试平台、兼容性测试、自动化测试、视觉回归、性能测试、BrowserStack、Sauce Labs。

测试 0 次安装 0 次浏览 更新于 2/26/2026

name: browser-stack description: 使用BrowserStack或Sauce Labs进行跨浏览器和跨设备测试 allowed-tools:

  • Read
  • Write
  • Edit
  • Bash
  • Glob
  • Grep
  • WebFetch

浏览器堆栈技能

目的

使用BrowserStack或Sauce Labs等云端测试平台执行跨浏览器和跨设备测试。

能力

  • 在真实设备和浏览器上运行测试
  • 跨设备/浏览器组合捕获屏幕截图
  • 在多个浏览器版本上进行测试
  • 生成兼容性报告
  • 跨平台的视觉回归测试
  • 在真实设备上进行性能测试

目标流程

  • responsive-design.js (crossDeviceTestingTask)
  • accessibility-audit.js
  • usability-testing.js

集成点

  • BrowserStack API
  • Sauce Labs API
  • Selenium WebDriver
  • Playwright

输入模式

{
  "type": "object",
  "properties": {
    "platform": {
      "type": "string",
      "enum": ["browserstack", "saucelabs"],
      "default": "browserstack"
    },
    "testUrl": {
      "type": "string",
      "description": "待测试的URL"
    },
    "browsers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "browser": { "type": "string" },
          "version": { "type": "string" },
          "os": { "type": "string" }
        }
      }
    },
    "devices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "device": { "type": "string" },
          "osVersion": { "type": "string" }
        }
      }
    },
    "testType": {
      "type": "string",
      "enum": ["screenshot", "functional", "visual-regression", "performance"],
      "default": "screenshot"
    },
    "viewports": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "width": { "type": "number" },
          "height": { "type": "number" }
        }
      }
    }
  },
  "required": ["testUrl"]
}

输出模式

{
  "type": "object",
  "properties": {
    "testResults": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "browser": { "type": "string" },
          "device": { "type": "string" },
          "status": { "type": "string" },
          "screenshotUrl": { "type": "string" }
        }
      }
    },
    "compatibilityMatrix": {
      "type": "object",
      "description": "浏览器/设备兼容性摘要"
    },
    "issues": {
      "type": "array",
      "description": "检测到的兼容性问题"
    },
    "reportUrl": {
      "type": "string",
      "description": "完整测试报告的URL"
    }
  }
}

使用示例

const result = await skill.execute({
  platform: 'browserstack',
  testUrl: 'https://example.com',
  browsers: [
    { browser: 'chrome', version: 'latest', os: 'Windows 11' },
    { browser: 'safari', version: 'latest', os: 'OS X Sonoma' }
  ],
  devices: [
    { device: 'iPhone 15', osVersion: '17' },
    { device: 'Samsung Galaxy S24', osVersion: '14' }
  ],
  testType: 'screenshot'
});