@applitools/eyes-cypress 3.25.0 → 3.25.3

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
+
7
+ ## 3.25.3 - 2022/3/29
8
+
9
+ ### Features
10
+ ### Bug fixes
11
+ - consider batchId from config file and environments variable when closing batch
12
+ - Fix config file parameters (e.g. `browser`) not being passed
13
+
14
+ ## 3.25.2 - 2022/3/23
15
+
16
+ ### Features
17
+ ### Bug fixes
18
+ - fix Cypress Documentation inaccuracies
19
+ - Support batchId, batchName and batchSequenceName from the config file, eyesOpen and environment variables
20
+
21
+ ## 3.25.1 - 2022/3/15
22
+
23
+ - fix test script
24
+
6
25
  ## 3.25.0 - 2022/3/15
7
26
 
8
27
  - convert cypress to work on top of universal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-cypress",
3
- "version": "3.25.0",
3
+ "version": "3.25.3",
4
4
  "main": "index.js",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "bin": {
@@ -19,12 +19,12 @@
19
19
  "cypress:run": "cypress run --config-file test/fixtures/cypress-play.json --spec=test/fixtures/testApp/cypress/integration-play/play.js",
20
20
  "cypress:run:new": "node_modules/cypress-new/bin/cypress run --config-file test/fixtures/cypress-play.json --spec=test/fixtures/testApp/cypress/integration-play/play.js",
21
21
  "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",
22
- "preversion": "yarn build && bongo preversion --skip-deps",
23
- "version": "bongo version",
22
+ "preversion": "yarn build && bongo preversion --skip-deps --verifyPendingChanges",
23
+ "version": "bongo version --withPendingChanges",
24
24
  "postversion": "bongo postversion --skip-release-notification",
25
25
  "deps": "bongo deps",
26
26
  "generate:tests": "coverage-tests generate",
27
- "test:coverage": "yarn generate:tests && cd test/coverage/generic && unset APPLITOOLS_API_KEY && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-selenium' APPLITOOLS_BATCH_ID=$(uuidgen) cypress run ; cd -",
27
+ "test:coverage": "yarn generate:tests && cd test/coverage/generic && unset APPLITOOLS_API_KEY && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-selenium' APPLITOOLS_BATCH_ID=$(uuidgen) cypress run",
28
28
  "prepublish:setup": "sudo apt-get install xvfb"
29
29
  },
30
30
  "files": [
@@ -62,7 +62,7 @@
62
62
  "devDependencies": {
63
63
  "@applitools/scripts": "1.1.0",
64
64
  "@applitools/sdk-coverage-tests": "^2.3.18",
65
- "@applitools/sdk-release-kit": "0.13.11",
65
+ "@applitools/sdk-release-kit": "1.2.1",
66
66
  "@applitools/snaptdout": "1.0.1",
67
67
  "@applitools/test-server": "1.0.8",
68
68
  "@applitools/test-utils": "1.1.5",
@@ -1,6 +1,31 @@
1
1
  function eyesOpenMapValues({args, appliConfFile, testName, shouldUseBrowserHooks}) {
2
2
  let browsersInfo = args.browser || appliConfFile.browser;
3
3
  let accessibilitySettings = args.accessibilityValidation || appliConfFile.accessibilityValidation;
4
+ const batch = {
5
+ id:
6
+ args.batchId ||
7
+ (args.batch ? args.batch.id : undefined) ||
8
+ appliConfFile.batchId ||
9
+ (appliConfFile.batch ? appliConfFile.batch.id : undefined),
10
+ name:
11
+ args.batchName ||
12
+ (args.batch ? args.batch.name : undefined) ||
13
+ appliConfFile.batchName ||
14
+ (appliConfFile.batch ? appliConfFile.batch.name : undefined),
15
+ sequenceName:
16
+ args.batchSequenceName ||
17
+ (args.batch ? args.batch.sequenceName : undefined) ||
18
+ appliConfFile.batchSequenceName ||
19
+ (appliConfFile.batch ? appliConfFile.batch.sequenceName : undefined),
20
+ };
21
+
22
+ if (!batch.name) {
23
+ delete batch['name'];
24
+ }
25
+ if (!batch.sequenceName) {
26
+ delete batch['sequenceName'];
27
+ }
28
+
4
29
  const mappedValues = [
5
30
  'accessibilityValidation',
6
31
  'browser',
@@ -9,6 +34,9 @@ function eyesOpenMapValues({args, appliConfFile, testName, shouldUseBrowserHooks
9
34
  'enablePatterns',
10
35
  'ignoreDisplacements',
11
36
  'ignoreCaret',
37
+ 'batchName',
38
+ 'batchId',
39
+ 'batchSequenceName',
12
40
  ];
13
41
 
14
42
  if (browsersInfo) {
@@ -29,12 +57,13 @@ function eyesOpenMapValues({args, appliConfFile, testName, shouldUseBrowserHooks
29
57
  ignoreDisplacements: args.ignoreDisplacements || appliConfFile.ignoreDisplacements,
30
58
  };
31
59
 
60
+ const appliConfFileCopy = {...appliConfFile};
32
61
  for (const val of mappedValues) {
33
62
  if (args.hasOwnProperty(val)) {
34
63
  delete args[val];
35
64
  }
36
- if (appliConfFile.hasOwnProperty(val)) {
37
- delete appliConfFile[val];
65
+ if (appliConfFileCopy.hasOwnProperty(val)) {
66
+ delete appliConfFileCopy[val];
38
67
  }
39
68
  }
40
69
 
@@ -42,11 +71,12 @@ function eyesOpenMapValues({args, appliConfFile, testName, shouldUseBrowserHooks
42
71
  ...args,
43
72
  browsersInfo,
44
73
  defaultMatchSettings,
74
+ batch,
45
75
  };
46
76
 
47
77
  return Object.assign(
48
78
  {testName, dontCloseBatches: !shouldUseBrowserHooks},
49
- appliConfFile,
79
+ appliConfFileCopy,
50
80
  mappedArgs,
51
81
  );
52
82
  }
@@ -15,9 +15,12 @@ function makeConfig() {
15
15
  ],
16
16
  });
17
17
 
18
- if (!config.batch || !config.batch.id) {
19
- config.batch = {id: uuid.v4(), ...config.batch};
18
+ if ((!config.batch || !config.batch.id) && !config.batchId) {
19
+ config.batch = {
20
+ id: uuid.v4(),
21
+ };
20
22
  }
23
+
21
24
  if (config.failCypressOnDiff === '0') {
22
25
  config.failCypressOnDiff = false;
23
26
  }
@@ -26,7 +26,7 @@ function makeGlobalRunHooks({closeManager, closeBatches, closeUniversalServer})
26
26
  }
27
27
  if (!config.appliConfFile.dontCloseBatches) {
28
28
  await closeBatches({
29
- batchIds: [config.appliConfFile.batch.id],
29
+ batchIds: [config.appliConfFile.batchId || config.appliConfFile.batch.id],
30
30
  serverUrl: config.appliConfFile.serverUrl,
31
31
  proxy: config.appliConfFile.proxy,
32
32
  apiKey: config.appliConfFile.apiKey,