oxygen-cli 1.27.2 → 1.27.4

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 (205) hide show
  1. package/build/ox_modules/module-mob/commands/alertAccept.js +8 -3
  2. package/build/ox_modules/module-mob/commands/alertDismiss.js +8 -3
  3. package/build/ox_modules/module-mob/commands/assertAlert.js +8 -3
  4. package/build/ox_modules/module-mob/commands/assertText.js +8 -3
  5. package/build/ox_modules/module-mob/commands/assertTitle.js +8 -3
  6. package/build/ox_modules/module-mob/commands/assertValue.js +8 -3
  7. package/build/ox_modules/module-mob/commands/back.js +8 -3
  8. package/build/ox_modules/module-mob/commands/clear.js +8 -3
  9. package/build/ox_modules/module-mob/commands/click.js +8 -3
  10. package/build/ox_modules/module-mob/commands/clickHidden.js +8 -3
  11. package/build/ox_modules/module-mob/commands/clickLong.js +8 -3
  12. package/build/ox_modules/module-mob/commands/clickMultipleTimes.js +8 -3
  13. package/build/ox_modules/module-mob/commands/closeApp.js +8 -3
  14. package/build/ox_modules/module-mob/commands/debug.js +8 -3
  15. package/build/ox_modules/module-mob/commands/dragAndDrop.js +8 -3
  16. package/build/ox_modules/module-mob/commands/enableNetwork.js +8 -3
  17. package/build/ox_modules/module-mob/commands/execute.js +8 -3
  18. package/build/ox_modules/module-mob/commands/findElement.js +8 -3
  19. package/build/ox_modules/module-mob/commands/findElements.js +8 -3
  20. package/build/ox_modules/module-mob/commands/getAlertText.js +8 -3
  21. package/build/ox_modules/module-mob/commands/getAppiumLogs.js +8 -3
  22. package/build/ox_modules/module-mob/commands/getBrowserLogs.js +8 -3
  23. package/build/ox_modules/module-mob/commands/getCurrentActivity.js +8 -3
  24. package/build/ox_modules/module-mob/commands/getCurrentPackage.js +8 -3
  25. package/build/ox_modules/module-mob/commands/getDeviceLogs.js +8 -3
  26. package/build/ox_modules/module-mob/commands/getDeviceTime.js +8 -3
  27. package/build/ox_modules/module-mob/commands/getLocation.js +8 -3
  28. package/build/ox_modules/module-mob/commands/getSource.js +8 -3
  29. package/build/ox_modules/module-mob/commands/getText.js +8 -3
  30. package/build/ox_modules/module-mob/commands/getTitle.js +8 -3
  31. package/build/ox_modules/module-mob/commands/getUrl.js +8 -3
  32. package/build/ox_modules/module-mob/commands/getValue.js +8 -3
  33. package/build/ox_modules/module-mob/commands/getWindowHandles.js +8 -3
  34. package/build/ox_modules/module-mob/commands/hideKeyboard.js +8 -3
  35. package/build/ox_modules/module-mob/commands/index.js +949 -586
  36. package/build/ox_modules/module-mob/commands/installApp.js +8 -3
  37. package/build/ox_modules/module-mob/commands/isAppInstalled.js +8 -3
  38. package/build/ox_modules/module-mob/commands/isCheckable.js +8 -3
  39. package/build/ox_modules/module-mob/commands/isChecked.js +8 -3
  40. package/build/ox_modules/module-mob/commands/isClickable.js +8 -3
  41. package/build/ox_modules/module-mob/commands/isExist.js +8 -3
  42. package/build/ox_modules/module-mob/commands/isSelected.js +8 -3
  43. package/build/ox_modules/module-mob/commands/isVisible.js +8 -3
  44. package/build/ox_modules/module-mob/commands/isWebViewContext.js +8 -3
  45. package/build/ox_modules/module-mob/commands/launchApp.js +8 -3
  46. package/build/ox_modules/module-mob/commands/longPressKeyCode.js +8 -3
  47. package/build/ox_modules/module-mob/commands/open.js +8 -3
  48. package/build/ox_modules/module-mob/commands/pause.js +8 -3
  49. package/build/ox_modules/module-mob/commands/removeApp.js +8 -3
  50. package/build/ox_modules/module-mob/commands/resetApp.js +8 -3
  51. package/build/ox_modules/module-mob/commands/scrollIntoElement.js +8 -3
  52. package/build/ox_modules/module-mob/commands/scrollIntoView.js +8 -3
  53. package/build/ox_modules/module-mob/commands/select.js +8 -3
  54. package/build/ox_modules/module-mob/commands/selectFrame.js +8 -3
  55. package/build/ox_modules/module-mob/commands/selectWindow.js +8 -3
  56. package/build/ox_modules/module-mob/commands/sendKeys.js +8 -3
  57. package/build/ox_modules/module-mob/commands/setContext.js +8 -3
  58. package/build/ox_modules/module-mob/commands/setNativeContext.js +8 -3
  59. package/build/ox_modules/module-mob/commands/setTimeout.js +8 -3
  60. package/build/ox_modules/module-mob/commands/setWebViewContext.js +8 -3
  61. package/build/ox_modules/module-mob/commands/shake.js +8 -3
  62. package/build/ox_modules/module-mob/commands/smsClickLink.js +8 -3
  63. package/build/ox_modules/module-mob/commands/smsGetText.js +8 -3
  64. package/build/ox_modules/module-mob/commands/swipe.js +8 -3
  65. package/build/ox_modules/module-mob/commands/swipeElement.js +8 -3
  66. package/build/ox_modules/module-mob/commands/swipeScreen.js +12 -7
  67. package/build/ox_modules/module-mob/commands/takeScreenshot.js +8 -3
  68. package/build/ox_modules/module-mob/commands/tap.js +8 -3
  69. package/build/ox_modules/module-mob/commands/type.js +8 -3
  70. package/build/ox_modules/module-mob/commands/unlockPattern.js +8 -3
  71. package/build/ox_modules/module-mob/commands/waitForExist.js +8 -3
  72. package/build/ox_modules/module-mob/commands/waitForInteractable.js +8 -3
  73. package/build/ox_modules/module-mob/commands/waitForVisible.js +8 -3
  74. package/build/ox_modules/module-web/commands/alertAccept.js +8 -3
  75. package/build/ox_modules/module-web/commands/alertDismiss.js +8 -3
  76. package/build/ox_modules/module-web/commands/assertAlert.js +8 -3
  77. package/build/ox_modules/module-web/commands/assertExist.js +8 -3
  78. package/build/ox_modules/module-web/commands/assertSelectedLabel.js +8 -3
  79. package/build/ox_modules/module-web/commands/assertSelectedValue.js +8 -3
  80. package/build/ox_modules/module-web/commands/assertText.js +8 -3
  81. package/build/ox_modules/module-web/commands/assertTextNotPresent.js +8 -3
  82. package/build/ox_modules/module-web/commands/assertTextPresent.js +8 -3
  83. package/build/ox_modules/module-web/commands/assertTitle.js +8 -3
  84. package/build/ox_modules/module-web/commands/assertValue.js +8 -3
  85. package/build/ox_modules/module-web/commands/back.js +8 -3
  86. package/build/ox_modules/module-web/commands/clear.js +8 -3
  87. package/build/ox_modules/module-web/commands/click.js +8 -3
  88. package/build/ox_modules/module-web/commands/clickHidden.js +8 -3
  89. package/build/ox_modules/module-web/commands/closeWindow.js +8 -3
  90. package/build/ox_modules/module-web/commands/debug.js +8 -3
  91. package/build/ox_modules/module-web/commands/deleteCookies.js +8 -3
  92. package/build/ox_modules/module-web/commands/deselect.js +8 -3
  93. package/build/ox_modules/module-web/commands/doubleClick.js +8 -3
  94. package/build/ox_modules/module-web/commands/dragAndDrop.js +8 -3
  95. package/build/ox_modules/module-web/commands/execute.js +8 -3
  96. package/build/ox_modules/module-web/commands/fileBrowse.js +8 -3
  97. package/build/ox_modules/module-web/commands/findElement.js +8 -3
  98. package/build/ox_modules/module-web/commands/findElements.js +8 -3
  99. package/build/ox_modules/module-web/commands/fullscreenWindow.js +8 -3
  100. package/build/ox_modules/module-web/commands/getAlertText.js +8 -3
  101. package/build/ox_modules/module-web/commands/getAttribute.js +8 -3
  102. package/build/ox_modules/module-web/commands/getBrowserLogs.js +8 -3
  103. package/build/ox_modules/module-web/commands/getCookies.js +8 -3
  104. package/build/ox_modules/module-web/commands/getCssValue.js +8 -3
  105. package/build/ox_modules/module-web/commands/getElementCount.js +8 -3
  106. package/build/ox_modules/module-web/commands/getHTML.js +8 -3
  107. package/build/ox_modules/module-web/commands/getSource.js +8 -3
  108. package/build/ox_modules/module-web/commands/getText.js +8 -3
  109. package/build/ox_modules/module-web/commands/getTitle.js +8 -3
  110. package/build/ox_modules/module-web/commands/getUrl.js +8 -3
  111. package/build/ox_modules/module-web/commands/getValue.js +8 -3
  112. package/build/ox_modules/module-web/commands/getWindowHandles.js +8 -3
  113. package/build/ox_modules/module-web/commands/getWindowSize.js +8 -3
  114. package/build/ox_modules/module-web/commands/getXMLPageSource.js +8 -3
  115. package/build/ox_modules/module-web/commands/index.js +1027 -634
  116. package/build/ox_modules/module-web/commands/isAlertPresent.js +8 -3
  117. package/build/ox_modules/module-web/commands/isChecked.js +8 -3
  118. package/build/ox_modules/module-web/commands/isExist.js +8 -3
  119. package/build/ox_modules/module-web/commands/isInteractable.js +8 -3
  120. package/build/ox_modules/module-web/commands/isSelected.js +8 -3
  121. package/build/ox_modules/module-web/commands/isVisible.js +8 -3
  122. package/build/ox_modules/module-web/commands/makeVisible.js +8 -3
  123. package/build/ox_modules/module-web/commands/maximizeWindow.js +8 -3
  124. package/build/ox_modules/module-web/commands/minimizeWindow.js +8 -3
  125. package/build/ox_modules/module-web/commands/newWindow.js +8 -3
  126. package/build/ox_modules/module-web/commands/open.js +8 -3
  127. package/build/ox_modules/module-web/commands/pause.js +8 -3
  128. package/build/ox_modules/module-web/commands/point.js +8 -3
  129. package/build/ox_modules/module-web/commands/pointJS.js +8 -3
  130. package/build/ox_modules/module-web/commands/refresh.js +8 -3
  131. package/build/ox_modules/module-web/commands/rightClick.js +8 -3
  132. package/build/ox_modules/module-web/commands/rightClickActions.js +8 -3
  133. package/build/ox_modules/module-web/commands/scrollToElement.js +8 -3
  134. package/build/ox_modules/module-web/commands/select.js +8 -3
  135. package/build/ox_modules/module-web/commands/selectFrame.js +8 -3
  136. package/build/ox_modules/module-web/commands/selectWindow.js +8 -3
  137. package/build/ox_modules/module-web/commands/sendKeys.js +8 -3
  138. package/build/ox_modules/module-web/commands/setAutoWaitForAngular.js +8 -3
  139. package/build/ox_modules/module-web/commands/setTimeout.js +8 -3
  140. package/build/ox_modules/module-web/commands/setWindowSize.js +8 -3
  141. package/build/ox_modules/module-web/commands/takeScreenshot.js +8 -3
  142. package/build/ox_modules/module-web/commands/type.js +8 -3
  143. package/build/ox_modules/module-web/commands/waitForAngular.js +8 -3
  144. package/build/ox_modules/module-web/commands/waitForExist.js +8 -3
  145. package/build/ox_modules/module-web/commands/waitForInteractable.js +8 -3
  146. package/build/ox_modules/module-web/commands/waitForNotExist.js +8 -3
  147. package/build/ox_modules/module-web/commands/waitForNotText.js +8 -3
  148. package/build/ox_modules/module-web/commands/waitForNotValue.js +8 -3
  149. package/build/ox_modules/module-web/commands/waitForText.js +8 -3
  150. package/build/ox_modules/module-web/commands/waitForValue.js +8 -3
  151. package/build/ox_modules/module-web/commands/waitForVisible.js +8 -3
  152. package/build/ox_modules/module-web/commands/waitForWindow.js +8 -3
  153. package/build/ox_modules/module-win/commands/assertText.js +8 -3
  154. package/build/ox_modules/module-win/commands/assertTitle.js +8 -3
  155. package/build/ox_modules/module-win/commands/assertValue.js +8 -3
  156. package/build/ox_modules/module-win/commands/back.js +8 -3
  157. package/build/ox_modules/module-win/commands/clear.js +8 -3
  158. package/build/ox_modules/module-win/commands/click.js +8 -3
  159. package/build/ox_modules/module-win/commands/clickLong.js +8 -3
  160. package/build/ox_modules/module-win/commands/clickMultipleTimes.js +8 -3
  161. package/build/ox_modules/module-win/commands/findElement.js +8 -3
  162. package/build/ox_modules/module-win/commands/findElements.js +8 -3
  163. package/build/ox_modules/module-win/commands/getAppiumLogs.js +8 -3
  164. package/build/ox_modules/module-win/commands/getCurrentWindowHandle.js +8 -3
  165. package/build/ox_modules/module-win/commands/getLocation.js +8 -3
  166. package/build/ox_modules/module-win/commands/getSource.js +8 -3
  167. package/build/ox_modules/module-win/commands/getText.js +8 -3
  168. package/build/ox_modules/module-win/commands/getValue.js +8 -3
  169. package/build/ox_modules/module-win/commands/getWindowHandles.js +8 -3
  170. package/build/ox_modules/module-win/commands/index.js +468 -290
  171. package/build/ox_modules/module-win/commands/isCheckable.js +8 -3
  172. package/build/ox_modules/module-win/commands/isChecked.js +8 -3
  173. package/build/ox_modules/module-win/commands/isClickable.js +8 -3
  174. package/build/ox_modules/module-win/commands/isExist.js +8 -3
  175. package/build/ox_modules/module-win/commands/isSelected.js +8 -3
  176. package/build/ox_modules/module-win/commands/isVisible.js +8 -3
  177. package/build/ox_modules/module-win/commands/open.js +8 -3
  178. package/build/ox_modules/module-win/commands/pause.js +8 -3
  179. package/build/ox_modules/module-win/commands/rightClick.js +8 -3
  180. package/build/ox_modules/module-win/commands/selectWindow.js +8 -3
  181. package/build/ox_modules/module-win/commands/sendKeys.js +8 -3
  182. package/build/ox_modules/module-win/commands/setTimeout.js +8 -3
  183. package/build/ox_modules/module-win/commands/takeScreenshot.js +8 -3
  184. package/build/ox_modules/module-win/commands/tap.js +8 -3
  185. package/build/ox_modules/module-win/commands/type.js +8 -3
  186. package/build/ox_modules/module-win/commands/waitForExist.js +8 -3
  187. package/build/ox_modules/module-win/commands/waitForInteractable.js +8 -3
  188. package/build/ox_modules/module-win/commands/waitForVisible.js +8 -3
  189. package/build/runners/WorkerProcess.js +40 -13
  190. package/build/runners/oxygen/OxygenWorker.js +7 -3
  191. package/build/runners/oxygen/index.js +80 -80
  192. package/build/runners/oxygen/worker.js +4 -1
  193. package/package.json +11 -2
  194. package/types/index.d.ts +71 -0
  195. package/types/module-eyes.d.ts +39 -0
  196. package/types/module-http.d.ts +163 -0
  197. package/types/module-log.d.ts +35 -0
  198. package/types/module-mob.d.ts +967 -0
  199. package/types/module-pdf.d.ts +41 -0
  200. package/types/module-proxy.d.ts +100 -0
  201. package/types/module-shell.d.ts +24 -0
  202. package/types/module-utils.d.ts +99 -0
  203. package/types/module-web.d.ts +1050 -0
  204. package/types/module-win.d.ts +352 -0
  205. package/types/oxygen.d.ts +53 -0
@@ -0,0 +1,967 @@
1
+ declare namespace Oxygen {
2
+ interface ModuleMob {
3
+ /**
4
+ * @function init
5
+ * @summary Initializes a new Appium session.
6
+ * @param {Object=} caps - Desired capabilities. If not specified capabilities will be taken from suite definition.
7
+ * @param {String=} appiumUrl - Remote Appium server URL (default: http://localhost:4723/wd/hub).
8
+ */
9
+ init(caps?: Map<string, any>, appiumUrl?: string): void;
10
+
11
+ /**
12
+ * @function getDriver
13
+ * @summary Returns the underlying WDIO driver.
14
+ * @return {Object} WDIO driver.
15
+ */
16
+ getDriver(): any;
17
+
18
+ /**
19
+ * @function getCapabilities
20
+ * @summary Returns currently defined capabilities.
21
+ * @return {Object} Current capabilities object.
22
+ */
23
+ getCapabilities(): Map<string, any>;
24
+
25
+ /**
26
+ * @summary Accepts an alert or a confirmation dialog.
27
+ * @description In case of an alert box this command is identical to `alertDismiss`.
28
+ * @function alertAccept
29
+ * @for android, ios, hybrid, web
30
+ * @example <caption>[javascript] Usage example</caption>
31
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
32
+ * mob.click("id=Submit");// Clicks an element and opens an alert.
33
+ * mob.alertAccept();//Automatically press on 'OK' button in the alert pop-up.
34
+ */
35
+ alertAccept(): void;
36
+
37
+ /**
38
+ * @summary Dismisses an alert or a confirmation dialog.
39
+ * @description In case of an alert box this command is identical to `alertAccept`.
40
+ * @function alertDismiss
41
+ * @for android, ios, hybrid, web
42
+ * @example <caption>[javascript] Usage example</caption>
43
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
44
+ * mob.click("id=Submit");// Clicks an element and opens an alert.
45
+ * mob.alertDismiss();//Automatically press on 'Cancel' button in the alert pop-up.
46
+ */
47
+ alertDismiss(): void;
48
+
49
+ /**
50
+ * @summary Asserts whether alert matches the specified pattern and dismisses it.
51
+ * @description Text pattern can be any of the supported
52
+ * string matching patterns(on the top of page).
53
+ * @function assertAlert
54
+ * @for web
55
+ * @param {String} pattern - Text pattern.
56
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
57
+ * @example <caption>[javascript] Usage example</caption>
58
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
59
+ * mob.click("id=Submit");// Clicks an element and opens an alert.
60
+ * mob.assertAlert("Your Alert's text");//Asserts the alert's text.
61
+ */
62
+ assertAlert(pattern: string, timeout?: number | undefined): void;
63
+
64
+ /**
65
+ * @summary Asserts element's inner text.
66
+ * @description Text pattern can be any of the supported
67
+ * string matching patterns (on the top of page).
68
+ * If the element is not interactable, then it will allways return empty string as its text.
69
+ * @function assertText
70
+ * @param {String|Element} locator - Element locator.
71
+ * @param {String} pattern - Assertion text or pattern.
72
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
73
+ * @for android, ios, hybrid, web
74
+ * @example <caption>[javascript] Usage example</caption>
75
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
76
+ * mob.assertText("id=UserName","John Doe");// Asserts if an element’s text is as expected.
77
+ */
78
+ assertText(locator: string | Element, pattern: string, timeout?: number | undefined): void;
79
+
80
+ /**
81
+ * @summary Asserts the page title.
82
+ * @description Assertion pattern can be any of the supported
83
+ * string matching patterns(on the top of page).
84
+ * @function assertTitle
85
+ * @param {String} pattern - Assertion text or pattern.
86
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
87
+ * @for hybrid, web
88
+ * @example <caption>[javascript] Usage example</caption>
89
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
90
+ * mob.assertTitle("Your websites title!");// Asserts if the title of the page.
91
+ */
92
+ assertTitle(pattern: string, timeout?: number | undefined): void;
93
+
94
+ /**
95
+ * @summary Asserts element's value.
96
+ * @function assertValue
97
+ * @param {String|Element} locator - Element locator.
98
+ * @param {String} pattern - Value pattern.
99
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
100
+ * @for android, ios, hybrid, web
101
+ * @example <caption>[javascript] Usage example</caption>
102
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
103
+ * mob.assertValue("id=UserName", "John Doe");// Asserts if the value of an element.
104
+ */
105
+ assertValue(locator: string | Element, pattern: string, timeout?: number | undefined): void;
106
+
107
+ /**
108
+ * @summary Navigate backwards in the browser history or simulates back button on Android device.
109
+ * @function back
110
+ * @for android, hybrid, web
111
+ * @example <caption>[javascript] Usage example</caption>
112
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
113
+ * mob.click("id=NextPage);// Clicks an element and opens an alert.
114
+ * mob.back();//Navigate back to previous page.
115
+ */
116
+ back(): void;
117
+
118
+ /**
119
+ * @summary Clears element's value or content
120
+ * @function clear
121
+ * @param {String|Element} locator - Element locator.
122
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
123
+ * @for android, ios, hybrid, web
124
+ * @example <caption>[javascript] Usage example</caption>
125
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
126
+ * mob.type("id=Password", "Password");//Types a password to a field.
127
+ * mob.clear("id=Password");//Clears the characters from the field of an element.
128
+
129
+ */
130
+ clear(locator: string | Element, timeout?: number | undefined): void;
131
+
132
+ /**
133
+ * @summary Clicks on an element.
134
+ * @function click
135
+ * @param {String|Element} locator - Element locator.
136
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
137
+ * @for android, ios, hybrid, web
138
+ * @example <caption>[javascript] Usage example</caption>
139
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
140
+ * mob.click("id=Submit");// Clicks an element.
141
+ */
142
+ click(locator: string | Element, timeout?: number | undefined): void;
143
+
144
+ /**
145
+ * @summary Clicks on a non-visible element.
146
+ * @function clickHidden
147
+ * @param {String|Element} locator - Element locator.
148
+ * @param {Boolean=} clickParent - If true, then parent of the element is clicked.
149
+ * @for hybrid, web
150
+ * @example <caption>[javascript] Usage example</caption>
151
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
152
+ * mob.clickHidden("id=hiddenContent);// Clicks an hidden element.
153
+ */
154
+ clickHidden(locator: string | Element, clickParent?: boolean | undefined): void;
155
+
156
+ /**
157
+ * @summary Performs a long click/touch on an element.
158
+ * @function clickLong
159
+ * @param {String|Element} locator - Element locator.
160
+ * @param {Number} duration - Touch duration in milliseconds.
161
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
162
+ * @for android, ios, hybrid, web
163
+ * @example <caption>[javascript] Usage example</caption>
164
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
165
+ * mob.clickLong("id=Mark",6000);// Clicks an element for a certain duration.
166
+ */
167
+ clickLong(locator: string | Element, duration: number, timeout?: number | undefined): void;
168
+
169
+ /**
170
+ * @summary Performs tap on an element multiple times in quick succession.
171
+ * @function clickMultipleTimes
172
+ * @param {String|Element} locator - Element locator.
173
+ * @param {Number} taps - Number of taps.
174
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
175
+ * @for android, ios, hybrid, web
176
+ * @example <caption>[javascript] Usage example</caption>
177
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
178
+ * mob.clickMultipleTimes("id=Mark",4);// Clicks an element certain amount of times.
179
+ */
180
+ clickMultipleTimes(locator: string | Element, taps: number, timeout?: number | undefined): void;
181
+
182
+ /**
183
+ * @summary Closes the currently open app.
184
+ * @function closeApp
185
+ * @for android, ios
186
+ * @example <caption>[javascript] Usage example</caption>
187
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
188
+ * mob.launchApp(); // Launch the app.
189
+ * mob.closeApp(); // Close the app.
190
+ */
191
+ closeApp(): void;
192
+
193
+ /**
194
+ * @summary Stop test execution and allow interactive command execution (REPL).
195
+ * @function debug
196
+ * @for android, ios, hybrid, web
197
+ * @example <caption>[javascript] Usage example</caption>
198
+ * mob.init();
199
+ * mob.open("www.yourwebsite.com");
200
+ * mob.debug();
201
+ */
202
+ debug(): void;
203
+
204
+ /**
205
+ * @summary Tap on an element, drag by the specified offset, and release.
206
+ * @function dragAndDrop
207
+ * @param {String|Element} locator - Element locator on which to perform the initial tap.
208
+ * @param {Number} xoffset - Horizontal offset. Positive for right direction; Negative for left.
209
+ * @param {Number} yoffset - Vertical offset. Positive for down direction; Negative for up.
210
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
211
+ * @for android, ios
212
+ * @example <caption>[javascript] Usage example</caption>
213
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
214
+ * mob.dragAndDrop("id=Mark",-80,100);// Tap on an element, drag by the specified offset, and release.
215
+ */
216
+ dragAndDrop(locator: string | Element, xoffset: number, yoffset: number, timeout?: number | undefined): void;
217
+
218
+ /**
219
+ * @summary Enable or disable wifi or data.
220
+ * @function enableNetwork
221
+ * @param {Boolean} wifi - Enable (true) or disable (false) wifi.
222
+ * @param {Boolean} data - Enable (true) or disable (false) data.
223
+ * @for android
224
+ * @example <caption>[javascript] Usage example</caption>
225
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
226
+ * mob.enableNetwork(true,false);//Enable wifi and disable data.
227
+ */
228
+ enableNetwork(wifi: boolean, data: boolean): void;
229
+
230
+ /**
231
+ * @summary Executes JavaScript in the context of the currently selected frame or window.
232
+ * @description If return value is null or there is no return value, `null` is returned.
233
+ * @function execute
234
+ * @param {String|Function} script - The JavaScript to execute.
235
+ * @param {...Object} arg - Optional arguments to be passed to the JavaScript function.
236
+ * @return {Object} The return value.
237
+ * @for hybrid, web
238
+ * @example <caption>[javascript] Usage example</caption>
239
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
240
+ * mob.execute(function(){
241
+ * angular.element("#closeBtn").trigger('ng-click').click()
242
+ * });//Executes / injects a javascript functions.
243
+ */
244
+ execute(...args: any[]): any;
245
+
246
+ /**
247
+ * @summary Finds an element.
248
+ * @function findElement
249
+ * @param {String} locator - Element locator.
250
+ * @param {Element=} parent - Optional parent element for relative search.
251
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
252
+ * @return {Element} - A Element object.
253
+ * @for android, ios, hybrid, web
254
+ * @example <caption>[javascript] Usage example</caption>
255
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
256
+ * var el = mob.findElement("id=Password");
257
+ * mob.click(el);
258
+ */
259
+ findElement(locator: string, parent?: Element | undefined, timeout?: number | undefined): any;
260
+
261
+ /**
262
+ * @summary Finds elements.
263
+ * @function findElements
264
+ * @param {String} locator - Element locator.
265
+ * @param {Element=} parent - Optional parent element for relative search.
266
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
267
+ * @return {Element[]} - Collection of Element objects.
268
+ * @for android, ios, hybrid, web
269
+ * @example <caption>[javascript] Usage example</caption>
270
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
271
+ * var els = mob.findElements("//div");
272
+ * for (let el of els) {
273
+ * var text = mob.getText(el);
274
+ * log.info(text);
275
+ * }
276
+ */
277
+ findElements(locator: string, parent?: Element | undefined, timeout?: number | undefined): any[];
278
+
279
+ /**
280
+ * @summary Gets the text displayed by an alert or confirm dialog.
281
+ * @function getAlertText
282
+ * @return {String} - Alert's text.
283
+ * @for android, ios, hybrid, web
284
+ * @example <caption>[javascript] Usage example</caption>
285
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
286
+ * mob.click("id=Submit");// Clicks an element and opens an alert.
287
+ * var a = mob.getAlertText();//Gets alert text.
288
+ */
289
+ getAlertText(): string;
290
+
291
+ /**
292
+ * @function getAppiumLogs
293
+ * @summary Collects logs from the Appium server.
294
+ * @return {Object[]} A list of logs.
295
+ * @for android, ios, hybrid, web
296
+ * @example <caption>[javascript] Usage example</caption>
297
+ * mob.init(caps); //Starts a mobile session and opens app from desired capabilities
298
+ * mob.getAppiumLogs(); //Collects logs from the Appium server
299
+ */
300
+ getAppiumLogs(): any[];
301
+
302
+ /**
303
+ * @function getBrowserLogs
304
+ * @summary Collects browser logs from the mobile device.
305
+ * @return {Object[]} A list of logs.
306
+ * @for android, ios, hybrid, web
307
+ * @example <caption>[javascript] Usage example</caption>
308
+ * mob.init(caps); //Starts a mobile session and opens app from desired capabilities
309
+ * mob.getBrowserLogs(); //Collects logs from the browser console
310
+ */
311
+ getBrowserLogs(): any[];
312
+
313
+ /**
314
+ * @summary Gets current Android app's activity name.
315
+ * @function getCurrentActivity
316
+ * @for android
317
+ * @example <caption>[javascript] Usage example</caption>
318
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
319
+ * let activity = mob.getCurrentActivity(); // Gets current Android activity.
320
+ */
321
+ getCurrentActivity(): string;
322
+
323
+ /**
324
+ * @summary Gets current Android app's package name.
325
+ * @function getCurrentPackage
326
+ * @for android
327
+ * @example <caption>[javascript] Usage example</caption>
328
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
329
+ * let package = mob.getCurrentPackage(); // Gets current Android package.
330
+ */
331
+ getCurrentPackage(): string;
332
+
333
+ /**
334
+ * @function getDeviceLogs
335
+ * @summary Collects logs from the mobile device.
336
+ * @return {Object[]} A list of logs.
337
+ * @for android, ios, hybrid, web
338
+ * @example <caption>[javascript] Usage example</caption>
339
+ * mob.init(caps); //Starts a mobile session and opens app from desired capabilities
340
+ * mob.getDeviceLogs(); //Collects logs from the mobile device
341
+ */
342
+ getDeviceLogs(): any[];
343
+
344
+ /**
345
+ * @function getDeviceTime
346
+ * @summary Gets the time on the device.
347
+ * @return {String} Time.
348
+ * @for android, ios
349
+ * @example <caption>[javascript] Usage example</caption>
350
+ * mob.init(caps); //Starts a mobile session and opens app from desired capabilities
351
+ * mob.getDeviceTime(); //Gets the device time
352
+ */
353
+ getDeviceTime(): string;
354
+
355
+ /**
356
+ * @summary Get element's location.
357
+ * @function getLocation
358
+ * @param {String|Element} locator - Element locator.
359
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
360
+ * @return {Object} - X and Y location of the element relative to top-left page corner.
361
+ * @for android, ios, hybrid, web
362
+ * @example <caption>[javascript] Usage example</caption>
363
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
364
+ * var loc = mob.getLocation("id=element");//Get element's location.
365
+ * var x = loc.x;
366
+ * var y = loc.y;
367
+ */
368
+ getLocation(locator: string | Element, timeout?: number | undefined): any;
369
+
370
+ /**
371
+ * @function getSource
372
+ * @summary Gets the source code of the page.
373
+ * @return {String} - HTML in case of web or hybrid application or XML in case of native.
374
+ * @for android, ios, hybrid, web
375
+ * @example <caption>[javascript] Usage example</caption>
376
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
377
+ * var a = mob.getSource();//Gets the source code of the page.
378
+ */
379
+ getSource(): string;
380
+
381
+ /**
382
+ * @summary Returns the text (rendered text shown to the user; whitespace-trimmed) of an element.
383
+ * @function getText
384
+ * @param {String|Element} locator - Element locator.
385
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
386
+ * @return {String} - Element's text.
387
+ * @for android, ios, hybrid, web
388
+ * @example <caption>[javascript] Usage example</caption>
389
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
390
+ * var a = mob.getText("id=TextArea");//Gets the text from an element.
391
+ */
392
+ getText(locator: string | Element, timeout?: number | undefined): string;
393
+
394
+ /**
395
+ * @summary Returns the title of the currently active window.
396
+ * @function getTitle
397
+ * @for web
398
+ * @return {String} The page title.
399
+ */
400
+ getTitle(locator: any): string;
401
+
402
+ /**
403
+ * @summary Gets the URL of the currently active window.
404
+ * @function getUrl
405
+ * @for web
406
+ * @return {String} The page URL.
407
+ * @example <caption>[javascript] Usage example</caption>
408
+ * mob.init();//Opens browser session.
409
+ * mob.open("www.yourwebsite.com");// Opens a website.
410
+ * mob.getUrl();//Gets the url from the current page.
411
+ */
412
+ getUrl(): string;
413
+
414
+ /**
415
+ * @summary Gets element's value (whitespace-trimmed).
416
+ * @function getValue
417
+ * @param {String|Element} locator - Element locator.
418
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
419
+ * @return {String} - Element's value.
420
+ * @for android, ios, hybrid, web
421
+ * @example <caption>[javascript] Usage example</caption>
422
+ * mob.init(caps);
423
+ * var a = mob.getValue("id=ValueArea");//Gets the value from an element.
424
+ */
425
+ getValue(locator: string | Element, timeout?: number | undefined): string;
426
+
427
+ /**
428
+ * @summary Gets handles of currently open windows.
429
+ * @function getWindowHandles
430
+ * @return {String[]} Array of all available window handles.
431
+ * @for web
432
+ * @example <caption>[javascript] Usage example</caption>
433
+ * mob.init();// Starts a mobile session.
434
+ * mob.open("www.yourwebsite.com");// Opens a website.
435
+ * mob.getWindowHandles();//Gets the window handles of currently open windows.
436
+ */
437
+ getWindowHandles(): string[];
438
+
439
+ /**
440
+ * @summary Hides device keyboard.
441
+ * @function hideKeyboard
442
+ * @param {String=} strategy - Strategy to use for closing the keyboard - 'press', 'pressKey',
443
+ * 'swipeDown', 'tapOut', 'tapOutside', 'default'.
444
+ * @param {String=} key - Key value if strategy is 'pressKey'.
445
+ * @param {String=} keyCode - Key code if strategy is 'pressKey'.
446
+ * @param {String=} keyName - Key name if strategy is 'pressKey'.
447
+ * @for android, hybrid, web
448
+ * @example <caption>[javascript] Usage example</caption>
449
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
450
+ * mob.type("id=Password", "Password");//Types a password to a field.
451
+ * mob.hideKeyboard("pressKey", "Done");//Hides device keyboard.
452
+ */
453
+ hideKeyboard(strategy?: string | undefined, key?: string | undefined, keyCode?: string | undefined, keyName?: string | undefined): void;
454
+
455
+ /**
456
+ * @summary Install an app on the remote device.
457
+ * @function installApp
458
+ * @param {String} appLocalPath - The local file path to APK or IPA file.
459
+ * @for android, ios
460
+ * @example <caption>[javascript] Usage example</caption>
461
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
462
+ * mob.installApp('/mylocalappfile.apk'); // Install the app.
463
+ */
464
+ installApp(appLocalPath: string): void;
465
+
466
+ /**
467
+ * @summary Determines if an app is installed on the device.
468
+ * @function isAppInstalled
469
+ * @param {String} app - App's ID.
470
+ * @for android, ios
471
+ * @example <caption>[javascript] Usage example</caption>
472
+ * mob.init(caps); //Starts a mobile session and opens app from desired capabilities
473
+ * let installed = mob.isAppInstalled('com.android.calculator2'); // Determines if calculator app is installed.
474
+ */
475
+ isAppInstalled(app: string): void;
476
+
477
+ /**
478
+ * @summary Determines if checkbox or radio element is checkable.
479
+ * @function isCheckable
480
+ * @param {String|Element} locator - Element locator.
481
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
482
+ * @return {Boolean} - true if element is checkable. false otherwise.
483
+ * @for android
484
+ * @example <caption>[javascript] Usage example</caption>
485
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
486
+ * mob.isCheckable("id=checkBox");//Determines if checkbox or radio element is checkable.
487
+ */
488
+ isCheckable(locator: string | Element, timeout?: number | undefined): boolean;
489
+
490
+ /**
491
+ * @summary Determines if checkbox or radio element is checked.
492
+ * @function isChecked
493
+ * @param {String|Element} locator - Element locator.
494
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
495
+ * @return {Boolean} - true if element is checked. false otherwise.
496
+ * @for android
497
+ * @example <caption>[javascript] Usage example</caption>
498
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
499
+ * mob.isChecked("id=checkBox");//Determines if checkbox or radio element is checked.
500
+ */
501
+ isChecked(locator: string | Element, timeout?: number | undefined): boolean;
502
+
503
+ /**
504
+ * @summary Determines if an element is clickable.
505
+ * @function isClickable
506
+ * @param {String|Element} locator - Element locator.
507
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
508
+ * @return {Boolean} - true if element is clickable. false otherwise.
509
+ * @for android
510
+ * @example <caption>[javascript] Usage example</caption>
511
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
512
+ * mob.isClickable("id=Element");//Determines if element is clickable.
513
+ */
514
+ isClickable(locator: string | Element, timeout?: number | undefined): boolean;
515
+
516
+ /**
517
+ * @summary Wait for an element to become available.
518
+ * @description The element is not necessary needs to be visible.
519
+ * @function isExist
520
+ * @param {String|Element} locator - Element locator.
521
+ * @param {Number=} timeout - Time in milliseconds to wait for the element. Default is 60 seconds.
522
+ * @return {Boolean} - true if the element exists. false otherwise.
523
+ * @for android, ios, hybrid, web
524
+ * @example <caption>[javascript] Usage example</caption>
525
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
526
+ * mob.isExist("id=Element");//Determines if element exists.
527
+ */
528
+ isExist(locator: string | Element, timeout?: number | undefined): boolean;
529
+
530
+ /**
531
+ * @summary Determines if an element is selected.
532
+ * @function isSelected
533
+ * @param {String|Element} locator - Element locator.
534
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
535
+ * @return {Boolean} - true if element is selected. false otherwise.
536
+ * @for android, hybrid, web
537
+ * @example <caption>[javascript] Usage example</caption>
538
+ * mob.init(caps);
539
+ * var a = mob.isSelected("id=Selection");
540
+ * if (a) {
541
+ * ...
542
+ * } else {
543
+ * ...
544
+ * }
545
+ */
546
+ isSelected(locator: string | Element, timeout?: number | undefined): boolean;
547
+
548
+ /**
549
+ * @summary Checks if element is present and visible. Returns false if element was not found or
550
+ * wasn't visible within the specified timeout.
551
+ * @function isVisible
552
+ * @param {String|Element} locator - An element locator.
553
+ * @param {Number=} timeout - Timeout in milliseconds to wait for element to appear. Default is 60 seconds.
554
+ * @return {Boolean} True if element was found and it was visible. False otherwise.
555
+ * @for android, ios, hybrid, web
556
+ * @example <caption>[javascript] Usage example</caption>
557
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
558
+ * mob.isVisible("id=Selection");//Determines if element is visible.
559
+ */
560
+ isVisible(locator: string | Element, timeout?: number | undefined): boolean;
561
+
562
+ /**
563
+ * @summary Checks if the current context is of WebView type.
564
+ * @function isWebViewContext
565
+ * @return {Boolean} - true if the context name is WEBVIEW or CHROMIUM.
566
+ * @for android, ios, hybrid, web
567
+ * @example <caption>[javascript] Usage example</caption>
568
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
569
+ * mob.isWebViewContext();//Checks if the current context is of WebView type.
570
+ */
571
+ isWebViewContext(): boolean;
572
+
573
+ /**
574
+ * @summary Launches the app defined in the current session's capabilities.
575
+ * @function launchApp
576
+ * @for android, ios
577
+ * @example <caption>[javascript] Usage example</caption>
578
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
579
+ * mob.launchApp(); // Launch the app defined in the session's capabilities.
580
+ */
581
+ launchApp(): void;
582
+
583
+ /**
584
+ * @summary Press and hold a particular key code on the device.
585
+ * @function longPressKeyCode
586
+ * @param {Number} keycode - Key code pressed on the device.
587
+ * @for android, web
588
+ * @example <caption>[javascript] Usage example</caption>
589
+ * https://developer.android.com/reference/android/view/KeyEvent.html - list of key codes
590
+ * mob.init();//Starts a mobile session
591
+ * mob.open('https://keycode.info/');
592
+ * mob.longPressKeyCode(32);// 32 - d key
593
+ */
594
+ longPressKeyCode(keycode: number): void;
595
+
596
+ /**
597
+ * @summary Opens an URL.
598
+ * @description The `open` command waits for the page to load before proceeding.
599
+ * @function open
600
+ * @param {String} url - The URL to open; may be relative or absolute.
601
+ * @for web
602
+ * @example <caption>[javascript] Usage example</caption>
603
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
604
+ * mob.open('www.yourwebsite.com');//Opens an URL.
605
+ */
606
+ open(url: string): void;
607
+
608
+ /**
609
+ * @summary Pause test execution for the given amount of milliseconds.
610
+ * @function pause
611
+ * @param {Number} ms - Milliseconds to pause the execution for.
612
+ * @for android, ios, hybrid, web
613
+ * @example <caption>[javascript] Usage example</caption>
614
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
615
+ * mob.pause(10*1000);//Pauses the execution for 10 seconds (10000ms)
616
+ */
617
+ pause(ms: number): void;
618
+
619
+ /**
620
+ * @summary Remove an app from the device.
621
+ * @function removeApp
622
+ * @param {String} app - App's ID.
623
+ * @for android, ios
624
+ * @example <caption>[javascript] Usage example</caption>
625
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
626
+ * mob.removeApp('com.android.calculator2'); // Remove the calculator app from the device.
627
+ */
628
+ removeApp(app: string): void;
629
+
630
+ /**
631
+ * @summary Reset the currently running app's state (e.g. local settings) on the device.
632
+ * @function resetApp
633
+ * @for android, ios
634
+ * @example <caption>[javascript] Usage example</caption>
635
+ * mob.init(caps); // Starts a mobile session and opens app from desired capabilities
636
+ * mob.resetApp(); // Reset curently running app
637
+ */
638
+ resetApp(): void;
639
+
640
+ /**
641
+ * @summary Scrolls the view element until a specified target element inside the view is found.
642
+ * @function scrollIntoElement
643
+ * @param {String} scrollElmLocator - View element to scroll.
644
+ * @param {String} findElmLocator - Target element to find in the view.
645
+ * @param {Number=} xoffset - Indicates the size in pixels of the horizontal scroll step (positive - scroll right, negative - scroll left). Default is 0.
646
+ * @param {Number=} yoffset - Indicates the size in pixels of the vertical scroll step (positive - scroll down, negative - scroll up). Default is 30.
647
+ * @param {Number=} retries - Indicates the number of scroll retries before giving up if element not found. Default is 50.
648
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
649
+ * @param {Number=} duration - Duration of swipe. Default is 3000 (3sec)
650
+ * @for android, ios
651
+ * @example <caption>[javascript] Usage example</caption>
652
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
653
+ * mob.scrollIntoElement('id=bottomPanel','id=Button',0,30,50);//Scrolls the view element until a specified target element inside the view is found.
654
+ */
655
+ scrollIntoElement(scrollElmLocator: string, findElmLocator: string, xoffset?: number | undefined, yoffset?: number | undefined, retries?: number | undefined, timeout?: number | undefined, duration?: number | undefined): void;
656
+
657
+ /**
658
+ * @summary Scrolls the page or a container element to the location of the specified element.
659
+ * @function scrollIntoView
660
+ * @param {String|Element} locator - An element locator.
661
+ * @param {Boolean|Object=} options - If `true`, the top of the element will be aligned to the top of the
662
+ * visible area of the scrollable ancestor. This is the default.
663
+ * If `false`, the bottom of the element will be aligned to the bottom of the visible area of the
664
+ * scrollable ancestor.
665
+ * This parameter can also accept an `options` object. See the usage example above.
666
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
667
+ * @for hybrid, web
668
+ * @example <caption>[javascript] Usage example</caption>
669
+ * mob.scrollIntoView('id=bottomPanel', true);
670
+ * // or
671
+ * mob.scrollIntoView('id=bottomPanel', {
672
+ * behavior: 'auto', // Optional. Defines the transition animation: `auto` or `smooth`. Defaults to `auto`.
673
+ * block: 'start', // Optional. Defines vertical alignment - `start`, `center`, `end`, `nearest`. Defaults to `start`.
674
+ * inline: 'start' // Optional. Defines horizontal alignment - `start`, `center`, `end`, `nearest`. Defaults to `start`.
675
+ * });
676
+ */
677
+ scrollIntoView(locator: string | Element, options?: (boolean | any) | undefined, timeout?: number | undefined): void;
678
+
679
+ /**
680
+ * @summary Selects an option from a drop-down list using an option locator. This command works
681
+ * with multiple-choice lists as well.
682
+ * @description Option locator can be one of the following (No prefix is same as label matching):
683
+ * - `label=STRING` - Matches option based on the visible text.
684
+ * - `value=STRING` - Matches option based on its value.
685
+ * - `index=STRING` - Matches option based on its index. The index is 0-based.
686
+ * @function select
687
+ * @param {String} selectLocator - An element locator identifying a drop-down menu.
688
+ * @param {String} optionLocator - An option locator.
689
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
690
+ * @for hybrid, web
691
+ * @example <caption>[javascript] Usage example</caption>
692
+ * mob.init(); //Starts a mobile session
693
+ * mob.open("www.yourwebsite.com");// Opens a website.
694
+ * mob.select("id=Selection","label=United States");// Selects an option from a list.
695
+ */
696
+ select(selectLocator: string, optionLocator: string, timeout?: number | undefined): void;
697
+
698
+ /**
699
+ * @summary Selects a frame or an iframe within the current window.
700
+ * @description Available frame locators:
701
+ * - `'parent'` - Select parent frame.
702
+ * - `'top'` - Select top window.
703
+ * - `NUMBER` - Select frame by its 0-based index.
704
+ * - `LOCATOR` - Locator identifying the frame (relative to the top window).
705
+ * Multiple locators can be passed in order to switch between nested frames.
706
+ * @function selectFrame
707
+ * @param {...String|Number} frameLocator - A locator identifying the frame or iframe. Or a series
708
+ * of locators.
709
+ * @for hybrid, web
710
+ * @example <caption>[javascript] Usage example</caption>
711
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
712
+ * mob.selectFrame("//iframe[@id='frame1']", "//iframe[@id='nested_frame']");
713
+ */
714
+ selectFrame(...args: (string | number)[]): void;
715
+
716
+ /**
717
+ * @summary Selects window. Once window has been selected, all commands go to that window.
718
+ * @description `windowLocator` can be:
719
+ * - `title=TITLE` Switch to the first window which matches the specified title. `TITLE` can be any of
720
+ * the supported string matching patterns (see top of the page). When using title locator, this command
721
+ * will wait for the window to appear first similarly to `waitForWindow` command.
722
+ * - `url=URL` Switch to the first window which matches the specified URL. `URL` can be any of
723
+ * the supported string matching patterns (see top of the page). When using url locator, this command
724
+ * will wait for the window to appear first similarly to `waitForWindow` command.
725
+ * - `windowHandle` Switch to a window using its unique handle.
726
+ * @function selectWindow
727
+ * @param {String=} windowLocator - Window locator.
728
+ * @param {Number=} timeout - Timeout in milliseconds when using 'title' window locating strategy.
729
+ * Default is 60 seconds.
730
+ * @return {String} windowHandle of the previously selected window.
731
+ * @for web
732
+ * @example <caption>[javascript] Usage example</caption>
733
+ * mob.init();// Starts a mobile session.
734
+ * mob.open("www.yourwebsite.com");// Opens a website.
735
+ * mob.selectWindow("title=Website");// Selects and focus a window.
736
+ */
737
+ selectWindow(windowLocator?: string | undefined, timeout?: number | undefined): string;
738
+
739
+ sendKeys(value: any): void;
740
+
741
+ /**
742
+ * @function setContext
743
+ * @summary Sets a specific context (NATIVE_APP, WEBVIEW, etc.).
744
+ * @param {String} context - The context name.
745
+ * @for android, ios, hybrid, web
746
+ * @example <caption>[javascript] Usage example</caption>
747
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
748
+ * mob.setContext('NATIVE_APP');//Sets a specific context (NATIVE_APP, WEBVIEW, etc.).
749
+ */
750
+ setContext(context: string): void;
751
+
752
+ /**
753
+ * @summary Sets context to NATIVE_APP.
754
+ * @function setNativeContext
755
+ * @for android, ios, hybrid, web
756
+ * @example <caption>[javascript] Usage example</caption>
757
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
758
+ * mob.setNativeContext();//Sets context to NATIVE_APP.
759
+ */
760
+ setNativeContext(): void;
761
+
762
+ /**
763
+ * @summary Specifies the amount of time that Oxygen will wait for actions to complete.
764
+ * @description This includes the `open` command, `waitFor*` commands, and commands which wait
765
+ * for elements to appear in DOM or become visible before operating on them.
766
+ * If command wasn't able to complete within the specified period it will fail the
767
+ * test.
768
+ * The default time-out is 60 seconds.
769
+ * @function setTimeout
770
+ * @for android, ios, hybrid, web
771
+ * @param {Number} timeout - A time-out in milliseconds.
772
+ * @example <caption>[javascript] Usage example</caption>
773
+ * mob.init();//Opens browser session.
774
+ * mob.setTimeout(60000);//Sets the time out to amount of milliseconds .
775
+ */
776
+ setTimeout(timeout: number): void;
777
+
778
+ /**
779
+ * @summary Sets context to the first available WEBVIEW or CHROMIUM (Crosswalk WebView) view.
780
+ * @function setWebViewContext
781
+ * @return {String} Context name, or null if no web context found.
782
+ * @for android, ios, hybrid, web
783
+ * @example <caption>[javascript] Usage example</caption>
784
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
785
+ * mob.setWebViewContext();//Sets context to the first available WEBVIEW or CHROMIUM (Crosswalk WebView) view.
786
+ */
787
+ setWebViewContext(): string;
788
+
789
+ /**
790
+ * @summary Perform shake action on the device
791
+ * @description Supported on Android and iOS 9 or earlier versions.
792
+ * @function shake
793
+ * @for ios
794
+ * @example <caption>[javascript] Usage example</caption>
795
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
796
+ * mob.shake();//Perform shake action on the device.
797
+ */
798
+ shake(): void;
799
+
800
+ /**
801
+ * @summary Clicks SMS message URL.
802
+ * @description `SMSPopup` application must be installed and running on the device to use this command.
803
+ * https://github.com/oxygenhq/android-smspopup/releases
804
+ * @function smsClickLink
805
+ * @param {Number=} timeout - Time in milliseconds to wait for sms popup. Default is 60 seconds.
806
+ * @for android
807
+ * @example <caption>[javascript] Usage example</caption>
808
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
809
+ * mob.click("id=sendSmS");// Clicks an element.
810
+ * mob.smsClickLink(60000);//Clicks SMS message URL.
811
+ */
812
+ smsClickLink(timeout?: number | undefined): void;
813
+
814
+ /**
815
+ * @summary Gets SMS text on Android phone.
816
+ * @description `SMSPopup` application must be installed and running on the device to use this command.
817
+ * https://github.com/oxygenhq/android-smspopup/releases
818
+ * @function smsGetText
819
+ * @param {Number=} timeout - Time in milliseconds to wait for sms popup. Default is 60 seconds.
820
+ * @return {String} - SMS text.
821
+ * @for android
822
+ * @example <caption>[javascript] Usage example</caption>
823
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
824
+ * mob.click("id=sendSmS");// Clicks an element.
825
+ * var a = mob.smsGetText(60000);//Gets SMS text on Android phone.
826
+ */
827
+ smsGetText(timeout?: number | undefined): string;
828
+
829
+ /**
830
+ * @summary Perform a swipe on an element.
831
+ * @function swipe
832
+ * @param {String|Element} locator - Locator of the element to swipe on.
833
+ * @param {Number=} xoffset - Horizontal offset (positive - scroll right, negative - scroll left). Default is 0.
834
+ * @param {Number=} yoffset - Vertical offset (positive - scroll down, negative - scroll up). Default is 30.
835
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
836
+ * @param {Number=} duration - Duration of swipe. Default is 3000 (3sec)
837
+ * @for android, ios
838
+ * @example <caption>[javascript] Usage example</caption>
839
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
840
+ * mob.swipe("id=Element",-60,0,150);//Perform a swipe on the screen or an element.
841
+ */
842
+ swipe(locator: string | Element, xoffset?: number | undefined, yoffset?: number | undefined, timeout?: number | undefined, duration?: number | undefined): void;
843
+
844
+ /**
845
+ * @summary Perform swipe on the element.
846
+ * @function swipeElement
847
+ * @param {String} locator - Locator of the element to swipe on.
848
+ * @param {Number=} xoffset - Horizontal offset (positive - scroll right, negative - scroll left). Default is 0.
849
+ * @param {Number=} yoffset - Vertical offset (positive - scroll down, negative - scroll up). Default is 30.
850
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
851
+ * @param {Number=} duration - Duration of swipe. Default is 3000 (3sec)
852
+ * @for android, ios
853
+ * @example <caption>[javascript] Usage example</caption>
854
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
855
+ * mob.swipeElement("id=Element",-60,0,150);//Perform a swipe on the screen or an element.
856
+ */
857
+ swipeElement(locator: string, xoffset?: number | undefined, yoffset?: number | undefined, timeout?: number | undefined, duration?: number | undefined): void;
858
+
859
+ /**
860
+ * @summary Perform a swipe on the screen.
861
+ * @function swipeScreen
862
+ * @param {Number} x1 - Starting X position (top-left screen corner is the origin)
863
+ * @param {Number} y1 - Starting Y position.
864
+ * @param {Number} x2 - Ending X position.
865
+ * @param {Number} y2 - Ending Y position.
866
+ * @param {Number=} duration - Duration of swipe. Default is 3000 (3sec)
867
+ * @for android, ios
868
+ * @example <caption>[javascript] Usage example</caption>
869
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
870
+ * mob.swipeScreen(0, 0, 0, 900);//Perform a swipe on the screen
871
+ */
872
+ swipeScreen(x1: number | undefined, y1: number | undefined, x2: any, y2: any, duration?: number | undefined): void;
873
+
874
+ /**
875
+ * @function takeScreenshot
876
+ * @summary Take a screenshot of the current page or screen and return it as base64 encoded string.
877
+ * @return {String} Screenshot image encoded as a base64 string.
878
+ * @for android, ios, hybrid, web
879
+ * @example <caption>[javascript] Usage example</caption>
880
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
881
+ * var ss = mob.takeScreenshot();//Take a screenshot of the current page or screen and return it as base64 encoded string.
882
+ * require("fs").writeFileSync("c:\\screenshot.png", ss, 'base64');
883
+ */
884
+ takeScreenshot(): string;
885
+
886
+ /**
887
+ * @summary Perform tap at the specified coordinate.
888
+ * @function tap
889
+ * @param {Number} x - x offset.
890
+ * @param {Number} y - y offset.
891
+ * @for android, ios
892
+ * @example <caption>[javascript] Usage example</caption>
893
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
894
+ * mob.tap(60,300);//Perform tap at the specified coordinate.
895
+ */
896
+ tap(x: number, y: number): void;
897
+
898
+ /**
899
+ * @summary Send a sequence of key strokes to an element (clears value before).
900
+ * @description Refer to [Key Codes](https://w3c.github.io/webdriver/#keyboard-actions)
901
+ * for the list of supported raw keyboard key codes.
902
+ * @function type
903
+ * @param {String|Element} locator - An element locator.
904
+ * @param {String} value - The value to type.
905
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
906
+ * @for android, ios, hybrid, web
907
+ * @example <caption>[javascript] Usage example</caption>
908
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
909
+ * mob.type('id=TextArea', 'hello world\uE007');
910
+ */
911
+ type(locator: string | Element, value: string, timeout?: number | undefined): void;
912
+
913
+ /**
914
+ * @summary Unlocks a pattern lock
915
+ * @function unlockPattern
916
+ * @param {String|Element} locator - Element locator for the pattern lock.
917
+ * @param {Number} cols - Number of columns in the pattern.
918
+ * @param {Number} rows - Number of rows in the pattern.
919
+ * @param {String} pattern - Pattern sequence. Pins are hexadecimal and case sensitive. See example.
920
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
921
+ * @example <caption>Pattern pins are treated similarly as the numbers of a phone dial. E.g. 3x4 pattern:</caption>
922
+ * 1 2 3
923
+ * 4 5 6
924
+ * 7 8 9
925
+ * a b c
926
+ * @for android
927
+ */
928
+ unlockPattern(locator: string | Element, cols: number, rows: number, pattern: string, timeout?: number | undefined): void;
929
+
930
+ /**
931
+ * @summary Wait for an element for the provided amount of milliseconds to exist in DOM.
932
+ * @description The element is not necessary needs to be visible.
933
+ * @function waitForExist
934
+ * @param {String|Element} locator - Element locator.
935
+ * @param {Number=} timeout - Time in milliseconds to wait for the element. Default is 60 seconds.
936
+ * @for android, ios, hybrid, web
937
+ * @example <caption>[javascript] Usage example</caption>
938
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
939
+ * mob.waitForExist('id=Element');//Wait for an element for the provided amount of milliseconds to exist in DOM.
940
+ */
941
+ waitForExist(locator: string | Element, timeout?: number | undefined): void;
942
+
943
+ /**
944
+ * @summary Waits for element to become interactable.
945
+ * @function waitForInteractable
946
+ * @param {String|Element} locator - An element locator.
947
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
948
+ * @for android, ios, hybrid, web
949
+ * @example <caption>[javascript] Usage example</caption>
950
+ * mob.init();//Opens browser session.
951
+ * mob.waitForInteractable("id=UserName");//Waits for an element is clickable in DOM.
952
+ */
953
+ waitForInteractable(locator: string | Element, timeout?: number | undefined): void;
954
+
955
+ /**
956
+ * @summary Waits for element to become visible.
957
+ * @function waitForVisible
958
+ * @param {String|Element} locator - Element locator.
959
+ * @param {Number=} timeout - Time in milliseconds to wait for the element. Default is 60 seconds.
960
+ * @for android, ios, hybrid, web
961
+ * @example <caption>[javascript] Usage example</caption>
962
+ * mob.init(caps);//Starts a mobile session and opens app from desired capabilities
963
+ * mob.waitForVisible("id=Title", 45*1000);//Waits for an element to be visible.
964
+ */
965
+ waitForVisible(locator: string | Element, timeout?: number | undefined): void;
966
+ }
967
+ }