playwright.config.api.local.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Playwright API 级测试配置(本地 feature 分支实例)
  3. * ================================================================
  4. * 用途:针对 feature 分支代码启动的本地后端(默认 http://127.0.0.1:18082)
  5. * 运行 SC-P-10 等「实现未部署到远端」的 API 级 e2e,验证本分支新行为。
  6. * 与 playwright.config.api.js 唯一差异:baseURL 指向本地实例(可用 CFC_BASE_URL 覆盖)。
  7. *
  8. * 运行:CFC_BASE_URL=http://127.0.0.1:18082 npx playwright test \
  9. * api/task-create-scp10.spec.js -c playwright.config.api.local.js --project=desktop
  10. */
  11. var path = require('path');
  12. module.exports = {
  13. testDir: path.join(__dirname, 'e2e'),
  14. testMatch: /api[\\/].*\.spec\.js$/,
  15. timeout: 180000,
  16. retries: 0,
  17. workers: 1,
  18. outputDir: path.join(__dirname, '.api-artifacts-local'),
  19. reporter: [['list']],
  20. use: {
  21. baseURL: process.env.CFC_BASE_URL || 'http://127.0.0.1:18082',
  22. headless: true,
  23. ignoreHTTPSErrors: true,
  24. actionTimeout: 15000,
  25. navigationTimeout: 60000,
  26. screenshot: 'off',
  27. trace: 'off',
  28. video: 'off',
  29. },
  30. projects: [
  31. {
  32. name: 'desktop',
  33. use: {
  34. browserName: 'chromium',
  35. viewport: { width: 1440, height: 900 },
  36. },
  37. },
  38. ],
  39. };