关于 compatibility-testing
compatibility-testing 是用于规划和执行浏览器及设备兼容性检查的技能,面向测试人员与质量工程团队。它涵盖响应式验证、跨浏览器视觉比较和并行测试协调。
主要功能
- 01规划浏览器与设备矩阵
- 02验证移动端、平板和桌面断点
- 03比较跨平台截图
- 04协调并行浏览器测试
- 05记录兼容性报告与差异
适用场景
- 01发布前检查浏览器兼容性
- 02CSS 或布局调整后的响应式验证
- 03评估新市场的设备覆盖
- 04定位不同平台的视觉差异
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ proffesor-for-testing/ agentic-qe --skill compatibility-testing安装后在 Claude Code 中输入/compatibility-testing确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
evals/compatibility-testing.yamlschemas/output.jsonscripts/validate-config.json详细介绍
兼容性测试
浏览器引擎
浏览器驱动的检查(视口模拟、响应式验证、跨浏览器截图)应通过 qe-browser fleet 技能(.claude/skills/qe-browser/)进行。Vibium 由 aqe init 安装。快速参考:
# Viewport emulation per breakpoint
vibium viewport 375 667 # mobile
vibium viewport 768 1024 # tablet
vibium viewport 1920 1080 # desktop
# Full device emulation (user-agent, DPR, touch)
vibium emulate-device "iPhone 15"
# Visual diff per viewport
for vp in "375 667 mobile" "768 1024 tablet" "1920 1080 desktop"; do
read w h name <<< "$vp"
vibium viewport $w $h
node .claude/skills/qe-browser/scripts/visual-diff.js --name "homepage-$name"
done
目前,跨浏览器(Firefox/Safari)仍需使用 Playwright 或云设备农场——Vibium 的 BiDi 后端在 v26.3.x 版本中仅支持 Chrome。
<default_to_action> 验证跨浏览器/平台兼容性时:
- 定义浏览器矩阵(覆盖 95% 以上的用户)
- 测试响应式断点(手机、平板、桌面)
- 并行在不同浏览器/设备上运行
- 使用云服务覆盖设备(BrowserStack、Sauce Labs)
- 比较不同平台上的视觉截图
快速兼容性检查清单:
- Chrome、Firefox、Safari、Edge(最新版本及 N-1 版本)
- Mobile Safari(iOS)、Mobile Chrome(Android)
- 屏幕尺寸:320px、768px、1920px
- 对关键流程,使用实际目标设备进行测试
成功的关键因素:
- 用户会通过 100 多种浏览器/设备组合访问
- 在用户使用的环境中测试,而不是在开发环境中测试
- 云测试可将 10 小时的工作缩短至 15 分钟 </default_to_action>
快速参考卡
适用时机
- 发布前
- CSS/布局更改后
- 开拓新市场时
- 验证响应式设计时
使用 Playwright 进行跨浏览器测试
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
{ name: 'mobile-chrome', use: { ...devices['Pixel 5'] } },
{ name: 'mobile-safari', use: { ...devices['iPhone 12'] } }
]
});
// Run: npx playwright test --project=chromium --project=firefox
云测试集成
// BrowserStack configuration
const capabilities = {
'browserName': 'Chrome',
'browser_version': '118.0',
'os': 'Windows',
'os_version': '11',
'browserstack.user': process.env.BROWSERSTACK_USER,
'browserstack.key': process.env.BROWSERSTACK_KEY
};
// Parallel execution across devices
const deviceMatrix = [
{ os: 'Windows', browser: 'Chrome' },
{ os: 'OS X', browser: 'Safari' },
{ os: 'Android', device: 'Samsung Galaxy S24' },
{ os: 'iOS', device: 'iPhone 15' }
];
Agent 驱动的兼容性测试
// Cross-platform visual comparison
await Task("Compatibility Testing", {
url: 'https://example.com',
browsers: ['chrome', 'firefox', 'safari', 'edge'],
devices: ['desktop', 'tablet', 'mobile'],
platform: 'browserstack',
parallel: true
}, "qe-visual-tester");
// Returns:
// {
// combinations: 12, // 4 browsers × 3 devices
// passed: 11,
// differences: [{ browser: 'safari', device: 'mobile', diff: 0.02 }]
// }
Agent 协调提示
内存命名空间
aqe/compatibility-testing/
├── browser-matrix/* - Browser/version configurations
├── device-matrix/* - Device configurations
├── visual-diffs/* - Cross-browser visual differences
└── reports/* - Compatibility reports
Fleet 协调
const compatFleet = await FleetManager.coordinate({
strategy: 'compatibility-testing',
agents: [
'qe-visual-tester', // Visual comparison
'qe-test-executor', // Cross-browser execution
'qe-performance-tester' // Performance by platform
],
topology: 'parallel'
});
相关技能
请记住
覆盖 95% 以上的用户群。 使用分析数据了解实际的浏览器/设备使用情况。不要把时间浪费在没人使用的浏览器上。
使用 Agents: Agents 可协调云平台上的并行跨浏览器测试。qe-visual-tester 会自动发现不同平台上的视觉差异。
评论
支持 Markdown