@spscommerce/e2e-core 2.2.8 → 2.2.9
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/.eslintrc.js +2 -0
- package/package.json +3 -3
- package/src/globalSetup.ts +1 -3
- package/src/globalTeardown.ts +1 -3
- package/src/loggerSetup.ts +3 -1
package/.eslintrc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/e2e-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.9",
|
|
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",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@alex_neo/jest-expect-message": "^1.0.5",
|
|
28
28
|
"@playwright/test": "^1.21.1",
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
30
|
-
"@typescript-eslint/parser": "^
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^5.22.0",
|
|
30
|
+
"@typescript-eslint/parser": "^5.22.0",
|
|
31
31
|
"dotenv": "^16.0.0",
|
|
32
32
|
"eslint": "^7.32.0",
|
|
33
33
|
"jest-extended": "^1.2.0",
|
package/src/globalSetup.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { chromium } from '@playwright/test';
|
|
|
5
5
|
const domain = 'commerce.spscommerce.com';
|
|
6
6
|
const baseUrl = process.env.ENV && process.env.ENV.includes('prod') ? 'https://' + domain : 'https://test.' + domain;
|
|
7
7
|
|
|
8
|
-
async function globalSetup() {
|
|
8
|
+
export default async function globalSetup(): Promise<void> {
|
|
9
9
|
// Remove custom sub-folders for test artifacts
|
|
10
10
|
const resultsFolder = path.join(process.cwd(), 'results-e2e/');
|
|
11
11
|
if (fs.existsSync(resultsFolder)) {
|
|
@@ -50,5 +50,3 @@ async function globalSetup() {
|
|
|
50
50
|
}
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
export default globalSetup;
|
package/src/globalTeardown.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
|
-
async function globalTeardown() {
|
|
4
|
+
export default async function globalTeardown(): Promise<void> {
|
|
5
5
|
const oldFolder = path.join(process.cwd(), 'results-e2e-raw/');
|
|
6
6
|
const newFolder = path.join(process.cwd(), 'results-e2e/screenshots/');
|
|
7
7
|
fs.mkdirSync(newFolder, { recursive: true });
|
|
@@ -17,5 +17,3 @@ async function globalTeardown() {
|
|
|
17
17
|
}
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
export default globalTeardown;
|
package/src/loggerSetup.ts
CHANGED
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Page } from '@playwright/test';
|
|
4
4
|
|
|
5
|
-
let access:
|
|
5
|
+
let access: fs.WriteStream;
|
|
6
6
|
|
|
7
7
|
export async function enableLogger(file: string[], page: Page): Promise<void> {
|
|
8
8
|
// file:
|
|
@@ -57,3 +57,5 @@ export async function disableLogger(): Promise<void> {
|
|
|
57
57
|
access && access.end();
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
export const log = console.log.bind(console);
|