@appium/images-plugin 4.2.8 → 5.0.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/LICENSE +201 -0
- package/build/lib/compare.d.ts +1 -1
- package/build/lib/compare.d.ts.map +1 -1
- package/build/lib/compare.js +12 -15
- package/build/lib/compare.js.map +1 -1
- package/build/lib/constants.d.ts +1 -1
- package/build/lib/constants.d.ts.map +1 -1
- package/build/lib/constants.js +16 -19
- package/build/lib/constants.js.map +1 -1
- package/build/lib/finder.d.ts +2 -2
- package/build/lib/finder.d.ts.map +1 -1
- package/build/lib/finder.js +38 -45
- package/build/lib/finder.js.map +1 -1
- package/build/lib/image-element.d.ts +2 -2
- package/build/lib/image-element.d.ts.map +1 -1
- package/build/lib/image-element.js +25 -29
- package/build/lib/image-element.js.map +1 -1
- package/build/lib/index.d.ts +7 -7
- package/build/lib/index.d.ts.map +1 -1
- package/build/lib/index.js +6 -29
- package/build/lib/index.js.map +1 -1
- package/build/lib/logger.js +2 -5
- package/build/lib/logger.js.map +1 -1
- package/build/lib/plugin.d.ts +2 -2
- package/build/lib/plugin.d.ts.map +1 -1
- package/build/lib/plugin.js +23 -27
- package/build/lib/plugin.js.map +1 -1
- package/build/lib/types.d.ts +2 -2
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/types.js +1 -2
- package/lib/compare.ts +3 -3
- package/lib/constants.ts +2 -2
- package/lib/finder.ts +7 -7
- package/lib/image-element.ts +5 -5
- package/lib/index.ts +7 -7
- package/lib/logger.ts +1 -1
- package/lib/plugin.ts +10 -9
- package/lib/types.ts +2 -2
- package/package.json +13 -5
- package/tsconfig.json +7 -1
package/lib/logger.ts
CHANGED
package/lib/plugin.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type {MatchingOptions, OccurrenceOptions, SimilarityOptions} from '@appium/opencv';
|
|
2
2
|
import {util} from '@appium/support';
|
|
3
3
|
import type {ActionSequence, Element, ExternalDriver, MethodMap} from '@appium/types';
|
|
4
|
-
import {errors} from 'appium/driver';
|
|
5
|
-
import {BasePlugin} from 'appium/plugin';
|
|
4
|
+
import {errors} from 'appium/driver.js';
|
|
5
|
+
import {BasePlugin} from 'appium/plugin.js';
|
|
6
6
|
|
|
7
|
-
import {compareImages} from './compare';
|
|
8
|
-
import {IMAGE_ELEMENT_PREFIX, IMAGE_STRATEGY} from './constants';
|
|
9
|
-
import {ImageElementFinder} from './finder';
|
|
10
|
-
import {ImageElement} from './image-element';
|
|
7
|
+
import {compareImages} from './compare.js';
|
|
8
|
+
import {IMAGE_ELEMENT_PREFIX, IMAGE_STRATEGY} from './constants.js';
|
|
9
|
+
import {ImageElementFinder} from './finder.js';
|
|
10
|
+
import {ImageElement} from './image-element.js';
|
|
11
11
|
|
|
12
12
|
export class ImageElementPlugin extends BasePlugin {
|
|
13
13
|
// this plugin supports a non-standard 'compare images' command
|
|
@@ -94,9 +94,10 @@ export class ImageElementPlugin extends BasePlugin {
|
|
|
94
94
|
throw new errors.NoSuchElementError();
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
// Add the element's center
|
|
98
|
-
|
|
99
|
-
actionWithEl.
|
|
97
|
+
// Add the element's center to the offset. An unset offset must count as
|
|
98
|
+
// zero, otherwise the resulting coordinate is NaN.
|
|
99
|
+
actionWithEl.x = (actionWithEl.x ?? 0) + imgEl.center.x;
|
|
100
|
+
actionWithEl.y = (actionWithEl.y ?? 0) + imgEl.center.y;
|
|
100
101
|
// Set the origin to the viewport so that the external driver can process it using coordinates.
|
|
101
102
|
delete actionWithEl.origin;
|
|
102
103
|
}
|
package/lib/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type {MatchingResult, OccurrenceResult, SimilarityResult} from '@appium/opencv';
|
|
2
2
|
import type {Rect} from '@appium/types';
|
|
3
3
|
|
|
4
|
-
import type {IMAGE_EL_TAP_STRATEGY_MJSONWP, IMAGE_EL_TAP_STRATEGY_W3C} from './constants';
|
|
5
|
-
import type {ImageElementFinder} from './finder';
|
|
4
|
+
import type {IMAGE_EL_TAP_STRATEGY_MJSONWP, IMAGE_EL_TAP_STRATEGY_W3C} from './constants.js';
|
|
5
|
+
import type {ImageElementFinder} from './finder.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Image settings interface for device settings
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/images-plugin",
|
|
3
|
-
"version": "
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"gitHead": "b67de03966155ff052076c11c1c8f20cc2ba9134",
|
|
5
5
|
"description": "Plugin for working with images and image elements in Appium",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"android",
|
|
@@ -30,20 +30,28 @@
|
|
|
30
30
|
"lib",
|
|
31
31
|
"tsconfig.json"
|
|
32
32
|
],
|
|
33
|
+
"type": "module",
|
|
33
34
|
"main": "./build/lib/index.js",
|
|
34
35
|
"types": "./build/lib/index.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./build/lib/index.d.ts",
|
|
39
|
+
"import": "./build/lib/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
35
43
|
"publishConfig": {
|
|
36
44
|
"access": "public"
|
|
37
45
|
},
|
|
38
46
|
"scripts": {
|
|
39
47
|
"test": "npm run test:unit",
|
|
40
48
|
"test:smoke": "node ./build/lib/index.js",
|
|
41
|
-
"test:unit": "node --test --enable-source-maps --test-timeout=5000 \"./build/test/unit/**/*.spec.js\"",
|
|
49
|
+
"test:unit": "node --test --experimental-test-module-mocks --enable-source-maps --test-timeout=5000 \"./build/test/unit/**/*.spec.js\"",
|
|
42
50
|
"test:e2e": "node --test --enable-source-maps --test-force-exit --test-concurrency=1 --test-timeout=20000 \"./build/test/e2e/**/*.spec.js\""
|
|
43
51
|
},
|
|
44
52
|
"dependencies": {
|
|
45
|
-
"@appium/opencv": "
|
|
46
|
-
"@appium/support": "7.2.
|
|
53
|
+
"@appium/opencv": "5.0.0",
|
|
54
|
+
"@appium/support": "7.2.7",
|
|
47
55
|
"lru-cache": "11.5.2",
|
|
48
56
|
"sharp": "0.35.3"
|
|
49
57
|
},
|
package/tsconfig.json
CHANGED
|
@@ -5,8 +5,14 @@
|
|
|
5
5
|
"checkJs": true,
|
|
6
6
|
"esModuleInterop": true,
|
|
7
7
|
"strict": true,
|
|
8
|
+
"module": "NodeNext",
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
8
10
|
"paths": {
|
|
9
|
-
"@appium/opencv": ["../opencv"]
|
|
11
|
+
"@appium/opencv": ["../opencv"],
|
|
12
|
+
"appium": ["../appium"],
|
|
13
|
+
"appium/driver.js": ["../appium/driver.d.ts"],
|
|
14
|
+
"appium/plugin.js": ["../appium/plugin.d.ts"],
|
|
15
|
+
"appium/support.js": ["../appium/support.d.ts"]
|
|
10
16
|
},
|
|
11
17
|
"types": ["node"]
|
|
12
18
|
},
|