@sap_oss/wdio-qmate-service 2.15.3 → 2.16.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.
Files changed (36) hide show
  1. package/docs/doc.md +505 -95
  2. package/lib/reuse/modules/nonUi5/assertion.d.ts +11 -0
  3. package/lib/reuse/modules/nonUi5/assertion.js +15 -0
  4. package/lib/reuse/modules/nonUi5/assertion.js.map +1 -1
  5. package/lib/reuse/modules/nonUi5/element.d.ts +11 -0
  6. package/lib/reuse/modules/nonUi5/element.js +22 -0
  7. package/lib/reuse/modules/nonUi5/element.js.map +1 -1
  8. package/lib/reuse/modules/ui5/assertion.d.ts +12 -0
  9. package/lib/reuse/modules/ui5/assertion.js +16 -0
  10. package/lib/reuse/modules/ui5/assertion.js.map +1 -1
  11. package/lib/reuse/modules/ui5/element.d.ts +12 -0
  12. package/lib/reuse/modules/ui5/element.js +22 -0
  13. package/lib/reuse/modules/ui5/element.js.map +1 -1
  14. package/lib/reuse/modules/ui5/userInteraction.js +2 -2
  15. package/lib/reuse/modules/ui5/userInteraction.js.map +1 -1
  16. package/lib/reuse/modules/util/component.js +17 -7
  17. package/lib/reuse/modules/util/component.js.map +1 -1
  18. package/lib/reuse/modules/util/data.js +17 -7
  19. package/lib/reuse/modules/util/data.js.map +1 -1
  20. package/lib/reuse/modules/util/file.js +17 -7
  21. package/lib/reuse/modules/util/file.js.map +1 -1
  22. package/lib/scripts/dataExchange/dataExchangeUtil.d.ts +1 -1
  23. package/lib/scripts/stats/getOperatingSystem.js +17 -7
  24. package/lib/scripts/stats/getOperatingSystem.js.map +1 -1
  25. package/lib/scripts/stats/getUserId.js +17 -7
  26. package/lib/scripts/stats/getUserId.js.map +1 -1
  27. package/package.json +1 -1
  28. package/test/reuse/nonUi5/assertion/expectCssPropertyValueToBe.spec.js +56 -0
  29. package/test/reuse/nonUi5/assertion/test.assertion.conf.js +2 -1
  30. package/test/reuse/nonUi5/element/getCssPropertyValue.spec.js +54 -0
  31. package/test/reuse/nonUi5/element/test.element.conf.js +2 -1
  32. package/test/reuse/ui5/assertion/expectCssPropertyValueToBe.spec.js +38 -0
  33. package/test/reuse/ui5/assertion/test.assertion.conf.js +2 -1
  34. package/test/reuse/ui5/element/getCssPropertyValue.spec.js +40 -0
  35. package/test/reuse/ui5/element/test.element.conf.js +2 -1
  36. package/test/reuse/ui5/userInteraction/fill.spec.js +29 -0
package/docs/doc.md CHANGED
@@ -592,10 +592,10 @@ Global namespace for util modules.
592
592
  * [.info(message)](#util.console.info)
593
593
  * [.data](#util.data)
594
594
  * [.getData(filename, [source])](#util.data.getData) ⇒ <code>Object</code>
595
- * [.getSecureData(filename, [source])](#util.data.getSecureData) ⇒ <code>Object</code>
595
+ * [.getSecureData(filename, [source], [options])](#util.data.getSecureData) ⇒ <code>Object</code>
596
596
  * [.readDataFromFile(filePath)](#util.data.readDataFromFile) ⇒ <code>Object</code>
597
597
  * [.writeDataToFile(filePath, data)](#util.data.writeDataToFile)
598
- * [.decrypt(data)](#util.data.decrypt) ⇒ <code>String</code>
598
+ * [.decrypt(data, options)](#util.data.decrypt) ⇒ <code>String</code>
599
599
  * [.file](#util.file)
600
600
  * [.upload(files, [selector])](#util.file.upload)
601
601
  * [.uploadWebGui(files, selector)](#util.file.uploadWebGui)
@@ -1150,10 +1150,10 @@ util.console.success("The document has been saved.");
1150
1150
 
1151
1151
  * [.data](#util.data)
1152
1152
  * [.getData(filename, [source])](#util.data.getData) ⇒ <code>Object</code>
1153
- * [.getSecureData(filename, [source])](#util.data.getSecureData) ⇒ <code>Object</code>
1153
+ * [.getSecureData(filename, [source], [options])](#util.data.getSecureData) ⇒ <code>Object</code>
1154
1154
  * [.readDataFromFile(filePath)](#util.data.readDataFromFile) ⇒ <code>Object</code>
1155
1155
  * [.writeDataToFile(filePath, data)](#util.data.writeDataToFile)
1156
- * [.decrypt(data)](#util.data.decrypt) ⇒ <code>String</code>
1156
+ * [.decrypt(data, options)](#util.data.decrypt) ⇒ <code>String</code>
1157
1157
 
1158
1158
  <a name="util.data.getData"></a>
1159
1159
 
@@ -1174,7 +1174,7 @@ const data = util.data.getData("myTest");
1174
1174
  ```
1175
1175
  <a name="util.data.getSecureData"></a>
1176
1176
 
1177
- #### data.getSecureData(filename, [source]) ⇒ <code>Object</code>
1177
+ #### data.getSecureData(filename, [source], [options]) ⇒ <code>Object</code>
1178
1178
  Returns and encrypts the data object with the given filename (JSON, stored in data folder). Will return the local file object if private key is not accessible.
1179
1179
 
1180
1180
  **Kind**: static method of [<code>data</code>](#util.data)
@@ -1184,6 +1184,7 @@ Returns and encrypts the data object with the given filename (JSON, stored in da
1184
1184
  | --- | --- | --- | --- |
1185
1185
  | filename | <code>String</code> | | The name of the data file (without suffix '.secure' or '.local'). |
1186
1186
  | [source] | <code>String</code> | <code>data</code> | The source key defined under params.import of the config file. |
1187
+ | [options] | <code>Object</code> | | The options object. |
1187
1188
 
1188
1189
  **Example**
1189
1190
  ```js
@@ -1223,7 +1224,7 @@ const data = util.data.writeDataToFile("myTest");
1223
1224
  ```
1224
1225
  <a name="util.data.decrypt"></a>
1225
1226
 
1226
- #### data.decrypt(data) ⇒ <code>String</code>
1227
+ #### data.decrypt(data, options) ⇒ <code>String</code>
1227
1228
  Decrypts the passed input data.
1228
1229
 
1229
1230
  **Kind**: static method of [<code>data</code>](#util.data)
@@ -1232,6 +1233,7 @@ Decrypts the passed input data.
1232
1233
  | Param | Type | Description |
1233
1234
  | --- | --- | --- |
1234
1235
  | data | <code>String</code> \| <code>Array.&lt;String&gt;</code> | The encrypted data to decrypt. Single value or array of values for different keys. |
1236
+ | options | <code>Object</code> | The decryption options. |
1235
1237
 
1236
1238
  **Example**
1237
1239
  ```js
@@ -1702,6 +1704,7 @@ Global namespace for UI5 modules.
1702
1704
  * [.expectToBeEnabled(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectToBeEnabled)
1703
1705
  * [.expectValidationError(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectValidationError)
1704
1706
  * [.expectValidationSuccess(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectValidationSuccess)
1707
+ * [.expectCssPropertyValueToBe(selector, cssProperty, compareValue, [index], [timeout])](#ui5.assertion.expectCssPropertyValueToBe)
1705
1708
  * [.expectBindingPathToBe(selector, attribute, compareValue, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectBindingPathToBe)
1706
1709
  * [.expectBindingContextPathToBe(selector, attribute, compareValue, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectBindingContextPathToBe)
1707
1710
  * [.expectToBeVisible(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectToBeVisible)
@@ -1739,6 +1742,7 @@ Global namespace for UI5 modules.
1739
1742
  * [.getId(selector, [index], [timeout])](#ui5.element.getId) ⇒ <code>String</code>
1740
1743
  * [.getPropertyValue(selector, property, [index], [timeout])](#ui5.element.getPropertyValue) ⇒ <code>any</code>
1741
1744
  * [.getValue(selector, [index], [timeout])](#ui5.element.getValue) ⇒ <code>String</code>
1745
+ * [.getCssPropertyValue(selector, cssProperty, [index], [timeout])](#ui5.element.getCssPropertyValue) ⇒ <code>String</code>
1742
1746
  * [.getBindingValue(selector, bindingContext, [index], [timeout])](#ui5.element.getBindingValue) ⇒ <code>String</code>
1743
1747
  * [.isVisible(selector, [index], [timeout])](#ui5.element.isVisible) ⇒ <code>Boolean</code>
1744
1748
  * [.highlight(selector, [duration], [color])](#ui5.element.highlight)
@@ -1846,6 +1850,7 @@ Global namespace for UI5 modules.
1846
1850
  * [.expectToBeEnabled(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectToBeEnabled)
1847
1851
  * [.expectValidationError(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectValidationError)
1848
1852
  * [.expectValidationSuccess(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectValidationSuccess)
1853
+ * [.expectCssPropertyValueToBe(selector, cssProperty, compareValue, [index], [timeout])](#ui5.assertion.expectCssPropertyValueToBe)
1849
1854
  * [.expectBindingPathToBe(selector, attribute, compareValue, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectBindingPathToBe)
1850
1855
  * [.expectBindingContextPathToBe(selector, attribute, compareValue, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectBindingContextPathToBe)
1851
1856
  * [.expectToBeVisible(selector, [index], [timeout], [loadPropertyTimeout])](#ui5.assertion.expectToBeVisible)
@@ -1951,7 +1956,7 @@ await ui5.assertion.expectValueToBeDefined(selector);
1951
1956
  <a name="ui5.assertion.expectToBeNotEnabled"></a>
1952
1957
 
1953
1958
  #### assertion.expectToBeNotEnabled(selector, [index], [timeout], [loadPropertyTimeout])
1954
- Expects that the element is enabled to the user.
1959
+ Expects that the element is not enabled to the user.
1955
1960
 
1956
1961
  **Kind**: static method of [<code>assertion</code>](#ui5.assertion)
1957
1962
 
@@ -2020,6 +2025,25 @@ Expects the valueState of the element to be "None".
2020
2025
  ```js
2021
2026
  await ui5.assertion.expectValidationSuccess(selector);
2022
2027
  ```
2028
+ <a name="ui5.assertion.expectCssPropertyValueToBe"></a>
2029
+
2030
+ #### assertion.expectCssPropertyValueToBe(selector, cssProperty, compareValue, [index], [timeout])
2031
+ Expects the CSS property value of the passed element to be the compare value.
2032
+
2033
+ **Kind**: static method of [<code>assertion</code>](#ui5.assertion)
2034
+
2035
+ | Param | Type | Default | Description |
2036
+ | --- | --- | --- | --- |
2037
+ | selector | <code>Object</code> | | The selector describing the element. |
2038
+ | cssProperty | <code>String</code> | | The CSS property of the element to compare with. |
2039
+ | compareValue | <code>String</code> | | The compare value. |
2040
+ | [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there is more than one element visible at the same time). |
2041
+ | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
2042
+
2043
+ **Example**
2044
+ ```js
2045
+ await ui5.assertion.expectCssPropertyValueToBe(selector, "color", "rgb(255, 0, 0)");
2046
+ ```
2023
2047
  <a name="ui5.assertion.expectBindingPathToBe"></a>
2024
2048
 
2025
2049
  #### assertion.expectBindingPathToBe(selector, attribute, compareValue, [index], [timeout], [loadPropertyTimeout])
@@ -2499,6 +2523,7 @@ await ui5.date.fillRange(selector, range);
2499
2523
  * [.getId(selector, [index], [timeout])](#ui5.element.getId) ⇒ <code>String</code>
2500
2524
  * [.getPropertyValue(selector, property, [index], [timeout])](#ui5.element.getPropertyValue) ⇒ <code>any</code>
2501
2525
  * [.getValue(selector, [index], [timeout])](#ui5.element.getValue) ⇒ <code>String</code>
2526
+ * [.getCssPropertyValue(selector, cssProperty, [index], [timeout])](#ui5.element.getCssPropertyValue) ⇒ <code>String</code>
2502
2527
  * [.getBindingValue(selector, bindingContext, [index], [timeout])](#ui5.element.getBindingValue) ⇒ <code>String</code>
2503
2528
  * [.isVisible(selector, [index], [timeout])](#ui5.element.isVisible) ⇒ <code>Boolean</code>
2504
2529
  * [.highlight(selector, [duration], [color])](#ui5.element.highlight)
@@ -2682,6 +2707,25 @@ Returns the inner value of the passed element.
2682
2707
  ```js
2683
2708
  const elemValue = await ui5.element.getValue(selector);
2684
2709
  ```
2710
+ <a name="ui5.element.getCssPropertyValue"></a>
2711
+
2712
+ #### element.getCssPropertyValue(selector, cssProperty, [index], [timeout]) ⇒ <code>String</code>
2713
+ Returns the value of the passed CSS property of the element.
2714
+
2715
+ **Kind**: static method of [<code>element</code>](#ui5.element)
2716
+ **Returns**: <code>String</code> - The value of the CSS property.
2717
+
2718
+ | Param | Type | Default | Description |
2719
+ | --- | --- | --- | --- |
2720
+ | selector | <code>Object</code> | | The selector describing the element. |
2721
+ | cssProperty | <code>String</code> | | The CSS property of the element to get value. |
2722
+ | [index] | <code>Number</code> | <code>0</code> | The index of the selector (in case there are more than one elements visible at the same time). |
2723
+ | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
2724
+
2725
+ **Example**
2726
+ ```js
2727
+ const cssPropertyValue = await ui5.element.getCssPropertyValue(selector, "visibility");
2728
+ ```
2685
2729
  <a name="ui5.element.getBindingValue"></a>
2686
2730
 
2687
2731
  #### element.getBindingValue(selector, bindingContext, [index], [timeout]) ⇒ <code>String</code>
@@ -4300,6 +4344,7 @@ Global namespace for non UI5 modules.
4300
4344
  * [.expectAttributeToBe(elementOrSelector, compareValue, [attribute])](#nonUi5.assertion.expectAttributeToBe)
4301
4345
  * [.expectAttributeToContain(elementOrSelector, compareValue, [attribute])](#nonUi5.assertion.expectAttributeToContain)
4302
4346
  * [.expectValueToBe(elementOrSelector, compareValue)](#nonUi5.assertion.expectValueToBe)
4347
+ * [.expectCssPropertyValueToBe(elementOrSelector, cssProperty, compareValue)](#nonUi5.assertion.expectCssPropertyValueToBe)
4303
4348
  * [.expectToBeVisible(elementOrSelector)](#nonUi5.assertion.expectToBeVisible)
4304
4349
  * [.expectToBeNotVisible(elementOrSelector, [timeout])](#nonUi5.assertion.expectToBeNotVisible)
4305
4350
  * [.element](#nonUi5.element)
@@ -4324,6 +4369,7 @@ Global namespace for non UI5 modules.
4324
4369
  * [.isSelected(elem)](#nonUi5.element.isSelected) ⇒ <code>boolean</code>
4325
4370
  * [.getAttributeValue(elem, [attribute])](#nonUi5.element.getAttributeValue) ⇒ <code>String</code>
4326
4371
  * [.getValue(elem)](#nonUi5.element.getValue) ⇒ <code>String</code>
4372
+ * [.getCssPropertyValue(elementOrSelector, cssProperty)](#nonUi5.element.getCssPropertyValue) ⇒ <code>String</code>
4327
4373
  * [.setInnerHTML(elem)](#nonUi5.element.setInnerHTML) ⇒ <code>String</code>
4328
4374
  * [.highlight(elem, [duration], [color])](#nonUi5.element.highlight)
4329
4375
  * [.navigation](#nonUi5.navigation)
@@ -4358,6 +4404,7 @@ Global namespace for non UI5 modules.
4358
4404
  * [.expectAttributeToBe(elementOrSelector, compareValue, [attribute])](#nonUi5.assertion.expectAttributeToBe)
4359
4405
  * [.expectAttributeToContain(elementOrSelector, compareValue, [attribute])](#nonUi5.assertion.expectAttributeToContain)
4360
4406
  * [.expectValueToBe(elementOrSelector, compareValue)](#nonUi5.assertion.expectValueToBe)
4407
+ * [.expectCssPropertyValueToBe(elementOrSelector, cssProperty, compareValue)](#nonUi5.assertion.expectCssPropertyValueToBe)
4361
4408
  * [.expectToBeVisible(elementOrSelector)](#nonUi5.assertion.expectToBeVisible)
4362
4409
  * [.expectToBeNotVisible(elementOrSelector, [timeout])](#nonUi5.assertion.expectToBeNotVisible)
4363
4410
 
@@ -4419,6 +4466,24 @@ Expects the attributes value of the passed element to be the compare value.
4419
4466
  const element = await nonUi5.element.getById("button01");
4420
4467
  await nonUi5.assertion.expectValueToBe(element, "Save");
4421
4468
  ```
4469
+ <a name="nonUi5.assertion.expectCssPropertyValueToBe"></a>
4470
+
4471
+ #### assertion.expectCssPropertyValueToBe(elementOrSelector, cssProperty, compareValue)
4472
+ Expects the CSS property value of the passed element to be the compare value.
4473
+
4474
+ **Kind**: static method of [<code>assertion</code>](#nonUi5.assertion)
4475
+
4476
+ | Param | Type | Description |
4477
+ | --- | --- | --- |
4478
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | The element or CSS selector describing the element. |
4479
+ | cssProperty | <code>String</code> | The CSS property of the element to compare with. |
4480
+ | compareValue | <code>String</code> | The compare value. |
4481
+
4482
+ **Example**
4483
+ ```js
4484
+ const element = await nonUi5.element.getById("button01");
4485
+ await nonUi5.assertion.expectCssPropertyValueToBe(element, "color", "rgb(255, 0, 0)");
4486
+ ```
4422
4487
  <a name="nonUi5.assertion.expectToBeVisible"></a>
4423
4488
 
4424
4489
  #### assertion.expectToBeVisible(elementOrSelector)
@@ -4479,6 +4544,7 @@ await nonUi5.assertion.expectToBeNotVisible(element, 5000);
4479
4544
  * [.isSelected(elem)](#nonUi5.element.isSelected) ⇒ <code>boolean</code>
4480
4545
  * [.getAttributeValue(elem, [attribute])](#nonUi5.element.getAttributeValue) ⇒ <code>String</code>
4481
4546
  * [.getValue(elem)](#nonUi5.element.getValue) ⇒ <code>String</code>
4547
+ * [.getCssPropertyValue(elementOrSelector, cssProperty)](#nonUi5.element.getCssPropertyValue) ⇒ <code>String</code>
4482
4548
  * [.setInnerHTML(elem)](#nonUi5.element.setInnerHTML) ⇒ <code>String</code>
4483
4549
  * [.highlight(elem, [duration], [color])](#nonUi5.element.highlight)
4484
4550
 
@@ -4887,6 +4953,24 @@ Returns the value of the passed element.
4887
4953
  const elem = await nonUi5.element.getById("elem02");
4888
4954
  const innerHTML = await nonUi5.element.getValue(elem);
4889
4955
  ```
4956
+ <a name="nonUi5.element.getCssPropertyValue"></a>
4957
+
4958
+ #### element.getCssPropertyValue(elementOrSelector, cssProperty) ⇒ <code>String</code>
4959
+ Returns the value of the passed CSS property of the element.
4960
+
4961
+ **Kind**: static method of [<code>element</code>](#nonUi5.element)
4962
+ **Returns**: <code>String</code> - The value of the CSS property.
4963
+
4964
+ | Param | Type | Description |
4965
+ | --- | --- | --- |
4966
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | The element or CSS selector describing the element. |
4967
+ | cssProperty | <code>String</code> | The CSS property of the element to get value. |
4968
+
4969
+ **Example**
4970
+ ```js
4971
+ const elem = await nonUi5.element.getById("elem01");
4972
+ const color = await nonUi5.element.getCssPropertyValue(elem, "color");
4973
+ ```
4890
4974
  <a name="nonUi5.element.setInnerHTML"></a>
4891
4975
 
4892
4976
  #### element.setInnerHTML(elem) ⇒ <code>String</code>
@@ -5781,24 +5865,42 @@ Global namespace for mobile modules.
5781
5865
 
5782
5866
  * [mobile](#mobile)
5783
5867
  * [.android](#mobile.android)
5784
- * [.pressKeyByName(keyName)](#mobile.android.pressKeyByName)
5785
- * [.pressKeyByCode(keyCode)](#mobile.android.pressKeyByCode)
5868
+ * [.pressKeyByName(keyName)](#mobile.android.pressKeyByName) ⇒ <code>Promise.&lt;void&gt;</code>
5869
+ * [.pressKeyByCode(keyCode)](#mobile.android.pressKeyByCode) ⇒ <code>Promise.&lt;void&gt;</code>
5786
5870
  * [.device](#mobile.device)
5787
- * [.isAppInstalled(packageIdOrBundleId)](#mobile.device.isAppInstalled) ⇒ <code>boolean</code>
5788
- * [.installApp(appPath)](#mobile.device.installApp)
5871
+ * [.isAppInstalled(appPackageOrBundleId)](#mobile.device.isAppInstalled) ⇒ <code>boolean</code>
5872
+ * [.installApp(appPath)](#mobile.device.installApp) ⇒ <code>Promise.&lt;void&gt;</code>
5873
+ * [.switchToContext([targetContext], [timeout])](#mobile.device.switchToContext) ⇒ <code>Promise.&lt;boolean&gt;</code>
5874
+ * [.getTargetContextIfAvailable([targetContext], [timeout])](#mobile.device.getTargetContextIfAvailable) ⇒ <code>Promise.&lt;(string\|null)&gt;</code>
5875
+ * [.closeApplication()](#mobile.device.closeApplication) ⇒ <code>Promise.&lt;void&gt;</code>
5876
+ * [.queryAppState(appPackageOrBundleId)](#mobile.device.queryAppState) ⇒ <code>Promise.&lt;number&gt;</code>
5877
+ * [.launchApp(appPackageOrBundleId)](#mobile.device.launchApp) ⇒ <code>Promise.&lt;void&gt;</code>
5878
+ * [.switchToLandscapeOrientation()](#mobile.device.switchToLandscapeOrientation) ⇒ <code>Promise.&lt;void&gt;</code>
5879
+ * [.switchToPortraitOrientation()](#mobile.device.switchToPortraitOrientation) ⇒ <code>Promise.&lt;void&gt;</code>
5880
+ * [.getCurrentOrientation()](#mobile.device.getCurrentOrientation) ⇒ <code>Promise.&lt;Orientation&gt;</code>
5881
+ * [.hideKeyboard(strategy, key, keyCode, [timeout])](#mobile.device.hideKeyboard) ⇒ <code>Promise.&lt;void&gt;</code>
5882
+ * [.isKeyboardVisible()](#mobile.device.isKeyboardVisible) ⇒ <code>Promise.&lt;boolean&gt;</code>
5883
+ * [.isPlatformSupported()](#mobile.device.isPlatformSupported) ⇒ <code>Promise.&lt;boolean&gt;</code>
5789
5884
  * [.element](#mobile.element)
5790
- * [.isVisible(element, [strict])](#mobile.element.isVisible) ⇒ <code>Boolean</code>
5791
- * [.isPresent(elem)](#mobile.element.isPresent) ⇒ <code>Boolean</code>
5792
- * [.waitToBePresent(selector, [timeout])](#mobile.element.waitToBePresent)
5793
- * [.waitToBeVisible(selector, [timeout])](#mobile.element.waitToBeVisible)
5794
- * [.waitToBeClickable(selector, [timeout])](#mobile.element.waitToBeClickable)
5795
- * [.isSelected(elem)](#mobile.element.isSelected) ⇒ <code>boolean</code>
5885
+ * [.isVisible(element, [strict])](#mobile.element.isVisible) ⇒ <code>boolean</code>
5886
+ * [.isPresent(element)](#mobile.element.isPresent) ⇒ <code>boolean</code>
5887
+ * [.waitToBePresent(selector, [timeout])](#mobile.element.waitToBePresent) ⇒ <code>boolean</code>
5888
+ * [.waitToBeVisible(selector, [timeout])](#mobile.element.waitToBeVisible) ⇒ <code>boolean</code>
5889
+ * [.waitToBeClickable(selector, [timeout])](#mobile.element.waitToBeClickable) ⇒ <code>boolean</code>
5890
+ * [.isSelected(elementOrSelector)](#mobile.element.isSelected) ⇒ <code>boolean</code>
5891
+ * [.waitToBeEnabled(selector, [timeout])](#mobile.element.waitToBeEnabled) ⇒ <code>boolean</code>
5796
5892
  * [.gestures](#mobile.gestures)
5797
- * [.swipe(startX, startY, endX, endY, duration)](#mobile.gestures.swipe) ⇒ <code>Promise.&lt;void&gt;</code>
5893
+ * [.swipe(startX, startY, endX, endY, [duration])](#mobile.gestures.swipe) ⇒ <code>Promise.&lt;void&gt;</code>
5894
+ * [.tap(coordX, coordY)](#mobile.gestures.tap) ⇒ <code>Promise.&lt;void&gt;</code>
5798
5895
  * [.ios](#mobile.ios)
5799
5896
  * [.userInteraction](#mobile.userInteraction)
5800
- * [.tap(element, [timeout])](#mobile.userInteraction.tap)
5801
- * [.check(element)](#mobile.userInteraction.check)
5897
+ * [.tap(elementOrSelector, [timeout])](#mobile.userInteraction.tap)
5898
+ * [.check(elementOrSelector, [timeout])](#mobile.userInteraction.check)
5899
+ * [.uncheck(elementOrSelector, [timeout])](#mobile.userInteraction.uncheck)
5900
+ * [.doubleTap(elementOrSelector, [timeout])](#mobile.userInteraction.doubleTap) ⇒ <code>Promise.&lt;void&gt;</code>
5901
+ * [.fill(elementOrSelector, value, [timeout])](#mobile.userInteraction.fill) ⇒ <code>Promise.&lt;void&gt;</code>
5902
+ * [.clearAndFill(elementOrSelector, value, [timeout])](#mobile.userInteraction.clearAndFill) ⇒ <code>Promise.&lt;void&gt;</code>
5903
+ * [.clear(elementOrSelector, [timeout])](#mobile.userInteraction.clear) ⇒ <code>Promise.&lt;void&gt;</code>
5802
5904
 
5803
5905
  <a name="mobile.android"></a>
5804
5906
 
@@ -5806,12 +5908,12 @@ Global namespace for mobile modules.
5806
5908
  **Kind**: static class of [<code>mobile</code>](#mobile)
5807
5909
 
5808
5910
  * [.android](#mobile.android)
5809
- * [.pressKeyByName(keyName)](#mobile.android.pressKeyByName)
5810
- * [.pressKeyByCode(keyCode)](#mobile.android.pressKeyByCode)
5911
+ * [.pressKeyByName(keyName)](#mobile.android.pressKeyByName) ⇒ <code>Promise.&lt;void&gt;</code>
5912
+ * [.pressKeyByCode(keyCode)](#mobile.android.pressKeyByCode) ⇒ <code>Promise.&lt;void&gt;</code>
5811
5913
 
5812
5914
  <a name="mobile.android.pressKeyByName"></a>
5813
5915
 
5814
- #### android.pressKeyByName(keyName)
5916
+ #### android.pressKeyByName(keyName) ⇒ <code>Promise.&lt;void&gt;</code>
5815
5917
  Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
5816
5918
 
5817
5919
  **Kind**: static method of [<code>android</code>](#mobile.android)
@@ -5822,15 +5924,12 @@ Simulate pressing a hardware key on the android device (e.g., back button, home
5822
5924
 
5823
5925
  **Example**
5824
5926
  ```js
5825
- await mobile.device.pressKeyByName("back");
5826
- ```
5827
- **Example**
5828
- ```js
5829
- await mobile.device.pressKeyByName("home");
5927
+ await mobile.android.pressKeyByName("back");
5928
+ await mobile.android.pressKeyByName("home");
5830
5929
  ```
5831
5930
  <a name="mobile.android.pressKeyByCode"></a>
5832
5931
 
5833
- #### android.pressKeyByCode(keyCode)
5932
+ #### android.pressKeyByCode(keyCode) ⇒ <code>Promise.&lt;void&gt;</code>
5834
5933
  Simulate pressing a hardware key on the android device (e.g., back button, home button, etc.),
5835
5934
 
5836
5935
  **Kind**: static method of [<code>android</code>](#mobile.android)
@@ -5850,28 +5949,40 @@ await mobile.android.pressKeyByCode(4);
5850
5949
  **Kind**: static class of [<code>mobile</code>](#mobile)
5851
5950
 
5852
5951
  * [.device](#mobile.device)
5853
- * [.isAppInstalled(packageIdOrBundleId)](#mobile.device.isAppInstalled) ⇒ <code>boolean</code>
5854
- * [.installApp(appPath)](#mobile.device.installApp)
5952
+ * [.isAppInstalled(appPackageOrBundleId)](#mobile.device.isAppInstalled) ⇒ <code>boolean</code>
5953
+ * [.installApp(appPath)](#mobile.device.installApp) ⇒ <code>Promise.&lt;void&gt;</code>
5954
+ * [.switchToContext([targetContext], [timeout])](#mobile.device.switchToContext) ⇒ <code>Promise.&lt;boolean&gt;</code>
5955
+ * [.getTargetContextIfAvailable([targetContext], [timeout])](#mobile.device.getTargetContextIfAvailable) ⇒ <code>Promise.&lt;(string\|null)&gt;</code>
5956
+ * [.closeApplication()](#mobile.device.closeApplication) ⇒ <code>Promise.&lt;void&gt;</code>
5957
+ * [.queryAppState(appPackageOrBundleId)](#mobile.device.queryAppState) ⇒ <code>Promise.&lt;number&gt;</code>
5958
+ * [.launchApp(appPackageOrBundleId)](#mobile.device.launchApp) ⇒ <code>Promise.&lt;void&gt;</code>
5959
+ * [.switchToLandscapeOrientation()](#mobile.device.switchToLandscapeOrientation) ⇒ <code>Promise.&lt;void&gt;</code>
5960
+ * [.switchToPortraitOrientation()](#mobile.device.switchToPortraitOrientation) ⇒ <code>Promise.&lt;void&gt;</code>
5961
+ * [.getCurrentOrientation()](#mobile.device.getCurrentOrientation) ⇒ <code>Promise.&lt;Orientation&gt;</code>
5962
+ * [.hideKeyboard(strategy, key, keyCode, [timeout])](#mobile.device.hideKeyboard) ⇒ <code>Promise.&lt;void&gt;</code>
5963
+ * [.isKeyboardVisible()](#mobile.device.isKeyboardVisible) ⇒ <code>Promise.&lt;boolean&gt;</code>
5964
+ * [.isPlatformSupported()](#mobile.device.isPlatformSupported) ⇒ <code>Promise.&lt;boolean&gt;</code>
5855
5965
 
5856
5966
  <a name="mobile.device.isAppInstalled"></a>
5857
5967
 
5858
- #### device.isAppInstalled(packageIdOrBundleId) ⇒ <code>boolean</code>
5859
- Check wether given package/bundle app is installed or not in the device.
5968
+ #### device.isAppInstalled(appPackageOrBundleId) ⇒ <code>boolean</code>
5969
+ Check if the application identified by its Package name/Bundle ID is installed on the device.
5860
5970
 
5861
5971
  **Kind**: static method of [<code>device</code>](#mobile.device)
5862
- **Returns**: <code>boolean</code> - Returns true if specified app package/bundled installed in the device, or false.
5972
+ **Returns**: <code>boolean</code> - - Returns `true` if specified app package/bundled installed in the device, or `false`.
5863
5973
 
5864
5974
  | Param | Type | Description |
5865
5975
  | --- | --- | --- |
5866
- | packageIdOrBundleId | <code>string</code> | Android package Id, or iOS bundle Id. |
5976
+ | appPackageOrBundleId | <code>string</code> | Android package Name, or iOS bundle Id. |
5867
5977
 
5868
5978
  **Example**
5869
5979
  ```js
5870
5980
  await mobile.device.isAppInstalled("com.google.android.apps.maps");
5981
+ await mobile.device.isAppInstalled("com.apple.AppStore")
5871
5982
  ```
5872
5983
  <a name="mobile.device.installApp"></a>
5873
5984
 
5874
- #### device.installApp(appPath)
5985
+ #### device.installApp(appPath) ⇒ <code>Promise.&lt;void&gt;</code>
5875
5986
  Install the appropriate app based on the platform the test is being executed on.
5876
5987
 
5877
5988
  **Kind**: static method of [<code>device</code>](#mobile.device)
@@ -5885,48 +5996,216 @@ Install the appropriate app based on the platform the test is being executed on.
5885
5996
  await mobile.device.installApp("/path/to/your/app.apk");
5886
5997
  await mobile.device.installApp("/path/to/your/app.ipa");
5887
5998
  ```
5999
+ <a name="mobile.device.switchToContext"></a>
6000
+
6001
+ #### device.switchToContext([targetContext], [timeout]) ⇒ <code>Promise.&lt;boolean&gt;</code>
6002
+ Switch to the specified( WEBVIEW | NATIVE_APP ) context if available.
6003
+
6004
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6005
+ **Returns**: <code>Promise.&lt;boolean&gt;</code> - Returns `true` if the context is successfully switched, otherwise `false`.
6006
+
6007
+ | Param | Type | Default | Description |
6008
+ | --- | --- | --- | --- |
6009
+ | [targetContext] | <code>string</code> | <code>&quot;&#x27;WEBVIEW&#x27;&quot;</code> | The name of the target context. |
6010
+ | [timeout] | <code>number</code> | <code>5000</code> | Maximum time to wait for the web context to appear, milliseconds. |
6011
+
6012
+ **Example**
6013
+ ```js
6014
+ await mobile.device.switchToContext();
6015
+ await mobile.device.switchToContext("NATIVE_APP", 1000);
6016
+ ```
6017
+ <a name="mobile.device.getTargetContextIfAvailable"></a>
6018
+
6019
+ #### device.getTargetContextIfAvailable([targetContext], [timeout]) ⇒ <code>Promise.&lt;(string\|null)&gt;</code>
6020
+ Returns the specified target context if available within a given timeout.
6021
+
6022
+ This method retrieves the list of available contexts and determines if a context
6023
+ that matches the `targetContext` string is present. If the target context is found,
6024
+ it returns the context name; otherwise, it returns `null`.
6025
+
6026
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6027
+ **Returns**: <code>Promise.&lt;(string\|null)&gt;</code> - The name of the target context if found, or `null` if
6028
+ the context is not available within the timeout.
6029
+
6030
+ | Param | Type | Default | Description |
6031
+ | --- | --- | --- | --- |
6032
+ | [targetContext] | <code>string</code> | <code>&quot;&#x27;WEBVIEW&#x27;&quot;</code> | The name of the target context to check for. Common examples are `WEBVIEW` or `NATIVE_APP`. |
6033
+ | [timeout] | <code>number</code> | <code>5000</code> | The maximum time, in milliseconds, to wait for the target context to become available. |
6034
+
6035
+ **Example**
6036
+ ```js
6037
+ const context = await getTargetContextIfAvailable("WEBVIEW", 10000);
6038
+ const context = await getTargetContextIfAvailable("NATIVE_APP", 10000);
6039
+ ```
6040
+ <a name="mobile.device.closeApplication"></a>
6041
+
6042
+ #### device.closeApplication() ⇒ <code>Promise.&lt;void&gt;</code>
6043
+ Close the currently active mobile application.
6044
+
6045
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6046
+ **Example**
6047
+ ```js
6048
+ await mobile.device.closeApplication();
6049
+ ```
6050
+ <a name="mobile.device.queryAppState"></a>
6051
+
6052
+ #### device.queryAppState(appPackageOrBundleId) ⇒ <code>Promise.&lt;number&gt;</code>
6053
+ Queries the state of the application (e.g., running, background, not installed) on the mobile device(Android or iOS).
6054
+
6055
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6056
+ **Returns**: <code>Promise.&lt;number&gt;</code> - - The app state:
6057
+ 0 - Not running,
6058
+ 1 - Not installed,
6059
+ 2 - Running in the background (not suspended),
6060
+ 3 - Running in the background (suspended),
6061
+ 4 - Running in the foreground.
6062
+
6063
+ | Param | Type | Description |
6064
+ | --- | --- | --- |
6065
+ | appPackageOrBundleId | <code>string</code> | Package name (Android) or bundle ID (iOS) of the application. |
6066
+
6067
+ **Example**
6068
+ ```js
6069
+ await mobile.device.queryAppState("com.google.android.apps.maps");
6070
+ await mobile.device.queryAppState("com.apple.AppStore");
6071
+ ```
6072
+ <a name="mobile.device.launchApp"></a>
6073
+
6074
+ #### device.launchApp(appPackageOrBundleId) ⇒ <code>Promise.&lt;void&gt;</code>
6075
+ Launches the app for both iOS and Android with a parameterized app identifier.
6076
+
6077
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6078
+ **Returns**: <code>Promise.&lt;void&gt;</code> - Resolves when the app is successfully launched.
6079
+
6080
+ | Param | Type | Description |
6081
+ | --- | --- | --- |
6082
+ | appPackageOrBundleId | <code>string</code> | The Android package name or iOS bundle ID of the application. |
6083
+
6084
+ **Example**
6085
+ ```js
6086
+ await mobile.device.launchApp("com.google.android.apps.maps");
6087
+ await mobile.device.launchApp("com.apple.AppStore");
6088
+ ```
6089
+ <a name="mobile.device.switchToLandscapeOrientation"></a>
6090
+
6091
+ #### device.switchToLandscapeOrientation() ⇒ <code>Promise.&lt;void&gt;</code>
6092
+ Switches the device orientation to landscape mode.
6093
+
6094
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6095
+ **Returns**: <code>Promise.&lt;void&gt;</code> - Resolves when the orientation is successfully switched.
6096
+ **Example**
6097
+ ```js
6098
+ await mobile.device.switchToLandscapeOrientation();
6099
+ ```
6100
+ <a name="mobile.device.switchToPortraitOrientation"></a>
6101
+
6102
+ #### device.switchToPortraitOrientation() ⇒ <code>Promise.&lt;void&gt;</code>
6103
+ Switches the device orientation to portrait mode.
6104
+
6105
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6106
+ **Returns**: <code>Promise.&lt;void&gt;</code> - Resolves when the orientation is successfully switched.
6107
+ **Example**
6108
+ ```js
6109
+ await mobile.device.switchToPortraitOrientation();
6110
+ ```
6111
+ <a name="mobile.device.getCurrentOrientation"></a>
6112
+
6113
+ #### device.getCurrentOrientation() ⇒ <code>Promise.&lt;Orientation&gt;</code>
6114
+ Returns the device current orientation (PORTRAIT or LANDSCAPE)
6115
+
6116
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6117
+ **Returns**: <code>Promise.&lt;Orientation&gt;</code> - The current device orientation.
6118
+ **Example**
6119
+ ```js
6120
+ await mobile.device.getCurrentOrientation();
6121
+ ```
6122
+ <a name="mobile.device.hideKeyboard"></a>
6123
+
6124
+ #### device.hideKeyboard(strategy, key, keyCode, [timeout]) ⇒ <code>Promise.&lt;void&gt;</code>
6125
+ Hides the keyboard on both Android and iOS using specific strategies with timeout.
6126
+
6127
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6128
+
6129
+ | Param | Type | Default | Description |
6130
+ | --- | --- | --- | --- |
6131
+ | strategy | <code>string</code> | | Strategy to use for hiding the keyboard ('pressKey', 'tapOutside', 'swipeDown'). |
6132
+ | key | <code>string</code> | | Key to press if using the 'pressKey' strategy (e.g., 'Done', 'Enter'). |
6133
+ | keyCode | <code>number</code> | | Key code for Android (optional). |
6134
+ | [timeout] | <code>number</code> | <code>5000</code> | Timeout in milliseconds for retrying to hide the keyboard. |
6135
+
6136
+ **Example**
6137
+ ```js
6138
+ await mobile.device.hideKeyboard();
6139
+ await mobile.device.hideKeyboard('tapOutside');
6140
+ await mobile.device.hideKeyboard('swipeDown');
6141
+ //Android only, Sends a specific key code, like 66 for "Enter."
6142
+ await mobile.device.hideKeyboard('pressKey', undefined, 66);
6143
+ await mobile.device.hideKeyboard('pressKey', 'Done');
6144
+ ```
6145
+ <a name="mobile.device.isKeyboardVisible"></a>
6146
+
6147
+ #### device.isKeyboardVisible() ⇒ <code>Promise.&lt;boolean&gt;</code>
6148
+ Checks if the keyboard is visible or not on the mobile device.
6149
+
6150
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6151
+ **Returns**: <code>Promise.&lt;boolean&gt;</code> - Returns `true` if the keyboard is visible on the mobile view.
6152
+ **Example**
6153
+ ```js
6154
+ await mobile.device.isKeyboardVisible();
6155
+ ```
6156
+ <a name="mobile.device.isPlatformSupported"></a>
6157
+
6158
+ #### device.isPlatformSupported() ⇒ <code>Promise.&lt;boolean&gt;</code>
6159
+ Determine if the current platform is supported, if the current device platform is either `Android` or `iOS`.
6160
+
6161
+ **Kind**: static method of [<code>device</code>](#mobile.device)
6162
+ **Returns**: <code>Promise.&lt;boolean&gt;</code> - If neither Android nor iOS is detected (e.g., Windows, Linux, or web), the condition evaluates to false
6163
+ **Example**
6164
+ ```js
6165
+ await mobile.device.isPlatformSupported();
6166
+ ```
5888
6167
  <a name="mobile.element"></a>
5889
6168
 
5890
6169
  ### mobile.element
5891
6170
  **Kind**: static class of [<code>mobile</code>](#mobile)
5892
6171
 
5893
6172
  * [.element](#mobile.element)
5894
- * [.isVisible(element, [strict])](#mobile.element.isVisible) ⇒ <code>Boolean</code>
5895
- * [.isPresent(elem)](#mobile.element.isPresent) ⇒ <code>Boolean</code>
5896
- * [.waitToBePresent(selector, [timeout])](#mobile.element.waitToBePresent)
5897
- * [.waitToBeVisible(selector, [timeout])](#mobile.element.waitToBeVisible)
5898
- * [.waitToBeClickable(selector, [timeout])](#mobile.element.waitToBeClickable)
5899
- * [.isSelected(elem)](#mobile.element.isSelected) ⇒ <code>boolean</code>
6173
+ * [.isVisible(element, [strict])](#mobile.element.isVisible) ⇒ <code>boolean</code>
6174
+ * [.isPresent(element)](#mobile.element.isPresent) ⇒ <code>boolean</code>
6175
+ * [.waitToBePresent(selector, [timeout])](#mobile.element.waitToBePresent) ⇒ <code>boolean</code>
6176
+ * [.waitToBeVisible(selector, [timeout])](#mobile.element.waitToBeVisible) ⇒ <code>boolean</code>
6177
+ * [.waitToBeClickable(selector, [timeout])](#mobile.element.waitToBeClickable) ⇒ <code>boolean</code>
6178
+ * [.isSelected(elementOrSelector)](#mobile.element.isSelected) ⇒ <code>boolean</code>
6179
+ * [.waitToBeEnabled(selector, [timeout])](#mobile.element.waitToBeEnabled) ⇒ <code>boolean</code>
5900
6180
 
5901
6181
  <a name="mobile.element.isVisible"></a>
5902
6182
 
5903
- #### element.isVisible(element, [strict]) ⇒ <code>Boolean</code>
6183
+ #### element.isVisible(element, [strict]) ⇒ <code>boolean</code>
5904
6184
  Returns a boolean if the mobile element is visible to the user.
5905
6185
 
5906
6186
  **Kind**: static method of [<code>element</code>](#mobile.element)
5907
- **Returns**: <code>Boolean</code> - Returns true or false.
6187
+ **Returns**: <code>boolean</code> - Returns true or false.
5908
6188
 
5909
6189
  | Param | Type | Default | Description |
5910
6190
  | --- | --- | --- | --- |
5911
- | element | <code>Object</code> | | The Mobile Ui element. |
5912
- | [strict] | <code>Boolean</code> | <code>true</code> | If strict mode is enabled it will only return "true" if the element is visible on the mobile view and within the viewport. If "false", it will be sufficient if the element is visible on the view but not inside the current viewport. |
6191
+ | element | <code>Element</code> | | The Mobile Ui element. |
6192
+ | [strict] | <code>boolean</code> | <code>true</code> | If strict mode is enabled it will only return "true" if the element is visible on the mobile view and within the viewport. If "false", it will be sufficient if the element is visible on the view but not inside the current viewport. |
5913
6193
 
5914
6194
  **Example**
5915
6195
  ```js
5916
- const elem = await mobile.element.isVisible("button01");
5917
6196
  await mobile.element.isVisible(elem);
5918
6197
  ```
5919
6198
  <a name="mobile.element.isPresent"></a>
5920
6199
 
5921
- #### element.isPresent(elem) ⇒ <code>Boolean</code>
6200
+ #### element.isPresent(element) ⇒ <code>boolean</code>
5922
6201
  Returns a boolean if the element is present at the DOM or not. It might be hidden.
5923
6202
 
5924
6203
  **Kind**: static method of [<code>element</code>](#mobile.element)
5925
- **Returns**: <code>Boolean</code> - Returns true or false.
6204
+ **Returns**: <code>boolean</code> - Returns true or false.
5926
6205
 
5927
6206
  | Param | Type | Description |
5928
6207
  | --- | --- | --- |
5929
- | elem | <code>Object</code> | The element. |
6208
+ | element | <code>Element</code> | The element. |
5930
6209
 
5931
6210
  **Example**
5932
6211
  ```js
@@ -5934,111 +6213,147 @@ await mobile.element.isPresent(elem);
5934
6213
  ```
5935
6214
  <a name="mobile.element.waitToBePresent"></a>
5936
6215
 
5937
- #### element.waitToBePresent(selector, [timeout])
6216
+ #### element.waitToBePresent(selector, [timeout]) ⇒ <code>boolean</code>
5938
6217
  Waits until the element with the given selector is present.
5939
6218
 
5940
6219
  **Kind**: static method of [<code>element</code>](#mobile.element)
6220
+ **Returns**: <code>boolean</code> - Returns true or false.
5941
6221
 
5942
6222
  | Param | Type | Default | Description |
5943
6223
  | --- | --- | --- | --- |
5944
6224
  | selector | <code>Object</code> | | The CSS selector describing the element. |
5945
- | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
6225
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
5946
6226
 
5947
6227
  **Example**
5948
6228
  ```js
5949
6229
  await mobile.element.waitToBePresent(".input01");
5950
- ```
5951
- **Example**
5952
- ```js
5953
6230
  await mobile.element.waitToBePresent("#button12");
5954
- ```
5955
- **Example**
5956
- ```js
5957
6231
  await mobile.element.waitToBePresent("p:first-child");
5958
6232
  ```
5959
6233
  <a name="mobile.element.waitToBeVisible"></a>
5960
6234
 
5961
- #### element.waitToBeVisible(selector, [timeout])
6235
+ #### element.waitToBeVisible(selector, [timeout]) ⇒ <code>boolean</code>
5962
6236
  Waits until the element with the given selector is visible.
5963
6237
 
5964
6238
  **Kind**: static method of [<code>element</code>](#mobile.element)
6239
+ **Returns**: <code>boolean</code> - Returns true or false.
5965
6240
 
5966
6241
  | Param | Type | Default | Description |
5967
6242
  | --- | --- | --- | --- |
5968
6243
  | selector | <code>Object</code> | | The CSS selector describing the element. |
5969
- | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
6244
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
5970
6245
 
5971
6246
  **Example**
5972
6247
  ```js
5973
6248
  await mobile.element.waitToBeVisible(".input01");
5974
- ```
5975
- **Example**
5976
- ```js
5977
6249
  await mobile.element.waitToBeVisible("#button12");
5978
- ```
5979
- **Example**
5980
- ```js
5981
6250
  await mobile.element.waitToBeVisible("p:first-child");
5982
6251
  ```
5983
6252
  <a name="mobile.element.waitToBeClickable"></a>
5984
6253
 
5985
- #### element.waitToBeClickable(selector, [timeout])
6254
+ #### element.waitToBeClickable(selector, [timeout]) ⇒ <code>boolean</code>
5986
6255
  Waits until the element with the given selector is clickable.
5987
6256
 
5988
6257
  **Kind**: static method of [<code>element</code>](#mobile.element)
6258
+ **Returns**: <code>boolean</code> - Returns true or false.
5989
6259
 
5990
6260
  | Param | Type | Default | Description |
5991
6261
  | --- | --- | --- | --- |
5992
6262
  | selector | <code>Object</code> | | The CSS selector describing the element. |
5993
- | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
6263
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
5994
6264
 
5995
6265
  **Example**
5996
6266
  ```js
5997
6267
  await mobile.element.waitToBeClickable(".input01");
5998
- ```
5999
- **Example**
6000
- ```js
6001
6268
  await mobile.element.waitToBeClickable("#button12");
6002
- ```
6003
- **Example**
6004
- ```js
6005
6269
  await mobile.element.waitToBeClickable("p:first-child");
6006
6270
  ```
6007
6271
  <a name="mobile.element.isSelected"></a>
6008
6272
 
6009
- #### element.isSelected(elem) ⇒ <code>boolean</code>
6273
+ #### element.isSelected(elementOrSelector) ⇒ <code>boolean</code>
6010
6274
  Returns a boolean if the element (e.g. checkbox) is selected.
6011
6275
 
6012
6276
  **Kind**: static method of [<code>element</code>](#mobile.element)
6277
+ **Returns**: <code>boolean</code> - Returns true or false.
6013
6278
 
6014
6279
  | Param | Type | Description |
6015
6280
  | --- | --- | --- |
6016
- | elem | <code>Object</code> | The element. |
6281
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | The element. |
6017
6282
 
6018
6283
  **Example**
6019
6284
  ```js
6020
- const elem = await mobile.element.getById("elem01");
6021
6285
  const isSelected = await mobile.element.isSelected(elem);
6022
6286
  ```
6287
+ <a name="mobile.element.waitToBeEnabled"></a>
6288
+
6289
+ #### element.waitToBeEnabled(selector, [timeout]) ⇒ <code>boolean</code>
6290
+ Waits until the element with the given selector is present.
6291
+
6292
+ **Kind**: static method of [<code>element</code>](#mobile.element)
6293
+ **Returns**: <code>boolean</code> - Returns true or false.
6294
+
6295
+ | Param | Type | Default | Description |
6296
+ | --- | --- | --- | --- |
6297
+ | selector | <code>Object</code> | | The CSS selector describing the element. |
6298
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
6299
+
6300
+ **Example**
6301
+ ```js
6302
+ await mobile.element.waitToBeEnabled(".input01");
6303
+ await mobile.element.waitToBeEnabled("#button12");
6304
+ await mobile.element.waitToBeEnabled("p:first-child");
6305
+ ```
6023
6306
  <a name="mobile.gestures"></a>
6024
6307
 
6025
6308
  ### mobile.gestures
6026
6309
  **Kind**: static class of [<code>mobile</code>](#mobile)
6310
+
6311
+ * [.gestures](#mobile.gestures)
6312
+ * [.swipe(startX, startY, endX, endY, [duration])](#mobile.gestures.swipe) ⇒ <code>Promise.&lt;void&gt;</code>
6313
+ * [.tap(coordX, coordY)](#mobile.gestures.tap) ⇒ <code>Promise.&lt;void&gt;</code>
6314
+
6027
6315
  <a name="mobile.gestures.swipe"></a>
6028
6316
 
6029
- #### gestures.swipe(startX, startY, endX, endY, duration) ⇒ <code>Promise.&lt;void&gt;</code>
6030
- Swipe from one point to another on the screen.
6317
+ #### gestures.swipe(startX, startY, endX, endY, [duration]) ⇒ <code>Promise.&lt;void&gt;</code>
6318
+ Swipe from one point to another on the screen,
6319
+ Ensure that the provided coordinates are within the bounds of the screen to avoid unexpected behavior.
6320
+
6321
+ **Kind**: static method of [<code>gestures</code>](#mobile.gestures)
6322
+
6323
+ | Param | Type | Default | Description |
6324
+ | --- | --- | --- | --- |
6325
+ | startX | <code>number</code> | | The starting X coordinate of the swipe |
6326
+ | startY | <code>number</code> | | The starting Y coordinate of the swipe |
6327
+ | endX | <code>number</code> | | The ending X coordinate of the swipe |
6328
+ | endY | <code>number</code> | | The ending Y coordinate of the swipe |
6329
+ | [duration] | <code>number</code> | <code>1000</code> | The duration of the swipe in milliseconds (optional, default is 1000ms) |
6330
+
6331
+ **Example**
6332
+ ```js
6333
+ // Swipes from left to right across the screen horizontally (useful for image carousels or galleries).
6334
+ await mobile.gestures.swipe(100, 800, 800, 800);
6335
+ // Swipes from bottom to top vertically to scroll down a list.
6336
+ await mobile.gestures.swipe(300, 1000, 300, 400);
6337
+ // Swipes from the top down to refresh content on a mobile app (common for pull-to-refresh).
6338
+ await mobile.gestures.swipe(400, 200, 400, 800);
6339
+ ```
6340
+ <a name="mobile.gestures.tap"></a>
6341
+
6342
+ #### gestures.tap(coordX, coordY) ⇒ <code>Promise.&lt;void&gt;</code>
6343
+ Executes a tap at the given screen coordinates,
6344
+ Ensure that the provided coordinates are within the bounds of the screen to avoid unexpected behavior.
6031
6345
 
6032
6346
  **Kind**: static method of [<code>gestures</code>](#mobile.gestures)
6033
6347
 
6034
6348
  | Param | Type | Description |
6035
6349
  | --- | --- | --- |
6036
- | startX | <code>number</code> | The starting X coordinate of the swipe |
6037
- | startY | <code>number</code> | The starting Y coordinate of the swipe |
6038
- | endX | <code>number</code> | The ending X coordinate of the swipe |
6039
- | endY | <code>number</code> | The ending Y coordinate of the swipe |
6040
- | duration | <code>number</code> | The duration of the swipe in milliseconds (optional, default is 1000ms) |
6350
+ | coordX | <code>number</code> | The horizontal screen coordinate for the tap. |
6351
+ | coordY | <code>number</code> | The vertical screen coordinate for the tap. |
6041
6352
 
6353
+ **Example**
6354
+ ```js
6355
+ await mobile.gestures.tap(100, 800);
6356
+ ```
6042
6357
  <a name="mobile.ios"></a>
6043
6358
 
6044
6359
  ### mobile.ios
@@ -6049,39 +6364,134 @@ Swipe from one point to another on the screen.
6049
6364
  **Kind**: static class of [<code>mobile</code>](#mobile)
6050
6365
 
6051
6366
  * [.userInteraction](#mobile.userInteraction)
6052
- * [.tap(element, [timeout])](#mobile.userInteraction.tap)
6053
- * [.check(element)](#mobile.userInteraction.check)
6367
+ * [.tap(elementOrSelector, [timeout])](#mobile.userInteraction.tap)
6368
+ * [.check(elementOrSelector, [timeout])](#mobile.userInteraction.check)
6369
+ * [.uncheck(elementOrSelector, [timeout])](#mobile.userInteraction.uncheck)
6370
+ * [.doubleTap(elementOrSelector, [timeout])](#mobile.userInteraction.doubleTap) ⇒ <code>Promise.&lt;void&gt;</code>
6371
+ * [.fill(elementOrSelector, value, [timeout])](#mobile.userInteraction.fill) ⇒ <code>Promise.&lt;void&gt;</code>
6372
+ * [.clearAndFill(elementOrSelector, value, [timeout])](#mobile.userInteraction.clearAndFill) ⇒ <code>Promise.&lt;void&gt;</code>
6373
+ * [.clear(elementOrSelector, [timeout])](#mobile.userInteraction.clear) ⇒ <code>Promise.&lt;void&gt;</code>
6054
6374
 
6055
6375
  <a name="mobile.userInteraction.tap"></a>
6056
6376
 
6057
- #### userInteraction.tap(element, [timeout])
6377
+ #### userInteraction.tap(elementOrSelector, [timeout])
6058
6378
  Tap's on the mobile element.
6059
6379
 
6060
6380
  **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6061
6381
 
6062
6382
  | Param | Type | Default | Description |
6063
6383
  | --- | --- | --- | --- |
6064
- | element | <code>Element</code> \| <code>string</code> | | The element or CSS selector describing the element. |
6065
- | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait (ms). |
6384
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6385
+ | [timeout] | <code>Number</code> | <code>30000</code> | The timeout to wait(ms) |
6066
6386
 
6067
6387
  **Example**
6068
6388
  ```js
6069
- const elem = await mobile.userInteraction.tap(elem);
6389
+ await mobile.userInteraction.tap(elem);
6390
+ await mobile.userInteraction.tap(elem, 20000);
6070
6391
  ```
6071
6392
  <a name="mobile.userInteraction.check"></a>
6072
6393
 
6073
- #### userInteraction.check(element)
6394
+ #### userInteraction.check(elementOrSelector, [timeout])
6074
6395
  Checks the given checkbox.
6075
6396
 
6076
6397
  **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6077
6398
 
6078
- | Param | Type | Description |
6079
- | --- | --- | --- |
6080
- | element | <code>Element</code> | The element or CSS selector describing the element. |
6399
+ | Param | Type | Default | Description |
6400
+ | --- | --- | --- | --- |
6401
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6402
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait(ms) |
6403
+
6404
+ **Example**
6405
+ ```js
6406
+ await mobile.userInteraction.check(element);
6407
+ await mobile.userInteraction.check(element, 20000);
6408
+ ```
6409
+ <a name="mobile.userInteraction.uncheck"></a>
6410
+
6411
+ #### userInteraction.uncheck(elementOrSelector, [timeout])
6412
+ Unchecks the given checkbox.
6413
+
6414
+ **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6415
+
6416
+ | Param | Type | Default | Description |
6417
+ | --- | --- | --- | --- |
6418
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6419
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait(ms) |
6420
+
6421
+ **Example**
6422
+ ```js
6423
+ await mobile.userInteraction.uncheck(elementOrSelector);
6424
+ await mobile.userInteraction.uncheck(elementOrSelector, 20000);
6425
+ ```
6426
+ <a name="mobile.userInteraction.doubleTap"></a>
6427
+
6428
+ #### userInteraction.doubleTap(elementOrSelector, [timeout]) ⇒ <code>Promise.&lt;void&gt;</code>
6429
+ Double Tap's on the mobile element.
6430
+
6431
+ **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6432
+
6433
+ | Param | Type | Default | Description |
6434
+ | --- | --- | --- | --- |
6435
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6436
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait(ms) |
6437
+
6438
+ **Example**
6439
+ ```js
6440
+ await mobile.userInteraction.doubleTap(elem);
6441
+ await mobile.userInteraction.doubleTap(elem, 2000);
6442
+ ```
6443
+ <a name="mobile.userInteraction.fill"></a>
6444
+
6445
+ #### userInteraction.fill(elementOrSelector, value, [timeout]) ⇒ <code>Promise.&lt;void&gt;</code>
6446
+ Enter a string value into a mobile input field.
6447
+
6448
+ **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6449
+
6450
+ | Param | Type | Default | Description |
6451
+ | --- | --- | --- | --- |
6452
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6453
+ | value | <code>string</code> | | The string value to be entered. |
6454
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
6455
+
6456
+ **Example**
6457
+ ```js
6458
+ await mobile.userInteraction.fill(element);
6459
+ await mobile.userInteraction.fill(element, 2000);
6460
+ ```
6461
+ <a name="mobile.userInteraction.clearAndFill"></a>
6462
+
6463
+ #### userInteraction.clearAndFill(elementOrSelector, value, [timeout]) ⇒ <code>Promise.&lt;void&gt;</code>
6464
+ Enter a string into the mobile input field; it will clear the box before submission.
6465
+
6466
+ **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6467
+
6468
+ | Param | Type | Default | Description |
6469
+ | --- | --- | --- | --- |
6470
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6471
+ | value | <code>string</code> | | The string value to be entered. |
6472
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
6473
+
6474
+ **Example**
6475
+ ```js
6476
+ await mobile.userInteraction.clearAndFill(element);
6477
+ await mobile.userInteraction.clearAndFill(element, 2000);
6478
+ ```
6479
+ <a name="mobile.userInteraction.clear"></a>
6480
+
6481
+ #### userInteraction.clear(elementOrSelector, [timeout]) ⇒ <code>Promise.&lt;void&gt;</code>
6482
+ Clear a string value into a mobile input field.
6483
+
6484
+ **Kind**: static method of [<code>userInteraction</code>](#mobile.userInteraction)
6485
+
6486
+ | Param | Type | Default | Description |
6487
+ | --- | --- | --- | --- |
6488
+ | elementOrSelector | <code>Element</code> \| <code>string</code> | | The element (e.g., accessibility ID, XPath) selectors describing the element. |
6489
+ | [timeout] | <code>number</code> | <code>30000</code> | The timeout to wait (ms). |
6081
6490
 
6082
6491
  **Example**
6083
6492
  ```js
6084
- await mobile.userInteraction.check(selector);
6493
+ await mobile.userInteraction.clear(element);
6494
+ await mobile.userInteraction.clear(element, 2000);
6085
6495
  ```
6086
6496
  <a name="flp"></a>
6087
6497