@sap_oss/wdio-qmate-service 2.15.1 → 2.15.2
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/docs/sections/contact.md +24 -8
- package/lib/reuse/modules/mobile/android.d.ts +5 -2
- package/lib/reuse/modules/mobile/android.js +5 -2
- package/lib/reuse/modules/mobile/android.js.map +1 -1
- package/lib/reuse/modules/mobile/device.d.ts +10 -22
- package/lib/reuse/modules/mobile/device.js +10 -22
- package/lib/reuse/modules/mobile/device.js.map +1 -1
- package/lib/reuse/modules/mobile/gestures.d.ts +22 -2
- package/lib/reuse/modules/mobile/gestures.js +44 -2
- package/lib/reuse/modules/mobile/gestures.js.map +1 -1
- package/lib/reuse/modules/ui5/assertion.d.ts +1 -1
- package/lib/reuse/modules/ui5/assertion.js +1 -1
- package/package.json +1 -1
package/docs/sections/contact.md
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
In case of questions or issues, please feel free to reach out to us or open an [issue](https://github.com/SAP/wdio-qmate-service/issues){target="__blank"} on our [GitHub Page](https://github.com/SAP/wdio-qmate-service){target="__blank"}.
|
|
1
|
+
> In case of questions or issues, please feel free to reach out to us or open an [issue](https://github.com/SAP/wdio-qmate-service/issues){target="__blank"} on our [GitHub Page](https://github.com/SAP/wdio-qmate-service){target="__blank"}.
|
|
2
2
|
|
|
3
|
+
## Qmate Main Contact
|
|
3
4
|
### Benjamin Warth
|
|
4
|
-
:octicons-location-16:
|
|
5
|
+
:octicons-location-16: WDF - Germany
|
|
5
6
|
:material-email: [benjamin.warth@sap.com](mailto:benjamin.warth@sap.com)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
:octicons-location-16: Walldorf - Germany
|
|
9
|
-
:material-email: [georgios.treska@sap.com](mailto:georgios.treska@sap.com)
|
|
8
|
+
---
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
:octicons-location-16: Walldorf - Germany
|
|
13
|
-
:material-email: [marvin.gruessinger@sap.com](mailto:marvin.gruessinger@sap.com)
|
|
10
|
+
## Our Team
|
|
14
11
|
|
|
12
|
+
### Uladzislau Dauhashei
|
|
13
|
+
:octicons-location-16: WDF - Germany
|
|
14
|
+
:material-email: [u.dauhashei@sap.com](mailto:u.dauhashei@sap.com)
|
|
15
|
+
|
|
16
|
+
### Tomas Hartmann
|
|
17
|
+
:octicons-location-16: WDF - Germany
|
|
18
|
+
:material-email: [tomas.hartmann@sap.com](mailto:tomas.hartmann@sap.com)
|
|
19
|
+
|
|
20
|
+
### Herald Antony
|
|
21
|
+
:octicons-location-16: BLR - India
|
|
22
|
+
:material-email: [herald.maria.antony@sap.com](mailto:herald.maria.antony@sap.com)
|
|
23
|
+
|
|
24
|
+
### Varun Hegde
|
|
25
|
+
:octicons-location-16: BLR - India
|
|
26
|
+
:material-email: [varun.hegde@sap.com](mailto:varun.hegde@sap.com)
|
|
27
|
+
|
|
28
|
+
### Moritz Knaut
|
|
29
|
+
:octicons-location-16: Remote - Germany
|
|
30
|
+
:material-email: [moritz.knaut@sap.com](mailto:moritz.knaut@sap.com)
|
|
@@ -11,8 +11,10 @@ export declare class Android {
|
|
|
11
11
|
* @memberof mobile.android
|
|
12
12
|
* @description Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
|
|
13
13
|
* @param {string} keyName - The name of the key (e.g., "back", "home", "volumeUp", etc.)
|
|
14
|
-
* @
|
|
15
|
-
* @example
|
|
14
|
+
* @returns {Promise<void>}
|
|
15
|
+
* @example
|
|
16
|
+
* await mobile.android.pressKeyByName("back");
|
|
17
|
+
* await mobile.android.pressKeyByName("home");
|
|
16
18
|
*/
|
|
17
19
|
pressKeyByName(keyName: KeyName): Promise<void>;
|
|
18
20
|
/**
|
|
@@ -20,6 +22,7 @@ export declare class Android {
|
|
|
20
22
|
* @memberof mobile.android
|
|
21
23
|
* @description Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
|
|
22
24
|
* @param {string} keyCode - The code of the key (e.g., 4 (back), 3 (home) , etc.)
|
|
25
|
+
* @returns {Promise<void>}
|
|
23
26
|
* @example await mobile.android.pressKeyByCode(4);
|
|
24
27
|
* @see https://developer.android.com/reference/android/view/KeyEvent
|
|
25
28
|
*/
|
|
@@ -21,8 +21,10 @@ class Android {
|
|
|
21
21
|
* @memberof mobile.android
|
|
22
22
|
* @description Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
|
|
23
23
|
* @param {string} keyName - The name of the key (e.g., "back", "home", "volumeUp", etc.)
|
|
24
|
-
* @
|
|
25
|
-
* @example
|
|
24
|
+
* @returns {Promise<void>}
|
|
25
|
+
* @example
|
|
26
|
+
* await mobile.android.pressKeyByName("back");
|
|
27
|
+
* await mobile.android.pressKeyByName("home");
|
|
26
28
|
*/
|
|
27
29
|
async pressKeyByName(keyName) {
|
|
28
30
|
const vl = this.vlf.initLog(this.pressKeyByName);
|
|
@@ -65,6 +67,7 @@ class Android {
|
|
|
65
67
|
* @memberof mobile.android
|
|
66
68
|
* @description Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
|
|
67
69
|
* @param {string} keyCode - The code of the key (e.g., 4 (back), 3 (home) , etc.)
|
|
70
|
+
* @returns {Promise<void>}
|
|
68
71
|
* @example await mobile.android.pressKeyByCode(4);
|
|
69
72
|
* @see https://developer.android.com/reference/android/view/KeyEvent
|
|
70
73
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../../../src/reuse/modules/mobile/android.ts"],"names":[],"mappings":";;;;;;AAAA,UAAU;AACV,8DAAkE;AAClE,6EAAqD;AAKrD;;;GAGG;AACH,MAAa,OAAO;IAApB;QACU,QAAG,GAAG,IAAI,oCAAoB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QACpD,iBAAY,GAAG,IAAI,sBAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../../../src/reuse/modules/mobile/android.ts"],"names":[],"mappings":";;;;;;AA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AAC,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,yCAAyC,EAAE,IAAI,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,cAAc,CAAC,OAAe;QAClC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACjD,IAAI,CAAC;YACH,EAAE,CAAC,GAAG,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAC;YAC3C,MAAM,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,yCAAyC,EAAE,IAAI,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;CACF;AArED,0BAqEC;AACD,kBAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -12,26 +12,14 @@ type Orientation = (typeof ORIENTATION)[keyof typeof ORIENTATION];
|
|
|
12
12
|
export declare class Device {
|
|
13
13
|
private vlf;
|
|
14
14
|
private ErrorHandler;
|
|
15
|
-
/**
|
|
16
|
-
* @function isValidPlatform
|
|
17
|
-
* @memberof mobile.device
|
|
18
|
-
* @description Check the mobile platform from the session's capabilities.
|
|
19
|
-
* @returns {boolean} Returns 'true' if the platform in the session's capabilities is either Android or iOS.
|
|
20
|
-
*/
|
|
21
15
|
private isValidPlatform;
|
|
22
|
-
/**
|
|
23
|
-
* @function executionPlatform
|
|
24
|
-
* @memberof mobile.device
|
|
25
|
-
* @description Check the mobile platform from the session's capabilities.
|
|
26
|
-
* @returns {string} Return current execution platform in the session's capabilities.
|
|
27
|
-
*/
|
|
28
16
|
private executionPlatform;
|
|
29
17
|
/**
|
|
30
18
|
* @function isAppInstalled
|
|
31
19
|
* @memberof mobile.device
|
|
32
|
-
* @description Check
|
|
33
|
-
* @param {string} appPackageOrBundleId - Android package
|
|
34
|
-
* @returns {boolean} Returns
|
|
20
|
+
* @description Check if the application identified by its Package name/Bundle ID is installed on the device.
|
|
21
|
+
* @param {string} appPackageOrBundleId - Android package Name, or iOS bundle Id.
|
|
22
|
+
* @returns {boolean} - Returns `true` if specified app package/bundled installed in the device, or `false`.
|
|
35
23
|
* @example
|
|
36
24
|
* await mobile.device.isAppInstalled("com.google.android.apps.maps");
|
|
37
25
|
* await mobile.device.isAppInstalled("com.apple.AppStore")
|
|
@@ -54,7 +42,7 @@ export declare class Device {
|
|
|
54
42
|
* @description Switch to the specified( WEBVIEW | NATIVE_APP ) context if available.
|
|
55
43
|
* @param {string} [targetContext='WEBVIEW'] The name of the target context.
|
|
56
44
|
* @param {number} [timeout=5000] Maximum time to wait for the web context to appear, milliseconds.
|
|
57
|
-
* @returns {Promise<boolean>} Returns
|
|
45
|
+
* @returns {Promise<boolean>} Returns `true` if the context is successfully switched, otherwise `false`.
|
|
58
46
|
* @example
|
|
59
47
|
* await mobile.device.switchToContext();
|
|
60
48
|
* await mobile.device.switchToContext("NATIVE_APP", 1000);
|
|
@@ -70,11 +58,11 @@ export declare class Device {
|
|
|
70
58
|
* that matches the `targetContext` string is present. If the target context is found,
|
|
71
59
|
* it returns the context name; otherwise, it returns `null`.
|
|
72
60
|
*
|
|
73
|
-
* @param {string} [targetContext=
|
|
74
|
-
* Common examples are
|
|
75
|
-
* @param {number} [timeout=5000]
|
|
61
|
+
* @param {string} [targetContext='WEBVIEW'] The name of the target context to check for.
|
|
62
|
+
* Common examples are `WEBVIEW` or `NATIVE_APP`.
|
|
63
|
+
* @param {number} [timeout=5000] The maximum time, in milliseconds, to wait for the target
|
|
76
64
|
* context to become available.
|
|
77
|
-
* @returns {Promise<string | null>}
|
|
65
|
+
* @returns {Promise<string | null>} The name of the target context if found, or `null` if
|
|
78
66
|
* the context is not available within the timeout.
|
|
79
67
|
* @example
|
|
80
68
|
* const context = await getTargetContextIfAvailable("WEBVIEW", 10000);
|
|
@@ -166,7 +154,7 @@ export declare class Device {
|
|
|
166
154
|
* @function isKeyboardVisible
|
|
167
155
|
* @memberof mobile.device
|
|
168
156
|
* @description Checks if the keyboard is visible or not on the mobile device.
|
|
169
|
-
* @returns {Promise<boolean>} Returns
|
|
157
|
+
* @returns {Promise<boolean>} Returns `true` if the keyboard is visible on the mobile view.
|
|
170
158
|
* @example
|
|
171
159
|
* await mobile.device.isKeyboardVisible();
|
|
172
160
|
*/
|
|
@@ -174,7 +162,7 @@ export declare class Device {
|
|
|
174
162
|
/**
|
|
175
163
|
* @function isPlatformSupported
|
|
176
164
|
* @memberof mobile.device
|
|
177
|
-
* @description Determine if the current platform is supported, if the current device platform is either Android or iOS
|
|
165
|
+
* @description Determine if the current platform is supported, if the current device platform is either `Android` or `iOS`.
|
|
178
166
|
* @returns {Promise<boolean>} If neither Android nor iOS is detected (e.g., Windows, Linux, or web), the condition evaluates to false
|
|
179
167
|
* @example
|
|
180
168
|
* await mobile.device.isPlatformSupported();
|
|
@@ -22,24 +22,12 @@ class Device {
|
|
|
22
22
|
this.ErrorHandler = new errorHandler_1.default();
|
|
23
23
|
}
|
|
24
24
|
//==================================Private Methods===============================================
|
|
25
|
-
/**
|
|
26
|
-
* @function isValidPlatform
|
|
27
|
-
* @memberof mobile.device
|
|
28
|
-
* @description Check the mobile platform from the session's capabilities.
|
|
29
|
-
* @returns {boolean} Returns 'true' if the platform in the session's capabilities is either Android or iOS.
|
|
30
|
-
*/
|
|
31
25
|
async isValidPlatform() {
|
|
32
26
|
const vl = this.vlf.initLog(this.isValidPlatform);
|
|
33
27
|
const SUPPORTED_PLATFORMS = ["android", "ios"];
|
|
34
28
|
const platform = await browser.capabilities.platformName;
|
|
35
29
|
return SUPPORTED_PLATFORMS.includes(platform.toLowerCase().trim());
|
|
36
30
|
}
|
|
37
|
-
/**
|
|
38
|
-
* @function executionPlatform
|
|
39
|
-
* @memberof mobile.device
|
|
40
|
-
* @description Check the mobile platform from the session's capabilities.
|
|
41
|
-
* @returns {string} Return current execution platform in the session's capabilities.
|
|
42
|
-
*/
|
|
43
31
|
async executionPlatform() {
|
|
44
32
|
const vl = this.vlf.initLog(this.executionPlatform);
|
|
45
33
|
const platform = browser.capabilities.platformName;
|
|
@@ -49,9 +37,9 @@ class Device {
|
|
|
49
37
|
/**
|
|
50
38
|
* @function isAppInstalled
|
|
51
39
|
* @memberof mobile.device
|
|
52
|
-
* @description Check
|
|
53
|
-
* @param {string} appPackageOrBundleId - Android package
|
|
54
|
-
* @returns {boolean} Returns
|
|
40
|
+
* @description Check if the application identified by its Package name/Bundle ID is installed on the device.
|
|
41
|
+
* @param {string} appPackageOrBundleId - Android package Name, or iOS bundle Id.
|
|
42
|
+
* @returns {boolean} - Returns `true` if specified app package/bundled installed in the device, or `false`.
|
|
55
43
|
* @example
|
|
56
44
|
* await mobile.device.isAppInstalled("com.google.android.apps.maps");
|
|
57
45
|
* await mobile.device.isAppInstalled("com.apple.AppStore")
|
|
@@ -105,7 +93,7 @@ class Device {
|
|
|
105
93
|
* @description Switch to the specified( WEBVIEW | NATIVE_APP ) context if available.
|
|
106
94
|
* @param {string} [targetContext='WEBVIEW'] The name of the target context.
|
|
107
95
|
* @param {number} [timeout=5000] Maximum time to wait for the web context to appear, milliseconds.
|
|
108
|
-
* @returns {Promise<boolean>} Returns
|
|
96
|
+
* @returns {Promise<boolean>} Returns `true` if the context is successfully switched, otherwise `false`.
|
|
109
97
|
* @example
|
|
110
98
|
* await mobile.device.switchToContext();
|
|
111
99
|
* await mobile.device.switchToContext("NATIVE_APP", 1000);
|
|
@@ -138,11 +126,11 @@ class Device {
|
|
|
138
126
|
* that matches the `targetContext` string is present. If the target context is found,
|
|
139
127
|
* it returns the context name; otherwise, it returns `null`.
|
|
140
128
|
*
|
|
141
|
-
* @param {string} [targetContext=
|
|
142
|
-
* Common examples are
|
|
143
|
-
* @param {number} [timeout=5000]
|
|
129
|
+
* @param {string} [targetContext='WEBVIEW'] The name of the target context to check for.
|
|
130
|
+
* Common examples are `WEBVIEW` or `NATIVE_APP`.
|
|
131
|
+
* @param {number} [timeout=5000] The maximum time, in milliseconds, to wait for the target
|
|
144
132
|
* context to become available.
|
|
145
|
-
* @returns {Promise<string | null>}
|
|
133
|
+
* @returns {Promise<string | null>} The name of the target context if found, or `null` if
|
|
146
134
|
* the context is not available within the timeout.
|
|
147
135
|
* @example
|
|
148
136
|
* const context = await getTargetContextIfAvailable("WEBVIEW", 10000);
|
|
@@ -368,7 +356,7 @@ class Device {
|
|
|
368
356
|
* @function isKeyboardVisible
|
|
369
357
|
* @memberof mobile.device
|
|
370
358
|
* @description Checks if the keyboard is visible or not on the mobile device.
|
|
371
|
-
* @returns {Promise<boolean>} Returns
|
|
359
|
+
* @returns {Promise<boolean>} Returns `true` if the keyboard is visible on the mobile view.
|
|
372
360
|
* @example
|
|
373
361
|
* await mobile.device.isKeyboardVisible();
|
|
374
362
|
*/
|
|
@@ -403,7 +391,7 @@ class Device {
|
|
|
403
391
|
/**
|
|
404
392
|
* @function isPlatformSupported
|
|
405
393
|
* @memberof mobile.device
|
|
406
|
-
* @description Determine if the current platform is supported, if the current device platform is either Android or iOS
|
|
394
|
+
* @description Determine if the current platform is supported, if the current device platform is either `Android` or `iOS`.
|
|
407
395
|
* @returns {Promise<boolean>} If neither Android nor iOS is detected (e.g., Windows, Linux, or web), the condition evaluates to false
|
|
408
396
|
* @example
|
|
409
397
|
* await mobile.device.isPlatformSupported();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../../src/reuse/modules/mobile/device.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AACb,UAAU;AACV,8DAAkE;AAClE,6EAAqD;AAKrD,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAC;AAGX;;;GAGG;AACH,MAAa,MAAM;IAAnB;QACU,QAAG,GAAG,IAAI,oCAAoB,CAAC,Q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|
11
|
-
* @description Swipe from one point to another on the screen
|
|
11
|
+
* @description Swipe from one point to another on the screen,
|
|
12
|
+
* Ensure that the provided coordinates are within the bounds of the screen to avoid unexpected behavior.
|
|
12
13
|
* @param {number} startX - The starting X coordinate of the swipe
|
|
13
14
|
* @param {number} startY - The starting Y coordinate of the swipe
|
|
14
15
|
* @param {number} endX - The ending X coordinate of the swipe
|
|
15
16
|
* @param {number} endY - The ending Y coordinate of the swipe
|
|
16
|
-
* @param {number} duration - The duration of the swipe in milliseconds (optional, default is 1000ms)
|
|
17
|
+
* @param {number} [duration=1000] - The duration of the swipe in milliseconds (optional, default is 1000ms)
|
|
17
18
|
* @returns {Promise<void>}
|
|
19
|
+
* @example
|
|
20
|
+
* // Swipes from left to right across the screen horizontally (useful for image carousels or galleries).
|
|
21
|
+
* await mobile.gestures.swipe(100, 800, 800, 800);
|
|
22
|
+
* // Swipes from bottom to top vertically to scroll down a list.
|
|
23
|
+
* await mobile.gestures.swipe(300, 1000, 300, 400);
|
|
24
|
+
* // Swipes from the top down to refresh content on a mobile app (common for pull-to-refresh).
|
|
25
|
+
* await mobile.gestures.swipe(400, 200, 400, 800);
|
|
18
26
|
*/
|
|
19
27
|
swipe(startX: number, startY: number, endX: number, endY: number, duration?: number): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* @function tap
|
|
30
|
+
* @memberof mobile.gestures
|
|
31
|
+
* @description Executes a tap at the given screen coordinates,
|
|
32
|
+
* Ensure that the provided coordinates are within the bounds of the screen to avoid unexpected behavior.
|
|
33
|
+
* @param {number} coordX - The horizontal screen coordinate for the tap.
|
|
34
|
+
* @param {number} coordY - The vertical screen coordinate for the tap.
|
|
35
|
+
* @returns {Promise<void>}
|
|
36
|
+
* @example
|
|
37
|
+
* await mobile.gestures.tap(100, 800);
|
|
38
|
+
*/
|
|
39
|
+
tap(coordX: number, coordY: number): Promise<void>;
|
|
20
40
|
}
|
|
21
41
|
declare const _default: Gestures;
|
|
22
42
|
export default _default;
|
|
@@ -18,23 +18,65 @@ class Gestures {
|
|
|
18
18
|
/**
|
|
19
19
|
* @function swipe
|
|
20
20
|
* @memberof mobile.gestures
|
|
21
|
-
* @description Swipe from one point to another on the screen
|
|
21
|
+
* @description Swipe from one point to another on the screen,
|
|
22
|
+
* Ensure that the provided coordinates are within the bounds of the screen to avoid unexpected behavior.
|
|
22
23
|
* @param {number} startX - The starting X coordinate of the swipe
|
|
23
24
|
* @param {number} startY - The starting Y coordinate of the swipe
|
|
24
25
|
* @param {number} endX - The ending X coordinate of the swipe
|
|
25
26
|
* @param {number} endY - The ending Y coordinate of the swipe
|
|
26
|
-
* @param {number} duration - The duration of the swipe in milliseconds (optional, default is 1000ms)
|
|
27
|
+
* @param {number} [duration=1000] - The duration of the swipe in milliseconds (optional, default is 1000ms)
|
|
27
28
|
* @returns {Promise<void>}
|
|
29
|
+
* @example
|
|
30
|
+
* // Swipes from left to right across the screen horizontally (useful for image carousels or galleries).
|
|
31
|
+
* await mobile.gestures.swipe(100, 800, 800, 800);
|
|
32
|
+
* // Swipes from bottom to top vertically to scroll down a list.
|
|
33
|
+
* await mobile.gestures.swipe(300, 1000, 300, 400);
|
|
34
|
+
* // Swipes from the top down to refresh content on a mobile app (common for pull-to-refresh).
|
|
35
|
+
* await mobile.gestures.swipe(400, 200, 400, 800);
|
|
28
36
|
*/
|
|
29
37
|
async swipe(startX, startY, endX, endY, duration = 1000) {
|
|
30
38
|
const vl = this.vlf.initLog(this.swipe);
|
|
31
39
|
try {
|
|
40
|
+
// Validate input coordinates
|
|
41
|
+
if (startX < 0 || startY < 0 || endX < 0 || endY < 0) {
|
|
42
|
+
throw new Error(`Invalid coordinates: (${startX}, ${startY}) to (${endX}, ${endY}) must be non-negative.`);
|
|
43
|
+
}
|
|
44
|
+
// Log the swipe action for debugging
|
|
45
|
+
vl.log(`Swiping from (${startX}, ${startY}) to (${endX}, ${endY}) over ${duration}ms`);
|
|
32
46
|
await browser.touchPerform([
|
|
33
47
|
{ action: "press", options: { x: startX, y: startY } },
|
|
34
48
|
{ action: "wait", options: { ms: duration } }, // Wait for the duration of the swipe
|
|
35
49
|
{ action: "moveTo", options: { x: endX, y: endY } },
|
|
36
50
|
{ action: "release" }
|
|
37
51
|
]);
|
|
52
|
+
vl.log("Swipe completed successfully...");
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
this.ErrorHandler.logException(error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @function tap
|
|
60
|
+
* @memberof mobile.gestures
|
|
61
|
+
* @description Executes a tap at the given screen coordinates,
|
|
62
|
+
* Ensure that the provided coordinates are within the bounds of the screen to avoid unexpected behavior.
|
|
63
|
+
* @param {number} coordX - The horizontal screen coordinate for the tap.
|
|
64
|
+
* @param {number} coordY - The vertical screen coordinate for the tap.
|
|
65
|
+
* @returns {Promise<void>}
|
|
66
|
+
* @example
|
|
67
|
+
* await mobile.gestures.tap(100, 800);
|
|
68
|
+
*/
|
|
69
|
+
async tap(coordX, coordY) {
|
|
70
|
+
const vl = this.vlf.initLog(this.tap);
|
|
71
|
+
try {
|
|
72
|
+
// Input validation
|
|
73
|
+
if (coordX < 0 || coordY < 0) {
|
|
74
|
+
throw new Error(`Invalid coordinates: x (${coordX}) and y (${coordY}) must be non-negative.`);
|
|
75
|
+
}
|
|
76
|
+
// Log the tap action for debugging
|
|
77
|
+
vl.log(`Initiating tap at coordinates (${coordX}, ${coordY}).`);
|
|
78
|
+
await browser.touchPerform([{ action: "tap", options: { coordX, coordY } }]);
|
|
79
|
+
vl.log("Coordinate tap completed successfully...");
|
|
38
80
|
}
|
|
39
81
|
catch (error) {
|
|
40
82
|
this.ErrorHandler.logException(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../../src/reuse/modules/mobile/gestures.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAkE;AAClE,6EAAqD;AAErD;;;GAGG;AACH,MAAa,QA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68
68
|
/**
|
|
69
69
|
* @function expectToBeNotEnabled
|
|
70
70
|
* @memberOf ui5.assertion
|
|
71
|
-
* @description Expects that the element is enabled to the user.
|
|
71
|
+
* @description Expects that the element is not enabled to the user.
|
|
72
72
|
* @param {Object} selector - The selector describing the element.
|
|
73
73
|
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
|
|
74
74
|
* @param {Number} [timeout=30000] - The timeout to wait (ms).
|
|
@@ -165,7 +165,7 @@ class Assertion {
|
|
|
165
165
|
/**
|
|
166
166
|
* @function expectToBeNotEnabled
|
|
167
167
|
* @memberOf ui5.assertion
|
|
168
|
-
* @description Expects that the element is enabled to the user.
|
|
168
|
+
* @description Expects that the element is not enabled to the user.
|
|
169
169
|
* @param {Object} selector - The selector describing the element.
|
|
170
170
|
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
|
|
171
171
|
* @param {Number} [timeout=30000] - The timeout to wait (ms).
|