@spscommerce/e2e-core 2.2.15 → 2.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/playwright.config.js +26 -10
package/package.json
CHANGED
package/playwright.config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const { devices } = require('@playwright/test');
|
|
2
3
|
|
|
3
4
|
if (process.env.CONFIG_PATH) {
|
|
4
5
|
require('dotenv').config({ path: process.env.CONFIG_PATH });
|
|
@@ -6,24 +7,38 @@ if (process.env.CONFIG_PATH) {
|
|
|
6
7
|
|
|
7
8
|
const reportName = process.env.SUITE ? `${process.env.SUITE}.xml` : `TEST-result.xml`;
|
|
8
9
|
|
|
10
|
+
const customViewport = process.env.VIEWPORT ? JSON.parse(process.env.VIEWPORT) : { width: 1536, height: 960 };
|
|
11
|
+
|
|
9
12
|
let browserProject = [];
|
|
10
13
|
switch (process.env.BROWSER) {
|
|
11
|
-
case 'chromium':
|
|
12
14
|
case 'firefox':
|
|
15
|
+
browserProject = [{
|
|
16
|
+
name: 'firefox',
|
|
17
|
+
use: {
|
|
18
|
+
...devices['Desktop Firefox'],
|
|
19
|
+
userAgent: devices['Desktop Firefox'].userAgent + ' SPS auto test run',
|
|
20
|
+
viewport: customViewport,
|
|
21
|
+
},
|
|
22
|
+
}];
|
|
23
|
+
break;
|
|
13
24
|
case 'webkit':
|
|
14
25
|
browserProject = [{
|
|
15
|
-
name:
|
|
26
|
+
name: 'webkit',
|
|
16
27
|
use: {
|
|
17
|
-
|
|
28
|
+
...devices['Desktop Safari'],
|
|
29
|
+
userAgent: devices['Desktop Safari'].userAgent + ' SPS auto test run',
|
|
30
|
+
viewport: customViewport,
|
|
18
31
|
},
|
|
19
32
|
}];
|
|
20
33
|
break;
|
|
21
|
-
case '
|
|
22
|
-
case 'chrome':
|
|
34
|
+
case 'edge':
|
|
23
35
|
browserProject = [{
|
|
24
|
-
name:
|
|
36
|
+
name: 'msedge',
|
|
25
37
|
use: {
|
|
26
|
-
channel:
|
|
38
|
+
channel: 'msedge',
|
|
39
|
+
...devices['Desktop Edge'],
|
|
40
|
+
userAgent: devices['Desktop Edge'].userAgent + ' SPS auto test run',
|
|
41
|
+
viewport: customViewport,
|
|
27
42
|
},
|
|
28
43
|
}];
|
|
29
44
|
break;
|
|
@@ -31,7 +46,10 @@ switch (process.env.BROWSER) {
|
|
|
31
46
|
browserProject = [{
|
|
32
47
|
name: 'chromium',
|
|
33
48
|
use: {
|
|
34
|
-
|
|
49
|
+
channel: 'chrome',
|
|
50
|
+
...devices['Desktop Chrome'],
|
|
51
|
+
userAgent: devices['Desktop Chrome'].userAgent + ' SPS auto test run',
|
|
52
|
+
viewport: customViewport,
|
|
35
53
|
},
|
|
36
54
|
}];
|
|
37
55
|
break;
|
|
@@ -80,8 +98,6 @@ const config = {
|
|
|
80
98
|
trace: process.env.TRACER && (process.env.TRACER.toString().toLowerCase() === 'true') ? 'retain-on-failure' : 'off',
|
|
81
99
|
/* Run in headless mode by default (if process.env.HEADLESS is not specified). */
|
|
82
100
|
headless: !process.env.HEADLESS || process.env.HEADLESS === 'true' ? true : false,
|
|
83
|
-
/* Emulates consistent viewport for each page. */
|
|
84
|
-
viewport: process.env.VIEWPORT ? JSON.parse(process.env.VIEWPORT) : { width: 1536, height: 960 },
|
|
85
101
|
/* Whether to ignore HTTPS errors when sending network requests. */
|
|
86
102
|
ignoreHTTPSErrors: true,
|
|
87
103
|
/* Base URL to use in actions like `await page.goto('/')`. */
|