@spscommerce/e2e-core 2.3.0 → 2.3.1
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/lib/globalTeardown.js +3 -1
- package/lib/globalTeardown.js.map +1 -1
- package/package.json +1 -1
- package/playwright.config.js +18 -2
- package/src/globalTeardown.ts +3 -1
package/lib/globalTeardown.js
CHANGED
|
@@ -20,7 +20,9 @@ async function globalTeardown() {
|
|
|
20
20
|
.join('_')
|
|
21
21
|
.replace('_', ' ');
|
|
22
22
|
const newFilePath = `${newFolder}/${newFile}.${oldFile.split('.').pop()}`;
|
|
23
|
-
fs_1.default.
|
|
23
|
+
if (!fs_1.default.existsSync(newFilePath)) {
|
|
24
|
+
fs_1.default.copyFileSync(oldFilePath, newFilePath);
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalTeardown.js","sourceRoot":"","sources":["../src/globalTeardown.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAET,KAAK,UAAU,cAAc;IACxC,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,0BAA0B,CAAC,CAAC;IACvE,YAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,IAAI,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC1B,KAAK,MAAM,YAAY,IAAI,YAAE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;YAClD,KAAK,MAAM,OAAO,IAAI,YAAE,CAAC,WAAW,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,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,CAAC,SAAS,CAAC,EAAE;YAClD,KAAK,MAAM,OAAO,IAAI,YAAE,CAAC,WAAW,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,EAAE;gBACtE,MAAM,WAAW,GAAG,GAAG,SAAS,IAAI,YAAY,IAAI,OAAO,EAAE,CAAC;gBAC9D,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY;qBAChC,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;qBAC1C,KAAK,CAAC,GAAG,CAAC;qBACV,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;qBAChG,IAAI,CAAC,GAAG,CAAC;qBACT,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACvB,MAAM,WAAW,GAAG,GAAG,SAAS,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;gBAC1E,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;oBAC7B,YAAE,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;iBAC7C;aACJ;SACJ;KACJ;IACD,OAAO;AACX,CAAC;AAtBD,iCAsBC"}
|
package/package.json
CHANGED
package/playwright.config.js
CHANGED
|
@@ -7,13 +7,15 @@ if (process.env.CONFIG_PATH) {
|
|
|
7
7
|
|
|
8
8
|
const reportName = process.env.SUITE ? `${process.env.SUITE}.xml` : `TEST-result.xml`;
|
|
9
9
|
|
|
10
|
-
const customViewport = process.env.VIEWPORT ? JSON.parse(process.env.VIEWPORT) : { width: 1536, height:
|
|
10
|
+
const customViewport = process.env.VIEWPORT ? JSON.parse(process.env.VIEWPORT) : { width: 1536, height: 844 };
|
|
11
11
|
|
|
12
12
|
let browserProject = [];
|
|
13
13
|
switch (process.env.BROWSER) {
|
|
14
14
|
case 'firefox':
|
|
15
15
|
browserProject = [{
|
|
16
16
|
name: 'firefox',
|
|
17
|
+
testIgnore: /.*Inventory.*/,
|
|
18
|
+
testMatch: /.*(test|spec)\.(js|ts|mjs)/,
|
|
17
19
|
use: {
|
|
18
20
|
...devices['Desktop Firefox'],
|
|
19
21
|
userAgent: devices['Desktop Firefox'].userAgent + ' SPS auto test run',
|
|
@@ -24,6 +26,8 @@ switch (process.env.BROWSER) {
|
|
|
24
26
|
case 'webkit':
|
|
25
27
|
browserProject = [{
|
|
26
28
|
name: 'webkit',
|
|
29
|
+
testIgnore: /.*Inventory.*/,
|
|
30
|
+
testMatch: /.*(test|spec)\.(js|ts|mjs)/,
|
|
27
31
|
use: {
|
|
28
32
|
...devices['Desktop Safari'],
|
|
29
33
|
userAgent: devices['Desktop Safari'].userAgent + ' SPS auto test run',
|
|
@@ -34,6 +38,8 @@ switch (process.env.BROWSER) {
|
|
|
34
38
|
case 'edge':
|
|
35
39
|
browserProject = [{
|
|
36
40
|
name: 'msedge',
|
|
41
|
+
testIgnore: /.*Inventory.*/,
|
|
42
|
+
testMatch: /.*(test|spec)\.(js|ts|mjs)/,
|
|
37
43
|
use: {
|
|
38
44
|
channel: 'msedge',
|
|
39
45
|
...devices['Desktop Edge'],
|
|
@@ -45,6 +51,8 @@ switch (process.env.BROWSER) {
|
|
|
45
51
|
default:
|
|
46
52
|
browserProject = [{
|
|
47
53
|
name: 'chromium',
|
|
54
|
+
testIgnore: /.*Inventory.*/,
|
|
55
|
+
testMatch: /.*(test|spec)\.(js|ts|mjs)/,
|
|
48
56
|
use: {
|
|
49
57
|
channel: 'chrome',
|
|
50
58
|
...devices['Desktop Chrome'],
|
|
@@ -54,6 +62,14 @@ switch (process.env.BROWSER) {
|
|
|
54
62
|
}];
|
|
55
63
|
break;
|
|
56
64
|
}
|
|
65
|
+
// Added a specific no-retry suite workaround till the following request is done:
|
|
66
|
+
// https://github.com/microsoft/playwright/issues/10825
|
|
67
|
+
browserProject.push(
|
|
68
|
+
{
|
|
69
|
+
name: 'Inventory',
|
|
70
|
+
testMatch: /.*Inventory.*(test|spec)\.(js|ts|mjs)/,
|
|
71
|
+
retries: 0,
|
|
72
|
+
})
|
|
57
73
|
|
|
58
74
|
const storageStatePath = process.env.ENV && process.env.ENV.includes('prod')
|
|
59
75
|
? path.join(process.cwd(), 'results-e2e/auth/storageStateProd.json')
|
|
@@ -77,7 +93,7 @@ const config = {
|
|
|
77
93
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
78
94
|
forbidOnly: !!process.env.CI,
|
|
79
95
|
/* Retry on CI only */
|
|
80
|
-
retries:
|
|
96
|
+
retries: 1,//+process.env.RETRIES || 0,
|
|
81
97
|
/* Opt out of parallel tests on CI. */
|
|
82
98
|
workers: +process.env.WORKERS || 1,
|
|
83
99
|
/* Stop test suite execution after reaching this number of failed tests and skip any tests that were not executed yet. */
|
package/src/globalTeardown.ts
CHANGED
|
@@ -16,7 +16,9 @@ export default async function globalTeardown(): Promise<void> {
|
|
|
16
16
|
.join('_')
|
|
17
17
|
.replace('_', ' ');
|
|
18
18
|
const newFilePath = `${newFolder}/${newFile}.${oldFile.split('.').pop()}`;
|
|
19
|
-
fs.
|
|
19
|
+
if (!fs.existsSync(newFilePath)) {
|
|
20
|
+
fs.copyFileSync(oldFilePath, newFilePath);
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|