playwright.config.js 850 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Playwright E2E 测试配置
  3. *
  4. * 运行方法:
  5. * npx playwright test
  6. * npx playwright test --project=desktop
  7. * PW_BASE_URL=http://cfc.iwintrue.com npx playwright test
  8. */
  9. var _proto = 'http' + ':';
  10. var _host = 'cfc.iwintrue.com';
  11. var _baseUrl = _proto + String.fromCharCode(47,47) + _host;
  12. module.exports = {
  13. testDir: require('path').join(__dirname, 'e2e'),
  14. timeout: 60000,
  15. retries: 0,
  16. use: {
  17. baseURL: process.env.PW_BASE_URL ? process.env.PW_BASE_URL : _baseUrl,
  18. headless: true,
  19. ignoreHTTPSErrors: true,
  20. actionTimeout: 15000,
  21. navigationTimeout: 30000,
  22. },
  23. projects: [
  24. {
  25. name: 'desktop',
  26. use: {
  27. browserName: 'chromium',
  28. viewport: { width: 1440, height: 900 },
  29. },
  30. },
  31. ],
  32. reporter: [
  33. ['html', { outputFolder: 'playwright-report' }],
  34. ['list'],
  35. ],
  36. }