@spscommerce/e2e-core 2.2.13 → 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.
@@ -13,7 +13,12 @@ async function globalTeardown() {
13
13
  for (const oldSubFolder of fs_1.default.readdirSync(oldFolder)) {
14
14
  for (const oldFile of fs_1.default.readdirSync(path_1.default.join(oldFolder, oldSubFolder))) {
15
15
  const oldFilePath = `${oldFolder}/${oldSubFolder}/${oldFile}`;
16
- const newFile = "SPS_" + oldSubFolder.substring(oldSubFolder.indexOf("SPS-")).split('-').slice(1, -1).join('_').replace('_', ' ');
16
+ const newFile = "SPS_" + oldSubFolder
17
+ .substring(oldSubFolder.indexOf("SPS") + 4)
18
+ .split('-')
19
+ .filter(e => !e.includes(process.env.BROWSER) && !e.includes('chromium') && !e.includes('retry'))
20
+ .join('_')
21
+ .replace('_', ' ');
17
22
  const newFilePath = `${newFolder}/${newFile}.${oldFile.split('.').pop()}`;
18
23
  fs_1.default.copyFileSync(oldFilePath, newFilePath);
19
24
  }
@@ -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,OAA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,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,YAAE,CAAC,YAAY,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;aAC7C;SACJ;KACJ;IACD,OAAO;AACX,CAAC;AApBD,iCAoBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spscommerce/e2e-core",
3
- "version": "2.2.13",
3
+ "version": "2.2.16",
4
4
  "description": "An automation test framework which is based on Playwright.",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -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: process.env.BROWSER,
26
+ name: 'webkit',
16
27
  use: {
17
- browserName: process.env.BROWSER,
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 'msedge':
22
- case 'chrome':
34
+ case 'edge':
23
35
  browserProject = [{
24
- name: process.env.BROWSER,
36
+ name: 'msedge',
25
37
  use: {
26
- channel: process.env.BROWSER,
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
- browserName: 'chromium',
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('/')`. */
@@ -9,7 +9,12 @@ export default async function globalTeardown(): Promise<void> {
9
9
  for (const oldSubFolder of fs.readdirSync(oldFolder)) {
10
10
  for (const oldFile of fs.readdirSync(path.join(oldFolder, oldSubFolder))) {
11
11
  const oldFilePath = `${oldFolder}/${oldSubFolder}/${oldFile}`;
12
- const newFile = "SPS_" + oldSubFolder.substring(oldSubFolder.indexOf("SPS-")).split('-').slice(1, -1).join('_').replace('_', ' ');
12
+ const newFile = "SPS_" + oldSubFolder
13
+ .substring(oldSubFolder.indexOf("SPS") + 4)
14
+ .split('-')
15
+ .filter(e => !e.includes(process.env.BROWSER) && !e.includes('chromium') && !e.includes('retry'))
16
+ .join('_')
17
+ .replace('_', ' ');
13
18
  const newFilePath = `${newFolder}/${newFile}.${oldFile.split('.').pop()}`;
14
19
  fs.copyFileSync(oldFilePath, newFilePath);
15
20
  }