playwright.config.func.js 993 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * 独立功能测试配置(不带 globalSetup)
  3. *
  4. * 目的:规避 tests/playwright.config.js 的 globalSetup(db.js)去连
  5. * 192.168.16.251 重置/种子库 —— 本环境对该库 Access denied,会导致整套 e2e 无法启动。
  6. * 本配置仅用于「自包含」规格(如 assessment-appointment-functional.spec.js),
  7. * 其种子数据由测试自身通过 API 写入(direct-register 自注册等)。
  8. *
  9. * 运行:
  10. * cd d:/cfc/tests
  11. * npx playwright test tests/e2e/assessment-appointment-functional.spec.js -c playwright.config.func.js --project=api
  12. */
  13. module.exports = {
  14. testDir: require('path').join(__dirname, 'e2e'),
  15. timeout: 60000,
  16. // 关键:不配置 globalSetup,避免重置/种子库
  17. use: {
  18. baseURL: process.env.PW_BASE_URL || 'http://127.0.0.1:9082',
  19. headless: true,
  20. ignoreHTTPSErrors: true,
  21. },
  22. projects: [
  23. {
  24. name: 'api',
  25. use: { browserName: 'chromium' },
  26. },
  27. ],
  28. reporter: [['list']],
  29. };