universo-platform-2d

Форк
0
/
playwright.config.ts 
79 строк · 2.1 Кб
1
import { testResultDir } from '@affine-test/kit/playwright';
2
import type {
3
  PlaywrightTestConfig,
4
  PlaywrightWorkerOptions,
5
} from '@playwright/test';
6

7
const config: PlaywrightTestConfig = {
8
  testDir: './e2e',
9
  fullyParallel: !process.env.CI,
10
  timeout: 120_000,
11
  outputDir: testResultDir,
12
  use: {
13
    baseURL: 'http://localhost:8080/',
14
    browserName:
15
      (process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ??
16
      'chromium',
17
    permissions: ['clipboard-read', 'clipboard-write'],
18
    viewport: { width: 1440, height: 800 },
19
    actionTimeout: 10 * 1000,
20
    locale: 'en-US',
21
    trace: 'on',
22
    video: 'on',
23
  },
24
  forbidOnly: !!process.env.CI,
25
  workers: process.env.CI ? 1 : 4,
26
  retries: 1,
27
  reporter: process.env.CI ? 'github' : 'list',
28
  webServer: [
29
    {
30
      command: 'yarn run serve:test-static',
31
      port: 8081,
32
      timeout: 120 * 1000,
33
      reuseExistingServer: !process.env.CI,
34
      env: {
35
        COVERAGE: process.env.COVERAGE || 'false',
36
        ENABLE_DEBUG_PAGE: '1',
37
      },
38
    },
39
    // Intentionally not building the web, reminds you to run it by yourself.
40
    {
41
      command: 'yarn -T run start:web-static',
42
      port: 8080,
43
      timeout: 120 * 1000,
44
      reuseExistingServer: !process.env.CI,
45
      env: {
46
        COVERAGE: process.env.COVERAGE || 'false',
47
      },
48
    },
49
    {
50
      command: 'yarn workspace @affine/server start',
51
      port: 3010,
52
      timeout: 120 * 1000,
53
      reuseExistingServer: !process.env.CI,
54
      stdout: 'pipe',
55
      stderr: 'pipe',
56
      env: {
57
        DATABASE_URL:
58
          process.env.DATABASE_URL ??
59
          'postgresql://affine:affine@localhost:5432/affine',
60
        NODE_ENV: 'development',
61
        AFFINE_ENV: process.env.AFFINE_ENV ?? 'dev',
62
        DEBUG: 'affine:*',
63
        FORCE_COLOR: 'true',
64
        DEBUG_COLORS: 'true',
65
        MAILER_HOST: '0.0.0.0',
66
        MAILER_PORT: '1025',
67
        MAILER_SENDER: 'noreply@toeverything.info',
68
        MAILER_USER: 'noreply@toeverything.info',
69
        MAILER_PASSWORD: 'affine',
70
      },
71
    },
72
  ],
73
};
74

75
if (process.env.CI) {
76
  config.retries = 3;
77
}
78

79
export default config;
80

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.