@spscommerce/e2e-core 2.4.0 → 2.4.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/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM mcr.microsoft.com/playwright:v1.22.0-alpha-1652194905000-focal
1
+ FROM mcr.microsoft.com/playwright:v1.28.0-focal
2
2
 
3
3
  ARG BROWSER
4
4
 
package/Example.test.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { test } from '@playwright/test';
2
- // import { enableLogger, disableLogger, expect } from '@spscommerce/e2e-core';
3
- import expect from './src/matchersSetup';
1
+ import { test, expect } from '@playwright/test';
2
+ import expectExt from './src/matchersSetup';
4
3
  import { enableLogger, disableLogger } from './src/loggerSetup';
5
4
 
6
5
  test.describe('SPS_Example', () => {
@@ -14,13 +13,17 @@ test.describe('SPS_Example', () => {
14
13
  process.env.CI && await disableLogger();
15
14
  });
16
15
 
17
- test('Add_button_disabled_before_required_fields_filled', async ({ page }) => {
18
- await page.waitForTimeout(10000);
16
+ test('First_test', async ({ page }) => {
17
+ await page.waitForTimeout(5000);
19
18
  expect(
20
19
  true,
21
- // false,
22
20
  `Custom error message.`
23
21
  ).toBeTruthy();
22
+ expectExt(
23
+ [1, 2, 3, 4],
24
+ // false,
25
+ `Custom error message.`
26
+ ).toIncludeAllMembers([1, 2, 3]);
24
27
  });
25
28
 
26
29
  });
package/README.md CHANGED
@@ -20,6 +20,7 @@ export USER_PASSWORD="EXAMPLE_PASSWORD"
20
20
  5. Create .env file in the tests-e2e/ directory with an appropriate process.env variables listed below in the table. E.g.:
21
21
  ```
22
22
  TEST_TIMEOUT=75000
23
+ EXPECT_TIMEOUT=10000
23
24
  ACTION_TIMEOUT=45000
24
25
  WORKERS=6
25
26
  REPO_NAME=fulfillment-ui-v2
@@ -31,6 +32,7 @@ VIEWPORT={"width": 1920, "height": 1080}
31
32
  | BROWSER | use + as a separator, e.g edge+firefox | chromium | chromium, firefox, webkit, edge |
32
33
  | ENV | auth state is invoked for the defined env | test | test, prod |
33
34
  | TEST_TIMEOUT | global timeout for each test | 30000 | [number_in_ms] |
35
+ | EXPECT_TIMEOUT | global timeout for each expect | 5000 | [number_in_ms] |
34
36
  | ACTION_TIMEOUT | global timeout for each PW action, like click() | 30000 | [number_in_ms] |
35
37
  | SLOWMO | slows down the actions by the specified ms | 0 | [number_in_ms] |
36
38
  | WORKERS | number of workers (test threads) | 1 | [number] |
@@ -99,7 +101,7 @@ You can observe the PW trace file in 3 ways:
99
101
  ## Dockerfile
100
102
  PW provides an official Docker image. These image includes all the dependencies needed to run browsers in a Docker container, and also include the browsers themselves. Here is an example of the Dockerfile:
101
103
  ```
102
- FROM mcr.microsoft.com/playwright:v1.22.0-alpha-1652194905000-focal
104
+ FROM mcr.microsoft.com/playwright:v1.28.0-focal
103
105
 
104
106
  ARG BROWSER
105
107
 
@@ -184,11 +186,11 @@ Additional info over this framework could be found on [Confluence](https://atlas
184
186
  Put in a PR against this repo if you fix a bug or come up with an improvement!
185
187
 
186
188
  ## Used tools
187
- - [@alex_neo/jest-expect-message](https://github.com/alexneo2003/jest-expect-message) - gives ability to add a custom error message to the assertions. We use this forked lib since there is a [bug](https://github.com/mattphillips/jest-expect-message/issues/39) in the original one.
188
189
  - [@playwright/test](https://github.com/microsoft/playwright) - browser automation and test runner tool
189
190
  - [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) - ESLint plugin which provides lint rules for TypeScript codebases
190
191
  - [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint) - ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code
191
192
  - [dotenv](https://github.com/motdotla/dotenv) - loads environment variables from a .env file into process.env
192
193
  - [eslint](https://github.com/eslint/eslint) - static code analysis tool
194
+ - [jest-expect-message](https://github.com/mattphillips/jest-expect-message) - gives ability to add a custom error message to the assertions
193
195
  - [jest-extended](https://github.com/jest-community/jest-extended) - adds additional matchers to default ones making it easy to test everything 🙌
194
196
  - [typescript](https://github.com/Microsoft/TypeScript) - language for application-scale JavaScript that adds optional types
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const test_1 = require("@playwright/test");
7
- const withMessage_js_1 = __importDefault(require("@alex_neo/jest-expect-message/dist/withMessage.js"));
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
9
  const matchers = require('jest-extended');
10
10
  expect.extend(matchers);
@@ -1 +1 @@
1
- {"version":3,"file":"matchersSetup.js","sourceRoot":"","sources":["../src/matchersSetup.ts"],"names":[],"mappings":";;;;;AAAA,2CAAwC;AACxC,uGAA4E;AAE5E,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"}
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.4.0",
3
+ "version": "2.4.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",
@@ -24,13 +24,13 @@
24
24
  "author": "SPS Commerce",
25
25
  "license": "UNLICENSED",
26
26
  "dependencies": {
27
- "@alex_neo/jest-expect-message": "^1.0.5",
28
- "@playwright/test": "^1.22.0",
29
- "@typescript-eslint/eslint-plugin": "^5.22.0",
30
- "@typescript-eslint/parser": "^5.22.0",
31
- "dotenv": "^16.0.0",
32
- "eslint": "^7.32.0",
33
- "jest-extended": "^1.2.0",
34
- "typescript": "^4.4.4"
27
+ "@playwright/test": "1.28.0",
28
+ "@typescript-eslint/eslint-plugin": "5.30.0",
29
+ "@typescript-eslint/parser": "5.30.0",
30
+ "dotenv": "16.0.3",
31
+ "eslint": "7.32.0",
32
+ "jest-expect-message": "1.0.4",
33
+ "jest-extended": "1.2.0",
34
+ "typescript": "4.7.4"
35
35
  }
36
36
  }
@@ -93,7 +93,7 @@ const config = {
93
93
  timeout: +process.env.TEST_TIMEOUT || 30000,
94
94
  /* Maximum time expect() should wait for the condition to be met */
95
95
  expect: {
96
- timeout: 5000
96
+ timeout: +process.env.EXPECT_TIMEOUT || 5000,
97
97
  },
98
98
  /* Fail the build on CI if you accidentally left test.only in the source code */
99
99
  forbidOnly: !!process.env.CI,
@@ -1,5 +1,5 @@
1
1
  import { test } from '@playwright/test';
2
- import withMessage from '@alex_neo/jest-expect-message/dist/withMessage.js';
2
+ import withMessage from 'jest-expect-message/dist/withMessage.js';
3
3
 
4
4
  const expect = withMessage(test.expect);
5
5