gitea

Зеркало из https://github.com/go-gitea/gitea
Форк
0
/
playwright.config.ts 
98 строк · 2.5 Кб
1
import {devices} from '@playwright/test';
2
import {env} from 'node:process';
3
import type {PlaywrightTestConfig} from '@playwright/test';
4

5
const BASE_URL = env.GITEA_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000';
6

7
export default {
8
  testDir: './tests/e2e/',
9
  testMatch: /.*\.test\.e2e\.ts/, // Match any .test.e2e.ts files
10

11
  /* Maximum time one test can run for. */
12
  timeout: 30 * 1000,
13

14
  expect: {
15

16
    /**
17
     * Maximum time expect() should wait for the condition to be met.
18
     * For example in `await expect(locator).toHaveText();`
19
     */
20
    timeout: 2000,
21
  },
22

23
  /* Fail the build on CI if you accidentally left test.only in the source code. */
24
  forbidOnly: Boolean(env.CI),
25

26
  /* Retry on CI only */
27
  retries: env.CI ? 2 : 0,
28

29
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
30
  reporter: env.CI ? 'list' : [['list'], ['html', {outputFolder: 'tests/e2e/reports/', open: 'never'}]],
31

32
  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
33
  use: {
34
    headless: true,   // set to false to debug
35

36
    locale: 'en-US',
37

38
    /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
39
    actionTimeout: 1000,
40

41
    /* Maximum time allowed for navigation, such as `page.goto()`. */
42
    navigationTimeout: 5 * 1000,
43

44
    /* Base URL to use in actions like `await page.goto('/')`. */
45
    baseURL: BASE_URL,
46

47
    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
48
    trace: 'on-first-retry',
49

50
    screenshot: 'only-on-failure',
51
  },
52

53
  /* Configure projects for major browsers */
54
  projects: [
55
    {
56
      name: 'chromium',
57

58
      /* Project-specific settings. */
59
      use: {
60
        ...devices['Desktop Chrome'],
61
      },
62
    },
63

64
    // disabled because of https://github.com/go-gitea/gitea/issues/21355
65
    // {
66
    //   name: 'firefox',
67
    //   use: {
68
    //     ...devices['Desktop Firefox'],
69
    //   },
70
    // },
71

72
    {
73
      name: 'webkit',
74
      use: {
75
        ...devices['Desktop Safari'],
76
      },
77
    },
78

79
    /* Test against mobile viewports. */
80
    {
81
      name: 'Mobile Chrome',
82
      use: {
83
        ...devices['Pixel 5'],
84
      },
85
    },
86
    {
87
      name: 'Mobile Safari',
88
      use: {
89
        ...devices['iPhone 12'],
90
      },
91
    },
92
  ],
93

94
  /* Folder for test artifacts such as screenshots, videos, traces, etc. */
95
  outputDir: 'tests/e2e/test-artifacts/',
96
  /* Folder for test artifacts such as screenshots, videos, traces, etc. */
97
  snapshotDir: 'tests/e2e/test-snapshots/',
98
} satisfies PlaywrightTestConfig;
99

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

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

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

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