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'
});