@applitools/eyes 1.7.1 → 1.7.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
@@ -1,5 +1,166 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.7.2...js/eyes@1.7.3) (2023-08-18)
4
+
5
+
6
+ ### Code Refactoring
7
+
8
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/utils bumped to 1.5.1
14
+ #### Code Refactoring
15
+
16
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
17
+ * @applitools/logger bumped to 2.0.8
18
+ #### Code Refactoring
19
+
20
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
21
+
22
+
23
+
24
+ * @applitools/socket bumped to 1.1.8
25
+ #### Code Refactoring
26
+
27
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
28
+
29
+
30
+
31
+ * @applitools/req bumped to 1.5.3
32
+ #### Code Refactoring
33
+
34
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
35
+
36
+
37
+
38
+ * @applitools/image bumped to 1.1.3
39
+ #### Code Refactoring
40
+
41
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
42
+
43
+
44
+
45
+ * @applitools/snippets bumped to 2.4.23
46
+ #### Code Refactoring
47
+
48
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
49
+ * @applitools/spec-driver-webdriver bumped to 1.0.42
50
+ #### Code Refactoring
51
+
52
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
53
+
54
+
55
+
56
+ * @applitools/spec-driver-selenium bumped to 1.5.56
57
+ #### Code Refactoring
58
+
59
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
60
+
61
+
62
+
63
+ * @applitools/spec-driver-puppeteer bumped to 1.1.73
64
+ #### Code Refactoring
65
+
66
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
67
+
68
+
69
+
70
+ * @applitools/driver bumped to 1.13.5
71
+ #### Bug Fixes
72
+
73
+ * optimize driver usage in close ([#1867](https://github.com/applitools/eyes.sdk.javascript1/issues/1867)) ([60dff6b](https://github.com/applitools/eyes.sdk.javascript1/commit/60dff6b160e69d3893c91a1125d668fa18b43072))
74
+
75
+
76
+ #### Code Refactoring
77
+
78
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
79
+
80
+
81
+
82
+ * @applitools/screenshoter bumped to 3.8.8
83
+ #### Code Refactoring
84
+
85
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
86
+
87
+
88
+
89
+ * @applitools/nml-client bumped to 1.5.8
90
+ #### Code Refactoring
91
+
92
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
93
+
94
+
95
+
96
+ * @applitools/tunnel-client bumped to 1.2.0
97
+ #### Features
98
+
99
+ * replace and destroy tunnels by tunnel id ([#1878](https://github.com/applitools/eyes.sdk.javascript1/issues/1878)) ([22bcc15](https://github.com/applitools/eyes.sdk.javascript1/commit/22bcc15b31457e3da56cdb6f73bee3dcb7e051a1))
100
+
101
+
102
+ #### Code Refactoring
103
+
104
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
105
+
106
+
107
+
108
+ * @applitools/ufg-client bumped to 1.7.1
109
+ #### Code Refactoring
110
+
111
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
112
+
113
+
114
+
115
+ * @applitools/ec-client bumped to 1.7.5
116
+ #### Code Refactoring
117
+
118
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
119
+
120
+
121
+
122
+ * @applitools/core-base bumped to 1.5.1
123
+ #### Code Refactoring
124
+
125
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
126
+
127
+
128
+
129
+ * @applitools/core bumped to 3.9.1
130
+ #### Bug Fixes
131
+
132
+ * optimize driver usage in close ([#1867](https://github.com/applitools/eyes.sdk.javascript1/issues/1867)) ([60dff6b](https://github.com/applitools/eyes.sdk.javascript1/commit/60dff6b160e69d3893c91a1125d668fa18b43072))
133
+
134
+
135
+ #### Code Refactoring
136
+
137
+ * refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
138
+
139
+
140
+
141
+
142
+ ## [1.7.2](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.7.1...js/eyes@1.7.2) (2023-08-10)
143
+
144
+
145
+ ### Dependencies
146
+
147
+ * @applitools/nml-client bumped to 1.5.7
148
+ #### Bug Fixes
149
+
150
+ * propagate stitch mode to applitools lib ([a2dcedb](https://github.com/applitools/eyes.sdk.javascript1/commit/a2dcedb4bc6b999c137ed2aab43e0a463aa90169))
151
+ * @applitools/core bumped to 3.9.0
152
+ #### Features
153
+
154
+ * re-release ([e62abc7](https://github.com/applitools/eyes.sdk.javascript1/commit/e62abc7e74ea0e193eb7770036ae7f97bd11188a))
155
+
156
+
157
+ #### Bug Fixes
158
+
159
+ * propagate stitch mode to applitools lib ([a2dcedb](https://github.com/applitools/eyes.sdk.javascript1/commit/a2dcedb4bc6b999c137ed2aab43e0a463aa90169))
160
+
161
+
162
+
163
+
3
164
  ## [1.7.1](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.7.0...js/eyes@1.7.1) (2023-08-08)
4
165
 
5
166
 
package/dist/Eyes.js CHANGED
@@ -167,9 +167,9 @@ class Eyes {
167
167
  return this.constructor.setMobileCapabilities(capabilities, this._config);
168
168
  }
169
169
  async open(driverOrConfigOrAppName, configOrAppNameOrTestName, testNameOrViewportSize, viewportSizeOrSessionType, sessionType) {
170
- var _a, _b, _c, _d;
171
- var _e;
172
- if ((_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.isDriver) === null || _b === void 0 ? void 0 : _b.call(_a, driverOrConfigOrAppName)) {
170
+ var _a, _b, _c, _d, _e, _f;
171
+ var _g;
172
+ if (((_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.isDriver) === null || _b === void 0 ? void 0 : _b.call(_a, driverOrConfigOrAppName)) || ((_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.isSecondaryDriver) === null || _d === void 0 ? void 0 : _d.call(_c, driverOrConfigOrAppName))) {
173
173
  this._driver = driverOrConfigOrAppName;
174
174
  }
175
175
  else {
@@ -201,13 +201,13 @@ class Eyes {
201
201
  if (utils.types.isString(testNameOrViewportSize))
202
202
  config.open.testName = testNameOrViewportSize;
203
203
  if (utils.types.has(viewportSizeOrSessionType, ['width', 'height'])) {
204
- (_c = (_e = config.open).environment) !== null && _c !== void 0 ? _c : (_e.environment = {});
204
+ (_e = (_g = config.open).environment) !== null && _e !== void 0 ? _e : (_g.environment = {});
205
205
  config.open.environment.viewportSize = viewportSizeOrSessionType;
206
206
  }
207
207
  if (utils.types.isEnumValue(sessionType, SessionType_1.SessionTypeEnum))
208
208
  config.open.sessionType = sessionType;
209
209
  config.open.keepPlatformNameAsIs = true;
210
- this._state.appName = (_d = config.open) === null || _d === void 0 ? void 0 : _d.appName;
210
+ this._state.appName = (_f = config.open) === null || _f === void 0 ? void 0 : _f.appName;
211
211
  this._eyes = await this._runner.openEyes({
212
212
  target: this._driver,
213
213
  config,
@@ -307,27 +307,31 @@ class CheckSettingsImageFluent extends CheckSettingsBaseFluent {
307
307
  exports.CheckSettingsImageFluent = CheckSettingsImageFluent;
308
308
  class CheckSettingsAutomationFluent extends CheckSettingsBaseFluent {
309
309
  _isElementReference(value) {
310
- var _a, _b;
310
+ var _a, _b, _c;
311
311
  const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
312
- return !!((_b = spec.isElement) === null || _b === void 0 ? void 0 : _b.call(spec, value)) || this._isSelectorReference(value);
312
+ return !!((_b = spec.isElement) === null || _b === void 0 ? void 0 : _b.call(spec, value)) || !!((_c = spec.isSecondaryElement) === null || _c === void 0 ? void 0 : _c.call(spec, value)) || this._isSelectorReference(value);
313
313
  }
314
314
  _isSelectorReference(selector) {
315
- var _a, _b, _c;
315
+ var _a, _b, _c, _d, _e;
316
316
  const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
317
317
  return (!!((_b = spec.isSelector) === null || _b === void 0 ? void 0 : _b.call(spec, selector)) ||
318
+ !!((_c = spec.isSecondarySelector) === null || _c === void 0 ? void 0 : _c.call(spec, selector)) ||
318
319
  utils.types.isString(selector) ||
319
320
  (utils.types.isPlainObject(selector) &&
320
321
  utils.types.has(selector, 'selector') &&
321
- (utils.types.isString(selector.selector) || !!((_c = spec.isSelector) === null || _c === void 0 ? void 0 : _c.call(spec, selector.selector)))));
322
+ (utils.types.isString(selector.selector) ||
323
+ !!((_d = spec.isSelector) === null || _d === void 0 ? void 0 : _d.call(spec, selector.selector)) ||
324
+ !!((_e = spec.isSecondarySelector) === null || _e === void 0 ? void 0 : _e.call(spec, selector)))));
322
325
  }
323
326
  _isFrameReference(value) {
324
327
  return utils.types.isNumber(value) || utils.types.isString(value) || this._isElementReference(value);
325
328
  }
326
329
  constructor(settings, spec) {
327
- var _a;
328
330
  super(settings);
329
331
  this._spec = spec;
330
- (_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = {});
332
+ this._settings = utils.types.instanceOf(settings, CheckSettingsAutomationFluent)
333
+ ? settings.toObject()
334
+ : settings !== null && settings !== void 0 ? settings : {};
331
335
  }
332
336
  region(region) {
333
337
  if (this._isSelectorReference(region) &&
@@ -37,18 +37,21 @@ const ImageMatchSettings_1 = require("./ImageMatchSettings");
37
37
  const utils = __importStar(require("@applitools/utils"));
38
38
  class ConfigurationData {
39
39
  _isElementReference(value) {
40
- var _a, _b;
40
+ var _a, _b, _c;
41
41
  const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
42
- return !!((_b = spec.isElement) === null || _b === void 0 ? void 0 : _b.call(spec, value)) || this._isSelectorReference(value);
42
+ return !!((_b = spec.isElement) === null || _b === void 0 ? void 0 : _b.call(spec, value)) || !!((_c = spec.isSecondaryElement) === null || _c === void 0 ? void 0 : _c.call(spec, value)) || this._isSelectorReference(value);
43
43
  }
44
44
  _isSelectorReference(selector) {
45
- var _a, _b, _c;
45
+ var _a, _b, _c, _d, _e;
46
46
  const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
47
47
  return (!!((_b = spec.isSelector) === null || _b === void 0 ? void 0 : _b.call(spec, selector)) ||
48
+ !!((_c = spec.isSecondarySelector) === null || _c === void 0 ? void 0 : _c.call(spec, selector)) ||
48
49
  utils.types.isString(selector) ||
49
50
  (utils.types.isPlainObject(selector) &&
50
51
  utils.types.has(selector, 'selector') &&
51
- (utils.types.isString(selector.selector) || !!((_c = spec.isSelector) === null || _c === void 0 ? void 0 : _c.call(spec, selector.selector)))));
52
+ (utils.types.isString(selector.selector) ||
53
+ !!((_d = spec.isSelector) === null || _d === void 0 ? void 0 : _d.call(spec, selector.selector)) ||
54
+ !!((_e = spec.isSecondarySelector) === null || _e === void 0 ? void 0 : _e.call(spec, selector.selector)))));
52
55
  }
53
56
  constructor(config, spec) {
54
57
  this._config = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "keywords": [
5
5
  "applitools",
6
6
  "eyes",
@@ -45,12 +45,12 @@
45
45
  "test": "run --top-level mocha './test/**/*.spec.ts'"
46
46
  },
47
47
  "dependencies": {
48
- "@applitools/core": "3.8.1",
49
- "@applitools/logger": "2.0.7",
50
- "@applitools/utils": "1.5.0"
48
+ "@applitools/core": "3.9.1",
49
+ "@applitools/logger": "2.0.8",
50
+ "@applitools/utils": "1.5.1"
51
51
  },
52
52
  "devDependencies": {
53
- "@applitools/req": "^1.5.2",
53
+ "@applitools/req": "^1.5.3",
54
54
  "@types/node": "^12.20.55"
55
55
  },
56
56
  "engines": {