@applitools/eyes 1.2.16 → 1.3.0

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,40 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.2.17...js/eyes@1.3.0) (2023-06-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * added overload for locate method, to call it with custom target ([5d5914a](https://github.com/applitools/eyes.sdk.javascript1/commit/5d5914a5dae6822cde0086d6b9f4d6f9ac7cc4f2))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/core bumped from 3.2.3 to 3.2.4
14
+ #### Bug Fixes
15
+
16
+ * fix coverage tests ([f5067d8](https://github.com/applitools/eyes.sdk.javascript1/commit/f5067d8693502c3f6c9dbdf8adafbe513d86a9ad))
17
+ * fix tests ([0325ca0](https://github.com/applitools/eyes.sdk.javascript1/commit/0325ca07a57949714f04eb008d269fe0726486b6))
18
+
19
+
20
+
21
+ * @applitools/logger bumped from 2.0.3 to 2.0.4
22
+ #### Bug Fixes
23
+
24
+ * fixed issue when extended logger didn't preserve base's handler ([7c5e029](https://github.com/applitools/eyes.sdk.javascript1/commit/7c5e0299522f792aad72b7b3827df31a1ab2d68f))
25
+
26
+ ## [1.2.17](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.2.16...js/eyes@1.2.17) (2023-06-15)
27
+
28
+
29
+ ### Dependencies
30
+
31
+ * update some dependencies
32
+ * The following workspace dependencies were updated
33
+ * dependencies
34
+ * @applitools/core bumped from 3.2.2 to 3.2.3
35
+ * devDependencies
36
+ * @applitools/req bumped from ^1.3.1 to ^1.3.2
37
+
3
38
  ## [1.2.16](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes@1.2.15...js/eyes@1.2.16) (2023-06-14)
4
39
 
5
40
 
package/dist/Eyes.js CHANGED
@@ -273,13 +273,21 @@ class Eyes {
273
273
  async checkImage(image, name, ignoreMismatch = false) {
274
274
  return this.check({ image }, { name, ignoreMismatch });
275
275
  }
276
- async locate(settings) {
276
+ async locate(targetOrSettings, settings) {
277
277
  if (this._config.isDisabled)
278
278
  return null;
279
279
  if (!this.isOpen)
280
280
  throw new EyesError_1.EyesError('Eyes not open');
281
+ let target;
282
+ if (utils.types.has(targetOrSettings, 'locatorNames')) {
283
+ settings = targetOrSettings;
284
+ target = this._driver;
285
+ }
286
+ else {
287
+ target = targetOrSettings;
288
+ }
281
289
  const config = this._config.toJSON();
282
- const results = await this._core.locate({ target: this._driver, settings: { ...this._state, ...settings }, config });
290
+ const results = await this._core.locate({ target, settings: { ...this._state, ...settings }, config });
283
291
  return Object.entries(results).reduce((results, [key, regions]) => {
284
292
  results[key] = regions.map(region => new Region_1.RegionData(region));
285
293
  return results;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes",
3
- "version": "1.2.16",
3
+ "version": "1.3.0",
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.2.2",
49
- "@applitools/logger": "2.0.3",
48
+ "@applitools/core": "3.2.4",
49
+ "@applitools/logger": "2.0.4",
50
50
  "@applitools/utils": "1.4.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@applitools/req": "^1.3.1",
53
+ "@applitools/req": "^1.3.2",
54
54
  "@types/node": "^12.20.55"
55
55
  },
56
56
  "engines": {
package/types/Eyes.d.ts CHANGED
@@ -119,6 +119,7 @@ export declare class Eyes<TSpec extends Core.SpecType = Core.SpecType> {
119
119
  checkRegionInFrame(frame: TSpec['element'] | EyesSelector<TSpec['selector']> | string | number, selector: EyesSelector<TSpec['selector']>, timeout?: number, name?: string, fully?: boolean): Promise<MatchResultData>;
120
120
  /** @deprecated */
121
121
  checkImage(image: Buffer | URL | string, name?: string, ignoreMismatch?: boolean): Promise<MatchResultData>;
122
+ locate<TLocator extends string>(target: Core.ImageTarget, settings: VisualLocatorSettings<TLocator>): Promise<Record<TLocator, Region[]>>;
122
123
  locate<TLocator extends string>(settings: VisualLocatorSettings<TLocator>): Promise<Record<TLocator, Region[]>>;
123
124
  extractTextRegions<TPattern extends string>(target: Core.ImageTarget, settings: OCRSettings<TPattern>): Promise<Record<TPattern, TextRegion[]>>;
124
125
  /** @deprecated */