@spscommerce/e2e-core 2.6.0 → 2.6.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/.dockerignore +1 -1
- package/README.md +2 -2
- package/eslint.config.mjs +3 -1
- package/lib/matchersSetup.js +0 -1
- package/lib/matchersSetup.js.map +1 -1
- package/package.json +1 -1
- package/{playwright.config.ts → playwright.config.js} +11 -8
- package/src/matchersSetup.ts +0 -1
package/.dockerignore
CHANGED
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
|
|
package/eslint.config.mjs
CHANGED
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,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