-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
72 lines (66 loc) · 2.16 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
import { PlaywrightTestConfig } from '@playwright/test';
import config from './utils/config';
const playwrightConfig: PlaywrightTestConfig = {
testMatch: ["tests/**/*.test.ts"],
fullyParallel: true,
workers: 4, // TODO: configure setup of worker on the basis of test execution count
// Global settings for all projects
use: {
headless: true,
screenshot: 'on-first-failure',
video: 'off',
launchOptions: {
args: ['--disable-dev-shm-usage', '--no-sandbox'],
},
contextOptions: {
viewport: { width: 1280, height: 720 },
},
},
// Define projects for different test types (UI and API)
projects: [
// Project for UI tests
{
name: 'UI - Chromium',
use: {
browserName: 'chromium',
viewport: { width: 1280, height: 720 },
// baseURL: config.ui.baseURL, // Use baseURL from environment config
},
testMatch: ["tests/ui/**/*.test.ts"],
},
{
name: 'UI - Firefox',
use: {
browserName: 'firefox',
viewport: { width: 1280, height: 720 },
// baseURL: config.ui.baseURL, // Use baseURL from environment config
},
testMatch: ["tests/ui/**/*.test.ts"],
},
{
name: 'UI - WebKit',
use: {
browserName: 'webkit',
viewport: { width: 1280, height: 720 },
// baseURL: config.ui.baseURL, // Use baseURL from environment config
},
testMatch: ["tests/ui/**/*.test.ts"],
},
// Project for API tests
{
name: 'API',
use: {
// baseURL: config.api.baseURL, // Use baseURL from environment config
// extraHTTPHeaders: config.api.headers, // Use headers from environment config
},
testMatch: ["tests/api/**/*.test.ts"],
},
],
retries: process.env.CI ? 2 : 0,
reporter: [
['html'],
['list'],
['allure-playwright'],
],
};
export default playwrightConfig;