| 123456789101112131415161718192021222324252627282930313233343536373839 |
- /**
- * Playwright API 级测试配置(本地后端)
- * ================================================================
- * 用途:针对本地启动的后端 API(http://127.0.0.1:9082)运行「API 级 e2e」。
- * 与 playwright.config.api.js 结构一致,仅 baseURL 指向本地,用于在
- * feature 分支上验证本地修复后的真实契约行为(GlobalExceptionHandler 400/403 映射)。
- *
- * 运行:npx playwright test <spec> -c playwright.config.api.local.js --project=desktop
- */
- var path = require('path');
- module.exports = {
- testDir: path.join(__dirname, 'e2e'),
- testMatch: /api[\\/].*\.spec\.js$/,
- timeout: 180000,
- retries: 0,
- workers: 1,
- outputDir: path.join(__dirname, '.api-artifacts-local'),
- reporter: [['list']],
- use: {
- baseURL: 'http://127.0.0.1:9082',
- headless: true,
- ignoreHTTPSErrors: true,
- actionTimeout: 60000,
- navigationTimeout: 60000,
- screenshot: 'off',
- trace: 'off',
- video: 'off',
- },
- projects: [
- {
- name: 'desktop',
- use: {
- browserName: 'chromium',
- viewport: { width: 1440, height: 900 },
- },
- },
- ],
- };
|