forked from OasisDEX/e2e-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
205 lines (174 loc) · 4.88 KB
/
playwright.config.ts
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
require('dotenv').config();
import { devices, type PlaywrightTestConfig, type ReporterDescription } from '@playwright/test';
import { baseUrl } from 'utils/config';
// Config to hold extra property
interface TestConfig extends PlaywrightTestConfig {
reporter: ReporterDescription[];
}
// Default configuration
const defaultConfig: PlaywrightTestConfig = {
testDir: './tests',
fullyParallel: process.env.FULLY_PARALLEL === 'true' ? true : false,
timeout: process.env.TIMEOUT ? parseInt(process.env.TIMEOUT) : 30_000,
retries: process.env.RETRIES ? parseInt(process.env.RETRIES) : 2,
workers: process.env.WORKERS ? parseInt(process.env.WORKERS) : 1,
reporter: [['html', { open: 'never' }]],
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
use: {
baseURL: baseUrl,
headless: process.env.HEADLESS === 'false' ? false : true,
// trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
/* Configure projects for major browsers */
projects: [
{
name: 'no-wallet',
testMatch: ['noWallet/**'],
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'no-wallet-portfolio',
testMatch: ['noWallet/portfolio/stagingVsProd.spec.ts'],
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'with-wallet-aave-other',
testMatch: [
'withWallet/aaveV3/arbitrum/**',
'withWallet/aaveV3/optimism/**',
'withWallet/aaveV3/base/**',
],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-aave-ethereum',
testMatch: ['withWallet/aaveV2/**', 'withWallet/aaveV3/ethereum/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-aave-arbitrum',
testMatch: ['withWallet/aaveV3/arbitrum/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-aave-base',
testMatch: ['withWallet/aaveV3/base/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-aave-optimism',
testMatch: ['withWallet/aaveV3/optimism/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-aave-arbitrum-and-optimism',
testMatch: ['withWallet/aaveV3/arbitrum/**', 'withWallet/aaveV3/optimism/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-ajna-and-morphoblue',
testMatch: ['withWallet/ajna/**', 'withWallet/morphoBlue/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-ajna',
testMatch: ['withWallet/ajna/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-ajna-ethereum',
testMatch: ['withWallet/ajna/ethereum/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-ajna-arbitrum',
testMatch: ['withWallet/ajna/arbitrum/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-ajna-base',
testMatch: ['withWallet/ajna/base/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-ajna-optimism',
testMatch: ['withWallet/ajna/optimism/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-morphoblue',
testMatch: ['withWallet/morphoBlue/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-morphoblue-ethereum',
testMatch: ['withWallet/morphoBlue/ethereum/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-morphoblue-base',
testMatch: ['withWallet/morphoBlue/base/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-maker-and-spark',
testMatch: ['withWallet/maker/**', 'withWallet/spark/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-spark-ethereum',
testMatch: ['withWallet/spark/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-maker-ethereum',
testMatch: ['withWallet/maker/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-swap',
testMatch: [
'withWallet/aaveV3/swap/**',
'withWallet/maker/swap/**',
'withWallet/morphoBlue/swap/**',
'withWallet/spark/swap/**',
],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-swap-aavev3',
testMatch: ['withWallet/aaveV3/ethereum/swap/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-swap-maker',
testMatch: ['withWallet/maker/swap/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-swap-morphoblue',
testMatch: ['withWallet/morphoBlue/ethereum/swap/**'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'with-wallet-swap-spark',
testMatch: ['withWallet/spark/swap/**'],
use: { ...devices['Desktop Chrome'] },
},
],
};
// Set reporter folder depending on REPORT_FOLDER value
const config: TestConfig = {
...defaultConfig,
reporter: [
['html', { open: 'never', outputFolder: `playwright-reports/${process.env.REPORT_FOLDER}` }],
],
};
export default config;