@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 CHANGED
@@ -3,6 +3,6 @@
3
3
  # White list the required files
4
4
  !.yarnrc.yml
5
5
  !package.json
6
- !playwright.config.ts
6
+ !playwright.config.js
7
7
  !tsconfig.json
8
8
  !yarn.lock
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.ts",
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.ts"
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
@@ -32,5 +32,7 @@ export default defineConfig([globalIgnores(["node_modules/*", "lib/*"]), {
32
32
  plugins: {
33
33
  "@typescript-eslint": typescriptEslint,
34
34
  },
35
- rules: {},
35
+ rules: {
36
+ "@typescript-eslint/no-require-imports": "off",
37
+ },
36
38
  }]);
@@ -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;
@@ -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,iEAAiE;AACjE,MAAM,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAExB,kBAAe,MAAM,CAAC"}
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@spscommerce/e2e-core",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
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,13 +1,11 @@
1
- import path from 'path';
2
- import { devices } from '@playwright/test';
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
- export default config;
164
+ module.exports = config;
@@ -3,7 +3,6 @@ import withMessage from 'jest-expect-message/dist/withMessage.js';
3
3
 
4
4
  const expect = withMessage(test.expect);
5
5
 
6
- // eslint-disable-next-line @typescript-eslint/no-require-imports
7
6
  const matchers = require('jest-extended');
8
7
  expect.extend(matchers);
9
8