@applitools/eyes-cypress 3.23.3 → 3.23.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 3.23.7 - 2022/1/28
7
+
8
+ - add concurrency limitation on local server
9
+
10
+ ## 3.23.6 - 2022/1/20
11
+
12
+ - fix global hook overrides
13
+ - updated to @applitools/visual-grid-client@15.8.62 (from 15.8.57)
14
+
15
+ ## 3.23.5 - 2022/1/6
16
+
17
+ - updated to @applitools/dom-snapshot@4.5.12 (from 4.5.11)
18
+ - updated to @applitools/logger@1.0.9 (from 1.0.6)
19
+ - updated to @applitools/visual-grid-client@15.8.57 (from 15.8.50)
20
+
21
+ ## 3.23.4 - 2021/12/9
22
+
23
+ - updated to @applitools/visual-grid-client@15.8.50 (from 15.8.49)
24
+
6
25
  ## 3.23.3 - 2021/11/24
7
26
 
8
27
  - add timeout before capturing dom snapshot
package/README.md CHANGED
@@ -540,9 +540,6 @@ The list above is also the order of precedence, which means that if you pass a p
540
540
  | ------------- |:------------- |:----------- |
541
541
  | `testName` | The value of Cypress's test title | Test name. If this is not specified, the test name will be the title of the `it` block where the test is running. |
542
542
  | `browser` | { width: 800, height: 600, name: 'chrome' } | The size and browser of the generated screenshots. This doesn't need to be the same as the browser that Cypress is running. It could be a different size and also a different browser. For more info and possible values, see the [browser section below](#configuring-the-browser).|
543
- | `batchId` | random | Provides ability to group tests into batches. Read more about batches [here](https://applitools.com/docs/topics/working-with-test-batches/how-to-group-tests-into-batches.html). |
544
- | `batchName` | The name of the first test in the batch | Provides a name to the batch (for display purpose only). |
545
- | `batchSequenceName` | undefined | Name for managing batch statistics. |
546
543
  | `baselineEnvName` | undefined | The name of the environment of the baseline. |
547
544
  | `envName` | undefined | A name for the environment in which the application under test is running. |
548
545
  | `ignoreCaret` | false | Whether to ignore or the blinking caret or not when comparing images. |
@@ -555,7 +552,6 @@ The list above is also the order of precedence, which means that if you pass a p
555
552
  | `ignoreDisplacements` | false | Sets whether Test Manager should intially display mismatches for image features that have only been displaced, as opposed to real mismatches. |
556
553
  | `compareWithParentBranch` | false | |
557
554
  | `ignoreBaseline` | false | |
558
- | `notifyOnCompletion` | false | If `true` batch completion notifications are sent. |
559
555
  | `accessibilityValidation` | undefined | An object that specifies the accessibility level and guidelines version to use for the screenshots. Possible values for **level** are `None`, `AA` and `AAA`, and possible values for **guidelinesVersion** are `WCAG_2_0` and `WCAG_2_1`. For example: `{level: 'AA', guidelinesVersion: 'WCAG_2_0'}`|
560
556
  | `visualGridOptions` | undefined | An object that specifies options to configure renderings on the Ultrafast grid. See more information [here](#visualgridoptions) |
561
557
  |`layoutBreakpoints`| undefined | When set to `true`, a snapshot of the DOM will be taken once for each browser/device size in the `browser` configuration. For optimization purposes, an array of numbers can be passed. The DOM snapshot will be taken once for every **width** in the array. For more information, see [layoutBreakpoints](#layoutBreakpoints)|
@@ -565,20 +561,26 @@ The list above is also the order of precedence, which means that if you pass a p
565
561
 
566
562
  The following configuration properties cannot be defined using the first method of passing them to `cy.eyesOpen`. They should be defined either in the `applitools.config.js` file or as environment variables.
567
563
 
568
- | Property name | Default value | Description |
569
- | ------------- |:------------- |:----------- |
570
- | `apiKey` | undefined | The API key used for working with the Applitools Eyes server. See more info in the [Applitools API key](#applitools-api-key) section above |
571
- | `showLogs` | false | Whether or not you want to see logs of the Eyes-Cypress plugin. Logs are written to the same output of the Cypress process. |
572
- | `serverUrl` | Default Eyes server URL | The URL of Eyes server |
573
- | `proxy` | undefined | Sets the proxy settings to be used in network requests to Eyes server. This can be either a string to the proxy URI, or an object containing the URI, username and password.<br/><br/>For example:<br/>`{url: 'https://myproxy.com:443', username: 'my_user', password: 'my_password', isHttpOnly: false}`<br/>or:<br/>`"https://username:password@myproxy.com:443"`|
574
- | `isDisabled` | false | If true, all calls to Eyes-Cypress commands will be silently ignored. |
575
- | `failCypressOnDiff` | true | If true, then the Cypress test fails if an eyes visual test fails. If false and an eyes test fails, then the Cypress test does not fail.
576
- | `tapDirPath` | undefined | Directory path of a results file. If set, then a [TAP](https://en.wikipedia.org/wiki/Test_Anything_Protocol#Specification) file is created in this directory, the tap file name is created with the name [ISO-DATE](https://en.wikipedia.org/wiki/ISO_8601)\-eyes.tap and contains the Eyes test results (Note that because of a current Cypress [limitation](https://github.com/cypress-io/cypress-documentation/issues/818) the results are scoped per spec file, this means that the results file is created once for each spec file).|
577
- | `testConcurrency` | 5 | The maximum number of tests that can run concurrently. The default value is the allowed amount for free accounts. For paid accounts, set this number to the quota set for your account. |
578
- |`dontCloseBatches`| false | If true, batches are not closed for [notifyOnCompletion](#advanced-configuration).|
579
- |`disableBrowserFetching`| false | If true, page resources for rendering on the UFG will be fetched from outside of the browser.|
580
- |`enablePatterns`| false | |
581
- |`useDom`| false | |
564
+ | Property name | Default value | Description |
565
+ | ------------- |:------------- |:----------- |
566
+ | `apiKey` | undefined | The API key used for working with the Applitools Eyes server. See more info in the [Applitools API key](#applitools-api-key) section above |
567
+ | `showLogs` | false | Whether or not you want to see logs of the Eyes-Cypress plugin. Logs are written to the same output of the Cypress process. |
568
+ | `serverUrl` | Default Eyes server URL | The URL of Eyes server |
569
+ | `proxy` | undefined | Sets the proxy settings to be used in network requests to Eyes server. This can be either a string to the proxy URI, or an object containing the URI, username and password.<br/><br/>For example:<br/>`{url: 'https://myproxy.com:443', username: 'my_user', password: 'my_password', isHttpOnly: false}`<br/>or:<br/>`"https://username:password@myproxy.com:443"`|
570
+ | `isDisabled` | false | If true, all calls to Eyes-Cypress commands will be silently ignored. |
571
+ | `failCypressOnDiff` | true | If true, then the Cypress test fails if an eyes visual test fails. If false and an eyes test fails, then the Cypress test does not fail.
572
+ | `tapDirPath` | undefined | Directory path of a results file. If set, then a [TAP](https://en.wikipedia.org/wiki/Test_Anything_Protocol#Specification) file is created in this directory, the tap file name is created with the name [ISO-DATE](https://en.wikipedia.org/wiki/ISO_8601)\-eyes.tap and contains the Eyes test results (Note that because of a current Cypress [limitation](https://github.com/cypress-io/cypress-documentation/issues/818) the results are scoped per spec file, this means that the results file is created once for each spec file).|
573
+ | `testConcurrency` | 5 | The maximum number of tests that can run concurrently. The default value is the allowed amount for free accounts. For paid accounts, set this number to the quota set for your account. |
574
+ |`dontCloseBatches` | false | If true, batches are not closed for [notifyOnCompletion](#advanced-configuration).|
575
+ |`disableBrowserFetching` | false | If true, page resources for rendering on the UFG will be fetched from outside of the browser.|
576
+ |`enablePatterns` | false | |
577
+ |`useDom` | false | |
578
+ | `batch` | undefined | An object which describes different aspects of the batch. The following lines in this table depict the various ways to configure the batch. |
579
+ | `batch.id` | random | Provides ability to group tests into batches. Read more about batches [here](https://applitools.com/docs/topics/working-with-test-batches/how-to-group-tests-into-batches.html). |
580
+ | `batch.name` | The name of the first test in the batch | Provides a name to the batch (for display purpose only). |
581
+ | `batch.sequenceName` | undefined | Name for managing batch statistics. |
582
+ | `batch.notifyOnCompletion` | false | If `true` batch completion notifications are sent. |
583
+ | `batch.properties` | undefined | Custom properties for the entire batch. The format is an array of objects with name/value properties. For example: `[{name: 'My prop', value:'My value'}]`. |
582
584
 
583
585
 
584
586
  ### Method 1: Arguments for `cy.eyesOpen`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-cypress",
3
- "version": "3.23.3",
3
+ "version": "3.23.7",
4
4
  "main": "index.js",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "cypress": "cd test/fixtures/testApp && cypress open --config integrationFolder=cypress/integration-play,pluginsFile=cypress/plugins/index-play.js,supportFile=cypress/support/index-play.js",
17
17
  "cypress:run": "cd test/fixtures/testApp && cypress run --config integrationFolder=cypress/integration-run,pluginsFile=cypress/plugins/index-run.js,supportFile=cypress/support/index-run.js",
18
18
  "cypress:play": "cd test/fixtures/testApp && cypress run --config integrationFolder=cypress/integration-play,pluginsFile=cypress/plugins/index-play.js,supportFile=cypress/support/index-run.js --spec=cypress/integration-play/play.js",
19
- "preversion": "bongo preversion --skip-deps && yarn test",
19
+ "gh:publish": "gh workflow run publish-cypress.yml --ref $(git rev-parse --abbrev-ref HEAD)",
20
+ "preversion": "bongo preversion --skip-deps",
20
21
  "version": "bongo version",
21
22
  "postversion": "bongo postversion --skip-release-notification",
22
23
  "deps": "bongo deps",
@@ -39,22 +40,22 @@
39
40
  "directory": "packages/eyes-cypress"
40
41
  },
41
42
  "dependencies": {
42
- "@applitools/dom-snapshot": "4.5.11",
43
+ "@applitools/dom-snapshot": "4.5.12",
43
44
  "@applitools/functional-commons": "1.6.0",
44
- "@applitools/logger": "1.0.6",
45
- "@applitools/visual-grid-client": "15.8.49",
45
+ "@applitools/logger": "1.0.9",
46
+ "@applitools/visual-grid-client": "15.8.62",
46
47
  "body-parser": "1.19.0",
47
48
  "chalk": "3.0.0",
48
49
  "cors": "2.8.5",
49
50
  "express": "4.17.1",
50
- "lodash.flatten": "4.4.0"
51
+ "lodash.flatten": "4.4.0",
52
+ "throat": "6.0.1"
51
53
  },
52
54
  "devDependencies": {
53
- "@applitools/scripts": "^1.0.1",
54
- "@applitools/sdk-release-kit": "0.13.4",
55
- "@applitools/sdk-shared": "0.9.9",
55
+ "@applitools/scripts": "^1.1.0",
56
+ "@applitools/sdk-release-kit": "0.13.11",
56
57
  "@applitools/snaptdout": "1.0.1",
57
- "@applitools/test-server": "1.0.7",
58
+ "@applitools/test-server": "1.0.8",
58
59
  "chai": "^4.2.0",
59
60
  "chai-spies": "^1.0.0",
60
61
  "cookie-parser": "^1.4.4",
@@ -68,7 +69,7 @@
68
69
  "mocha": "^8.0.1",
69
70
  "morgan": "^1.9.1",
70
71
  "ncp": "^2.0.0",
71
- "node-fetch": "^2.6.0",
72
+ "node-fetch": "^2.6.7",
72
73
  "prettier": "^1.19.1",
73
74
  "typescript": "^3.9.2"
74
75
  },
@@ -53,7 +53,7 @@ Cypress.Commands.add('eyesOpen', function(args = {}) {
53
53
  Cypress.config('eyesOpenArgs', args);
54
54
  Cypress.log({name: 'Eyes: open'});
55
55
  const userAgent = navigator.userAgent;
56
- const {title: testName} = this.currentTest || this.test;
56
+ const {title: testName} = this.currentTest || this.test || Cypress.currentTest;
57
57
  const {browser: eyesOpenBrowser, isDisabled} = args;
58
58
  const globalBrowser = getGlobalConfigProperty('eyesBrowser');
59
59
  const defaultBrowser = {
@@ -1,7 +1,9 @@
1
1
  'use strict';
2
+ const throat = require('throat');
3
+ const CONCURRENCY_LIMITATION = 100;
2
4
 
3
5
  function makeSend(port, fetch) {
4
- return function send({
6
+ const send = function send({
5
7
  command,
6
8
  data,
7
9
  method = 'POST',
@@ -13,6 +15,8 @@ function makeSend(port, fetch) {
13
15
  headers,
14
16
  });
15
17
  };
18
+
19
+ return throat(CONCURRENCY_LIMITATION, send);
16
20
  }
17
21
 
18
22
  module.exports = makeSend;
@@ -10,14 +10,18 @@ function makePluginExport({startServer, eyesConfig, globalHooks}) {
10
10
  const {eyesPort, closeServer} = await startServer();
11
11
  closeEyesServer = closeServer;
12
12
  const [origOn, config] = args;
13
- let isGlobalHookCalledFromUserHandler = false;
13
+ const isGlobalHookCalledFromUserHandlerMap = new Map();
14
14
  eyesConfig.eyesIsGlobalHooksSupported = isGlobalHooksSupported(config);
15
15
  const moduleExportsResult = await pluginModuleExports(onThatCallsUserDefinedHandler, config);
16
- if (eyesConfig.eyesIsGlobalHooksSupported && !isGlobalHookCalledFromUserHandler) {
16
+
17
+ if (eyesConfig.eyesIsGlobalHooksSupported) {
17
18
  for (const [eventName, eventHandler] of Object.entries(globalHooks)) {
18
- origOn.call(this, eventName, eventHandler);
19
+ if (!isGlobalHookCalledFromUserHandlerMap.get(eventName)) {
20
+ origOn.call(this, eventName, eventHandler);
21
+ }
19
22
  }
20
23
  }
24
+
21
25
  return Object.assign({}, eyesConfig, {eyesPort}, moduleExportsResult);
22
26
 
23
27
  // This piece of code exists because at the point of writing, Cypress does not support multiple event handlers:
@@ -29,7 +33,7 @@ function makePluginExport({startServer, eyesConfig, globalHooks}) {
29
33
  let handlerToCall = handler;
30
34
  if (eyesConfig.eyesIsGlobalHooksSupported && isRunEvent) {
31
35
  handlerToCall = handlerThatCallsUserDefinedHandler;
32
- isGlobalHookCalledFromUserHandler = true;
36
+ isGlobalHookCalledFromUserHandlerMap.set(eventName, true);
33
37
  }
34
38
  return origOn.call(this, eventName, handlerToCall);
35
39