SuperAPI AI 工具集

compatibility-testing

测试与质量

查看项目

更新于 10-15 01:53

技能介绍

用途

兼容性测试(Compatibility Testing)技能用于验证产品在跨浏览器、跨平台和跨设备环境下的一致体验。它适用于发布前检查、CSS 或布局变更之后、进入新市场时以及响应式设计验证等场景。

主要能力

该技能围绕以下能力组织:

  • 浏览器引擎驱动的检查,包括视口仿真、响应式验证和跨浏览器截图;文档建议这类检查通过 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
  • 完整设备仿真(user-agent、DPR、触摸):
vibium emulate-device "iPhone 15"
  • 按视口进行视觉差异对比:
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 分钟

何时使用:发布前、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 }]
// }

智能体协同提示

内存命名空间:

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

相关技能

  • mobile-testing - 移动端专项测试
  • visual-testing-advanced - 视觉回归
  • accessibility-testing - 跨平台无障碍

适用场景与限制

适用场景包括发布前兼容性回归、CSS/布局变更后的检查、新市场上线前的环境验证、响应式设计验证。使用时应覆盖 95%+ 用户群,借助分析数据识别真实的浏览器/设备使用情况,避免在不被使用的浏览器上浪费精力。

限制方面:跨浏览器(Firefox/Safari)仍需 Playwright 或云设备农场;Vibium 的 BiDi 后端在 v26.3.x 仅支持 Chrome。文档提示,借助 Agents 可跨云平台并行编排跨浏览器测试,qe-visual-tester 可自动捕获跨平台的视觉不一致。

收费、价格、商业化方式等信息暂未提供。