@spscommerce/e2e-core 2.6.0 → 2.8.0
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/.dockerignore +4 -3
- package/.env +1 -0
- package/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/Dockerfile +2 -2
- package/README.md +5 -4
- package/commitlint.config.js +1 -0
- package/eslint.config.mjs +28 -20
- package/lib/globalSetup.js +19 -10
- package/lib/globalSetup.js.map +1 -1
- package/lib/loggerSetup.js +3 -3
- package/lib/loggerSetup.js.map +1 -1
- package/lib/matchersSetup.js +0 -1
- package/lib/matchersSetup.js.map +1 -1
- package/package.json +19 -7
- package/{playwright.config.ts → playwright.config.js} +11 -8
- package/src/matchersSetup.ts +0 -1
- package/.yarnrc.yml +0 -1
package/.dockerignore
CHANGED
package/.env
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm commitlint --edit $1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx lint-staged --allow-empty
|
package/Dockerfile
CHANGED
|
@@ -5,7 +5,7 @@ ARG BROWSER
|
|
|
5
5
|
RUN mkdir e2e
|
|
6
6
|
WORKDIR /e2e
|
|
7
7
|
COPY . .
|
|
8
|
-
RUN corepack enable && corepack prepare
|
|
9
|
-
RUN
|
|
8
|
+
RUN corepack enable && corepack prepare pnpm@10.28.0 --activate
|
|
9
|
+
RUN pnpm i
|
|
10
10
|
RUN if [ "$BROWSER" = "edge" ]; then npx playwright install msedge --only-shell ; fi
|
|
11
11
|
RUN if [ "$BROWSER" = "chrome" ]; then npx playwright install chrome --only-shell ; fi
|
package/README.md
CHANGED
|
@@ -78,8 +78,8 @@ It allows to set url for testing via CLI instead of setting it up in .env file.
|
|
|
78
78
|
|
|
79
79
|
6. Setup the following "scripts" commands in the `package.json` according to your paths:
|
|
80
80
|
```
|
|
81
|
-
"test": ". .credentials.sh && CONFIG_PATH=$(pwd)/.env SETUP_PATH=$(pwd)/src/helpers/urlSetup.js TEST_DIR=$(pwd) HEADLESS=false playwright test --config=node_modules/@spscommerce/e2e-core/playwright.config.
|
|
82
|
-
"test:ci": "CONFIG_PATH=$(pwd)/.env SETUP_PATH=$(pwd)/src/helpers/urlSetup.js TEST_DIR=$(pwd) CI=true playwright test --config=node_modules/@spscommerce/e2e-core/playwright.config.
|
|
81
|
+
"test": ". .credentials.sh && CONFIG_PATH=$(pwd)/.env SETUP_PATH=$(pwd)/src/helpers/urlSetup.js TEST_DIR=$(pwd) HEADLESS=false playwright test --config=node_modules/@spscommerce/e2e-core/playwright.config.js",
|
|
82
|
+
"test:ci": "CONFIG_PATH=$(pwd)/.env SETUP_PATH=$(pwd)/src/helpers/urlSetup.js TEST_DIR=$(pwd) CI=true playwright test --config=node_modules/@spscommerce/e2e-core/playwright.config.js"
|
|
83
83
|
```
|
|
84
84
|
7. Add your first test file (see Example.test.ts file).
|
|
85
85
|
|
|
@@ -120,7 +120,8 @@ ARG BROWSER
|
|
|
120
120
|
RUN mkdir e2e
|
|
121
121
|
WORKDIR /e2e
|
|
122
122
|
COPY . .
|
|
123
|
-
RUN
|
|
123
|
+
RUN corepack enable && corepack prepare pnpm@10.28.0 --activate
|
|
124
|
+
RUN pnpm i
|
|
124
125
|
RUN if [ "$BROWSER" = "edge" ]; then npx playwright install msedge; fi
|
|
125
126
|
RUN if [ "$BROWSER" = "chrome" ]; then npx playwright install chrome; fi
|
|
126
127
|
```
|
|
@@ -129,7 +130,7 @@ RUN if [ "$BROWSER" = "chrome" ]; then npx playwright install chrome; fi
|
|
|
129
130
|
> You can find exact version here: https://mcr.microsoft.com/en-us/product/playwright/tags
|
|
130
131
|
|
|
131
132
|
## Publish package
|
|
132
|
-
If you want to publish your package to the npm registry and have changed any files from `src` folder, you must build the package first. Run the following command: `
|
|
133
|
+
If you want to publish your package to the npm registry and have changed any files from `src` folder, you must build the package first. Run the following command: `pnpm build`.
|
|
133
134
|
After that, push changed files from the `lib` and `src` folders to your PR. You need to follow the [pattern](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) of the semantic commit messages (should begin from __fix:__ or __feat:__), like:
|
|
134
135
|
```
|
|
135
136
|
fix: Update Dockerfile to restore build process
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { extends: ['@commitlint/config-conventional'] };
|
package/eslint.config.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import globals from 'globals';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import {fileURLToPath} from 'node:url';
|
|
4
|
+
import {defineConfig, globalIgnores} from 'eslint/config';
|
|
5
5
|
|
|
6
6
|
import tsParser from '@typescript-eslint/parser';
|
|
7
7
|
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
8
8
|
import js from '@eslint/js';
|
|
9
|
-
import {
|
|
9
|
+
import {FlatCompat} from '@eslint/eslintrc';
|
|
10
10
|
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = path.dirname(__filename);
|
|
@@ -14,23 +14,31 @@ const compat = new FlatCompat({
|
|
|
14
14
|
baseDirectory: __dirname, recommendedConfig: js.configs.recommended, allConfig: js.configs.all
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
export default defineConfig([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
export default defineConfig([
|
|
18
|
+
globalIgnores([
|
|
19
|
+
"node_modules/*",
|
|
20
|
+
"lib/*"
|
|
21
|
+
]),
|
|
22
|
+
{
|
|
23
|
+
languageOptions: {
|
|
24
|
+
globals: {
|
|
25
|
+
...globals.browser,
|
|
26
|
+
...globals.amd,
|
|
27
|
+
...globals.node,
|
|
28
|
+
},
|
|
29
|
+
parser: tsParser,
|
|
30
|
+
ecmaVersion: 12,
|
|
31
|
+
sourceType: "module",
|
|
32
|
+
parserOptions: {},
|
|
23
33
|
},
|
|
24
|
-
parser: tsParser,
|
|
25
|
-
ecmaVersion: 12,
|
|
26
|
-
sourceType: "module",
|
|
27
|
-
parserOptions: {},
|
|
28
|
-
},
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
extends: compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
plugins: {
|
|
38
|
+
"@typescript-eslint": typescriptEslint,
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
]);
|
package/lib/globalSetup.js
CHANGED
|
@@ -15,18 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
|
-
var _a;
|
|
29
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.default = globalSetup;
|
|
30
40
|
const fs_1 = __importDefault(require("fs"));
|
|
31
41
|
const path_1 = __importDefault(require("path"));
|
|
32
42
|
const test_1 = require("@playwright/test");
|
|
@@ -43,7 +53,7 @@ async function globalSetup() {
|
|
|
43
53
|
// Set something up once before running auth flow
|
|
44
54
|
if (process.env.SETUP_PATH) {
|
|
45
55
|
if (fs_1.default.existsSync(process.env.SETUP_PATH)) {
|
|
46
|
-
await (
|
|
56
|
+
await Promise.resolve(`${process.env.SETUP_PATH}`).then(s => __importStar(require(s)));
|
|
47
57
|
}
|
|
48
58
|
else {
|
|
49
59
|
throw new Error(`Provided SETUP_PATH was not found.`);
|
|
@@ -99,5 +109,4 @@ async function globalSetup() {
|
|
|
99
109
|
}
|
|
100
110
|
return;
|
|
101
111
|
}
|
|
102
|
-
exports.default = globalSetup;
|
|
103
112
|
//# sourceMappingURL=globalSetup.js.map
|
package/lib/globalSetup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.js","sourceRoot":"","sources":["../src/globalSetup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"globalSetup.js","sourceRoot":"","sources":["../src/globalSetup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,8BAiEC;AArED,4CAAoB;AACpB,gDAAwB;AACxB,2CAA4C;AAE7B,KAAK,UAAU,WAAW;IACrC,kEAAkE;IAClE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IAC/D,IAAI,YAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,KAAK,MAAM,SAAS,IAAI,YAAE,CAAC,W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BAAwB,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBACrE,MAAM,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBAClD,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;gBACzC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;oBAClC,MAAM,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;oBAC1D,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;gBAC/C,CAAC;gBACD,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;oBACpC,MAAM,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBAC9C,CAAC;gBACD,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;gBACvD,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;YAC7D,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACf,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;gBAChD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACzE,CAAC;oBAAS,CAAC;gBACP,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO;AACX,CAAC"}
|
package/lib/loggerSetup.js
CHANGED
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.log =
|
|
6
|
+
exports.log = void 0;
|
|
7
|
+
exports.enableLogger = enableLogger;
|
|
8
|
+
exports.disableLogger = disableLogger;
|
|
7
9
|
const fs_1 = __importDefault(require("fs"));
|
|
8
10
|
const path_1 = __importDefault(require("path"));
|
|
9
11
|
let access;
|
|
@@ -49,7 +51,6 @@ async function enableLogger(file, page) {
|
|
|
49
51
|
});
|
|
50
52
|
return;
|
|
51
53
|
}
|
|
52
|
-
exports.enableLogger = enableLogger;
|
|
53
54
|
async function disableLogger() {
|
|
54
55
|
// Finish error writing
|
|
55
56
|
if (access) {
|
|
@@ -57,6 +58,5 @@ async function disableLogger() {
|
|
|
57
58
|
}
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
|
-
exports.disableLogger = disableLogger;
|
|
61
61
|
exports.log = console.log.bind(console);
|
|
62
62
|
//# sourceMappingURL=loggerSetup.js.map
|
package/lib/loggerSetup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loggerSetup.js","sourceRoot":"","sources":["../src/loggerSetup.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"loggerSetup.js","sourceRoot":"","sources":["../src/loggerSetup.ts"],"names":[],"mappings":";;;;;;AAMA,oCA8CC;AAED,sCAMC;AA5DD,4CAAoB;AACpB,gDAAwB;AAGxB,IAAI,MAAsB,CAAC;AAEpB,KAAK,UAAU,YAAY,CAAC,IAAc,EAAE,IAAU;IACzD,QAAQ;IACR,IAAI;IACJ,8CAA8C;IAC9C,0CAA0C;IAC1C,yBAAyB;IACzB,4DAA4D;IAC5D,IAAI;IACJ,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAG,GAAG,KAAK,IAAI,IAAI,E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,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC/D,CAAC,CAAC;SACD,EAAE,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE;QACzB,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,uBAAuB,QAAQ,CAAC,MAAM,EAAE,KAAK,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/E,CAAC;IACL,CAAC,CAAC,CAAA;IACN,OAAO;AACX,CAAC;AAEM,KAAK,UAAU,aAAa;IAC/B,uBAAuB;IACvB,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,CAAC,GAAG,EAAE,CAAC;IACjB,CAAC;IACD,OAAO;AACX,CAAC;AAEY,QAAA,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC"}
|
package/lib/matchersSetup.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const test_1 = require("@playwright/test");
|
|
7
7
|
const withMessage_js_1 = __importDefault(require("jest-expect-message/dist/withMessage.js"));
|
|
8
8
|
const expect = (0, withMessage_js_1.default)(test_1.test.expect);
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
10
9
|
const matchers = require('jest-extended');
|
|
11
10
|
expect.extend(matchers);
|
|
12
11
|
exports.default = expect;
|
package/lib/matchersSetup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchersSetup.js","sourceRoot":"","sources":["../src/matchersSetup.ts"],"names":[],"mappings":";;;;;AAAA,2CAAwC;AACxC,6FAAkE;AAElE,MAAM,MAAM,GAAG,IAAA,wBAAW,EAAC,WAAI,CAAC,MAAM,CAAC,CAAC;AAExC,
|
|
1
|
+
{"version":3,"file":"matchersSetup.js","sourceRoot":"","sources":["../src/matchersSetup.ts"],"names":[],"mappings":";;;;;AAAA,2CAAwC;AACxC,6FAAkE;AAElE,MAAM,MAAM,GAAG,IAAA,wBAAW,EAAC,WAAI,CAAC,MAAM,CAAC,CAAC;AAExC,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAExB,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/e2e-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "eslint .",
|
|
9
9
|
"build": "tsc --incremental -p tsconfig.json",
|
|
10
|
-
"test": "CONFIG_PATH=$(pwd)/.env HEADLESS=false playwright test"
|
|
10
|
+
"test": "CONFIG_PATH=$(pwd)/.env HEADLESS=false playwright test",
|
|
11
|
+
"prepare": "husky || true"
|
|
11
12
|
},
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
@@ -26,15 +27,26 @@
|
|
|
26
27
|
"license": "UNLICENSED",
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"@playwright/test": "1.57.0",
|
|
29
|
-
"@types/node": "
|
|
30
|
+
"@types/node": "25.0.6",
|
|
30
31
|
"@typescript-eslint/eslint-plugin": "8.49.0",
|
|
31
32
|
"@typescript-eslint/parser": "8.49.0",
|
|
32
|
-
"dotenv": "
|
|
33
|
-
"eslint": "9.39.
|
|
33
|
+
"dotenv": "17.2.3",
|
|
34
|
+
"eslint": "9.39.2",
|
|
34
35
|
"jest-expect-message": "1.1.3",
|
|
35
36
|
"jest-extended": "1.2.1",
|
|
36
37
|
"playwright-testrail-reporter": "1.3.3",
|
|
37
|
-
"typescript": "
|
|
38
|
+
"typescript": "5.9.3"
|
|
38
39
|
},
|
|
39
|
-
"packageManager": "
|
|
40
|
+
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48",
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@commitlint/cli": "^20.3.0",
|
|
43
|
+
"@commitlint/config-conventional": "^20.3.0",
|
|
44
|
+
"husky": "^9.1.7",
|
|
45
|
+
"lint-staged": "^16.2.7"
|
|
46
|
+
},
|
|
47
|
+
"lint-staged": {
|
|
48
|
+
"*.ts": [
|
|
49
|
+
"eslint --max-warnings=0 --no-warn-ignored --fix"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
40
52
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import dotenv from 'dotenv';
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { devices } = require('@playwright/test');
|
|
4
3
|
|
|
5
4
|
if (process.env.CONFIG_PATH) {
|
|
6
|
-
dotenv.config({ path: process.env.CONFIG_PATH });
|
|
5
|
+
require('dotenv').config({ path: process.env.CONFIG_PATH });
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
const reportName = process.env.SUITE ? `${process.env.SUITE}.xml` : `TEST-result.xml`;
|
|
10
|
-
|
|
11
9
|
const customViewport = process.env.VIEWPORT ? JSON.parse(process.env.VIEWPORT) : { width: 1536, height: 844 };
|
|
12
10
|
|
|
13
11
|
let browserProject = [];
|
|
@@ -101,6 +99,8 @@ const storageStatePath = process.env.ENV && process.env.ENV.includes('prod')
|
|
|
101
99
|
* See https://playwright.dev/docs/test-configuration
|
|
102
100
|
*/
|
|
103
101
|
|
|
102
|
+
// @ts-check
|
|
103
|
+
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
|
104
104
|
const config = {
|
|
105
105
|
/* Directory that will be recursively scanned for test files */
|
|
106
106
|
testDir: process.env.TEST_DIR,
|
|
@@ -122,11 +122,14 @@ const config = {
|
|
|
122
122
|
reporter: [
|
|
123
123
|
['junit', { outputFile: path.join(process.cwd(), `results-e2e/reports/${reportName}`) }],
|
|
124
124
|
['list'],
|
|
125
|
-
// Testrail custom reporter
|
|
126
|
-
...(process.env.TESTRAIL_REPORT && process.env.TESTRAIL_REPORT === 'true' ? [['playwright-testrail-reporter']] : []),
|
|
127
125
|
// Special reporters to transform video-s/screen-s to the form what can be displayed in the TestingInspector attachments
|
|
128
126
|
[path.resolve(__dirname, './lib/reporters/screenshots')],
|
|
129
127
|
[path.resolve(__dirname, './lib/reporters/junitFix'), { reportJunitFile: `results-e2e/reports/${reportName}` }],
|
|
128
|
+
// Testrail custom reporter
|
|
129
|
+
...(process.env.TESTRAIL_REPORT && process.env.TESTRAIL_REPORT === 'true'
|
|
130
|
+
? [['playwright-testrail-reporter']]
|
|
131
|
+
: []
|
|
132
|
+
),
|
|
130
133
|
],
|
|
131
134
|
/* Global setup file must export a single function. This function will be run once before all the tests */
|
|
132
135
|
globalSetup: require.resolve('./lib/globalSetup'),
|
|
@@ -158,4 +161,4 @@ const config = {
|
|
|
158
161
|
outputDir: path.join(process.cwd(), 'results-e2e-raw/')
|
|
159
162
|
};
|
|
160
163
|
|
|
161
|
-
|
|
164
|
+
module.exports = config;
|
package/src/matchersSetup.ts
CHANGED
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|