forked from appsemble/appsemble
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (47 loc) · 1.7 KB
/
playwright.config.ts
File metadata and controls
52 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig, devices } from '@playwright/test';
const { CI, CI_MERGE_REQUEST_IID, E2E_HOST } = process.env;
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testMatch: '**/*.spec.ts',
// Tests aren't fully isolated so they shouldn't run in parallel
fullyParallel: false,
// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: Boolean(CI),
// Retry on CI only
retries: CI ? 2 : 0,
// A lot of tests depend on the same pre-seeded apps, so more workers can introduce flakiness.
workers: 1,
// Reporter to use. See https://playwright.dev/docs/test-reporters
reporter: [['junit', { outputFile: 'results.xml' }]],
// Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions.
use: {
// Base URL to use in actions like `await page.goto('/')`.
baseURL: CI
? (E2E_HOST ?? `https://${CI_MERGE_REQUEST_IID || 'staging'}.appsemble.review`)
: 'http://localhost:9999',
// Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer
trace: 'on-first-retry',
video: 'on',
},
// Configure projects for major browsers
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], storageState: '.auth/user.json' },
dependencies: ['setup'],
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'], storageState: '.auth/user.json' },
dependencies: ['setup'],
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'], storageState: '.auth/user.json' },
dependencies: ['setup'],
},
],
});