forked from browserstack/node-js-playwright-browserstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
104 lines (96 loc) · 2.24 KB
/
Copy pathplaywright.config.js
File metadata and controls
104 lines (96 loc) · 2.24 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
93
94
95
96
97
98
99
100
101
102
103
104
import { devices } from '@playwright/test';
// This is a sample config for what users might be running locally
const config = {
fullyParallel: true,
testDir: './tests',
testMatch: '**/bstack_test*.js',
/* Maximum time one test can run for. */
timeout: 90 * 1000,
expect: {
timeout: 60000,
toMatchSnapshot: {
threshold: 0.3,
maxDiffPixelRatio: 0.3
}
},
/* tests in parallel */
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['junit', { open: 'never', outputFile: 'results.xml' }],
['html', { open: 'never', outputFolder: 'test-html-results/report' }]
],
/* Configure projects for major browsers */
use: {
headless: true,
ignoreHTTPSErrors: true,
actionTimeout: 60000,
viewport: {
width: 1920,
height: 1080
},
geolocation: { longitude: 22.5726, latitude: 88.3639 },
permissions: ['geolocation'],
extraHTTPHeaders: {
// We set this header per GitHub guidelines.
'Accept': 'application/json'
// Add authorization token to all requests.
// 'Authorization': `token ${process.env.API_TOKEN}`,
},
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
launchOptions: {
slowMo: 500,
},
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
},
},
{
name: 'mobile-chrome',
use: {
...devices['Pixel 7'],
viewport: { width: 412, height: 915 }
},
},
// Add BrowserStack-specific projects
{
name: '-latest:Windows 11-browserstack',
use: {
browserName: 'chromium',
// BrowserStack SDK injects additional settings
},
},
{
name: '-latest:OS X Ventura-browserstack',
use: {
browserName: 'chromium',
},
},
{
name: 'mobile-safari',
use: {
...devices['iPhone 14 Pro'],
viewport: { width: 412, height: 915 }
},
},
],
};
module.exports = config;