playwright.config.api.local.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Playwright API 级测试配置(本地后端)
  3. * ================================================================
  4. * 用途:针对本地启动的后端 API(http://127.0.0.1:9082)运行「API 级 e2e」。
  5. * 与 playwright.config.api.js 结构一致,仅 baseURL 指向本地,用于在
  6. * feature 分支上验证本地修复后的真实契约行为(GlobalExceptionHandler 400/403 映射)。
  7. *
  8. * 运行:npx playwright test <spec> -c playwright.config.api.local.js --project=desktop
  9. */
  10. var path = require('path');
  11. module.exports = {
  12. testDir: path.join(__dirname, 'e2e'),
  13. testMatch: /api[\\/].*\.spec\.js$/,
  14. timeout: 180000,
  15. retries: 0,
  16. workers: 1,
  17. outputDir: path.join(__dirname, '.api-artifacts-local'),
  18. reporter: [['list']],
  19. use: {
  20. baseURL: 'http://127.0.0.1:9082',
  21. headless: true,
  22. ignoreHTTPSErrors: true,
  23. actionTimeout: 60000,
  24. navigationTimeout: 60000,
  25. screenshot: 'off',
  26. trace: 'off',
  27. video: 'off',
  28. },
  29. projects: [
  30. {
  31. name: 'desktop',
  32. use: {
  33. browserName: 'chromium',
  34. viewport: { width: 1440, height: 900 },
  35. },
  36. },
  37. ],
  38. };