playwright.remote.config.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Playwright 远程环境测试配置
  3. * ================================================================
  4. * 用途:针对远程部署环境(http://cfc.iwintrue.com)的只读测试。
  5. * - 移除 globalSetup(db.js 会执行 bash reset-db.sh 重置远程数据库——绝对禁止)
  6. * - 只运行指定 spec:npx playwright test --config=playwright.remote.config.js
  7. * ================================================================
  8. */
  9. var path = require('path');
  10. module.exports = {
  11. testDir: path.join(__dirname, 'e2e'),
  12. timeout: 120000,
  13. retries: 0,
  14. workers: 1,
  15. use: {
  16. baseURL: 'http://cfc.iwintrue.com',
  17. headless: true,
  18. ignoreHTTPSErrors: true,
  19. actionTimeout: 15000,
  20. navigationTimeout: 60000,
  21. screenshot: 'only-on-failure',
  22. trace: 'retain-on-failure',
  23. },
  24. projects: [
  25. {
  26. name: 'desktop',
  27. use: {
  28. browserName: 'chromium',
  29. viewport: { width: 1440, height: 900 },
  30. },
  31. },
  32. ],
  33. reporter: [
  34. ['html', { outputFolder: 'playwright-report' }],
  35. ['list'],
  36. ],
  37. }