-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
92 lines (86 loc) · 3.32 KB
/
Copy pathplaywright.config.ts
File metadata and controls
92 lines (86 loc) · 3.32 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* Wire
* Copyright (C) 2026 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/
import {defineConfig, devices} from '@playwright/test';
import dotenv from 'dotenv';
import path from 'node:path';
import {TestOptions} from './e2e-tests/fixtures';
dotenv.config({path: path.resolve(__dirname, './e2e-tests/.env')});
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig<TestOptions>({
testDir: './e2e-tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests because there can only be one running instance of the app at a time */
workers: 1,
// Only generate reports on CI
reporter: process.env.CI
? [
['html', {outputFolder: 'playwright-report/html', open: 'never'}],
['json', {outputFile: 'playwright-report/report.json'}],
['line'],
]
: 'line',
timeout: 90_000,
expect: {timeout: 10_000},
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
// Behavior for tracing the web browser, for traces of the electron app see its fixture in `e2e-tests/fixtures.ts`
trace: 'retain-on-first-failure',
testIdAttribute: 'data-uie-name',
baseURL: process.env.WEBAPP_URL,
permissions: ['camera', 'microphone'],
},
/* Configure projects for multiple operating systems */
projects: [
{
name: 'windows',
use: {
os: 'windows',
...devices['Desktop Chrome'],
launchOptions: {
args: [
'--use-fake-device-for-media-stream', // Provide fake devices for audio & video device input
'--use-fake-ui-for-media-stream', // Bypasses the popup to grant permission and select video / audio input device by automatically selecting the default one
'--mute-audio', // Mute all audio output from the test browser because e.g. the ringtone of a call can be annoying during testing
],
},
},
},
{
name: 'macOS',
use: {
os: 'macOS',
...devices['Desktop Chrome'],
launchOptions: {
args: [
'--use-fake-device-for-media-stream', // Provide fake devices for audio & video device input
'--use-fake-ui-for-media-stream', // Bypasses the popup to grant permission and select video / audio input device by automatically selecting the default one
'--mute-audio', // Mute all audio output from the test browser because e.g. the ringtone of a call can be annoying during testing
],
},
},
},
],
});