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,1050 @@
1
+ declare namespace Oxygen {
2
+ interface ModuleWeb {
3
+ /**
4
+ * @summary Initializes new Selenium session.
5
+ * @function init
6
+ * @param {String=} caps - Desired capabilities. If not specified capabilities will be taken from suite definition.
7
+ * @param {String=} seleniumUrl - Remote server URL (default: http://localhost:4444/wd/hub).
8
+ */
9
+ init(caps?: Map<string, any> | undefined, seleniumUrl?: string | undefined): void;
10
+
11
+ /**
12
+ * @function dispose
13
+ * @summary Ends the current session.
14
+ * @param {String=} status - Test status, either `passed` or `failed`.
15
+ */
16
+ dispose(status?: string | undefined): void;
17
+
18
+ /**
19
+ * @summary Opens new transaction.
20
+ * @description The transaction will persist till a new one is opened. Transaction names must be
21
+ * unique.
22
+ * @function transaction
23
+ * @param {String} name - The transaction name.
24
+ */
25
+ transaction(name: string): void;
26
+
27
+ /**
28
+ * @summary Accepts an alert or a confirmation dialog.
29
+ * @description In case of an alert box this command is identical to `alertDismiss`.
30
+ * @function alertAccept
31
+ * @example <caption>[javascript] Usage example</caption>
32
+ * web.init();//Opens browser session
33
+ * web.open("www.yourwebsite.com");// Opens a website.
34
+ * web.click("id=SaveButton");//Clicks on save – an alert would pop up
35
+ * web.alertAccept();//Clicks on "OK" in the alert dialog.
36
+ */
37
+ alertAccept(): void;
38
+
39
+ /**
40
+ * @summary Dismisses an alert or a confirmation dialog.
41
+ * @description In case of an alert box this command is identical to `alertAccept`.
42
+ * @function alertDismiss
43
+ * @example <caption>[javascript] Usage example</caption>
44
+ * web.init();//Opens browser session
45
+ * web.open("www.yourwebsite.com");// Opens a website.
46
+ * web.click("id=SaveButton");//Clicks on save – an alert would pop up
47
+ * web.alertDismiss();//Clicks on Cancel in the alert dialog.
48
+ */
49
+ alertDismiss(): void;
50
+
51
+ /**
52
+ * @summary Asserts whether alert matches the specified pattern and dismisses it.
53
+ * @description Text pattern can be any of the supported
54
+ * string matching patterns(on the top of page).
55
+ * @function assertAlert
56
+ * @param {String} pattern - Text pattern.
57
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
58
+ * @example <caption>[javascript] Usage example</caption>
59
+ * web.init();//Opens browser session
60
+ * web.open("www.yourwebsite.com");// Opens a website.
61
+ * web.click("id=SaveButton");//Clicks on save – an alert would pop up
62
+ * web.assertAlert("Your Alert's text");//Asserts the alert's text.
63
+ */
64
+ assertAlert(pattern: string, timeout?: number | undefined): void;
65
+
66
+ /**
67
+ * @summary Asserts whether element exists in the DOM.
68
+ * @function assertExist
69
+ * @param {String|Element} locator - An element locator.
70
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
71
+ * @example <caption>[javascript] Usage example</caption>
72
+ * web.init();//Opens browser session
73
+ * web.open("www.yourwebsite.com");// Opens a website.
74
+ * web.assertExist ("id=Username");// Asserts if an element exists in the DOM.
75
+ */
76
+ assertExist(locator: string | Element, timeout?: number | undefined): void;
77
+
78
+ /**
79
+ * @summary Asserts text of the currently selected option in a drop-down list.
80
+ * @description Assertion pattern can be any of the supported
81
+ * string matching patterns(on the top of page).
82
+ * @function assertSelectedLabel
83
+ * @param {String|Element} locator - An element locator.
84
+ * @param {String} pattern - The assertion pattern.
85
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
86
+ * @param {Boolean=} waitForVisible - Wait for visible.
87
+ * @example <caption>[javascript] Usage example</caption>
88
+ * web.init();//Opens browser session
89
+ * web.open("www.yourwebsite.com");// Opens a website.
90
+ * web.assertSelectedLabel("id=Selection", "United States");// Asserts if an element's label is selected in the drop down list.
91
+ */
92
+ assertSelectedLabel(locator: string | Element, pattern: string, timeout?: number | undefined, waitForVisible?: boolean | undefined): void;
93
+
94
+ /**
95
+ * @summary Asserts value of the currently selected option in a drop-down list.
96
+ * @description Assertion pattern can be any of the supported
97
+ * string matching patterns(on the top of page).
98
+ * @function assertSelectedValue
99
+ * @param {String|Element} locator - An element locator.
100
+ * @param {String} pattern - The assertion pattern.
101
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
102
+ * @param {Boolean=} waitForVisible - Wait for visible.
103
+ * @example <caption>[javascript] Usage example</caption>
104
+ * web.init();//Opens browser session
105
+ * web.open("www.yourwebsite.com");// Opens a website.
106
+ * web.assertSelectedValue("id=Selection", "3");// Asserts if an element's value is selected in the drop down list.
107
+ */
108
+ assertSelectedValue(locator: string | Element, pattern: string, timeout?: number | undefined, waitForVisible?: boolean | undefined): void;
109
+
110
+ /**
111
+ * @summary Asserts element's inner text.
112
+ * @description Text pattern can be any of the supported
113
+ * string matching patterns(on the top of page).
114
+ * If the element is not interactable, then it will allways return empty string as its text.
115
+ * @function assertText
116
+ * @param {String|Element} locator - An element locator.
117
+ * @param {String} pattern - Text pattern.
118
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
119
+ * @example <caption>[javascript] Usage example</caption>
120
+ * web.init();//Opens browser session
121
+ * web.open("www.yourwebsite.com");// Opens a website.
122
+ * web.assertText ("id=UserName","John Doe");// Asserts if an element's text is as expected.
123
+ */
124
+ assertText(locator: string | Element, pattern: string, timeout?: number | undefined): void;
125
+
126
+ /**
127
+ * @summary Asserts whether the given text is *not* present on the page. That is, whether there are
128
+ * no elements containing this text on the page.
129
+ * @function assertTextNotPresent
130
+ * @param {String|Element} text - Text.
131
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
132
+ * @example <caption>[javascript] Usage example</caption>
133
+ * web.init();//Opens browser session
134
+ * web.open("www.yourwebsite.com");// Opens a website.
135
+ * web.assertTextNotPresent("John Doe");// Asserts if a text is not presented somewhere on the page.
136
+ */
137
+ assertTextNotPresent(text: string | Element, timeout?: number | undefined): void;
138
+
139
+ /**
140
+ * @summary Asserts whether the given text is present somewhere on the page. That is whether an
141
+ * element containing this text exists on the page.
142
+ * @function assertTextPresent
143
+ * @param {String} text - Text.
144
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
145
+ * @example <caption>[javascript] Usage example</caption>
146
+ * web.init();//Opens browser session
147
+ * web.open("www.yourwebsite.com");// Opens a website.
148
+ * web.assertTextPresent("John Doe");// Asserts if a text is presented somewhere on the page.
149
+ */
150
+ assertTextPresent(text: string, timeout?: number | undefined): void;
151
+
152
+ /**
153
+ * @summary Asserts the page title.
154
+ * @description Assertion pattern can be any of the supported
155
+ * string matching patterns(on the top of page).
156
+ * @function assertTitle
157
+ * @param {String} pattern - The assertion pattern.
158
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
159
+ * @example <caption>[javascript] Usage example</caption>
160
+ * web.init();//Opens browser session
161
+ * web.open("www.yourwebsite.com");// Opens a website.
162
+ * web.assertTitle("Your websites title!");// Asserts the title of the page.
163
+ */
164
+ assertTitle(pattern: string, timeout?: number | undefined): void;
165
+
166
+ /**
167
+ * @summary Asserts element's value.
168
+ * @description Value pattern can be any of the supported
169
+ * string matching patterns(on the top of page).
170
+ * @function assertValue
171
+ * @param {String|Element} locator - An element locator.
172
+ * @param {String} pattern - Value pattern.
173
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
174
+ * @example <caption>[javascript] Usage example</caption>
175
+ * web.init();//Opens browser session
176
+ * web.open("www.yourwebsite.com");// Opens a website.
177
+ * web.assertValue("id=UserName", "John Doe");// Asserts the value of an element.
178
+ */
179
+ assertValue(locator: string | Element, pattern: string, timeout?: number | undefined): void;
180
+
181
+ /**
182
+ * @summary Navigate backwards in the browser history.
183
+ * @function back
184
+ * @example <caption>[javascript] Usage example</caption>
185
+ * web.init();//Opens browser session.
186
+ * web.open("www.yourwebsite.com");// Opens a website.
187
+ * web.click("id=NextPage");//Clicks on next page link.
188
+ * web.back();//Navigate back to previous page.
189
+ */
190
+ back(): void;
191
+
192
+ /**
193
+ * @summary Clear the value of an input field.
194
+ * @function clear
195
+ * @param {String|Element} locator - An element locator.
196
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
197
+ * @example <caption>[javascript] Usage example</caption>
198
+ * web.init();//Opens browser session.
199
+ * web.open("www.yourwebsite.com");// Opens a website.
200
+ * web.type("id=Password", "Password");//Types a password to a field.
201
+ * web.clear("id=Password");//Clears the characters from the field of an element.
202
+ */
203
+ clear(locator: string | Element, timeout?: number | undefined): void;
204
+
205
+ /**
206
+ * @summary Clicks on an element.
207
+ * @description If the click causes new page to load, the command waits for page to load before
208
+ * proceeding.
209
+ * @function click
210
+ * @param {String|Element} locator - An element locator.
211
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
212
+ * @example <caption>[javascript] Usage example</caption>
213
+ * web.init();//Opens browser session.
214
+ * web.open("www.yourwebsite.com");// Opens a website.
215
+ * web.click("id=NextPage");//Clicks on next page link.
216
+ */
217
+ click(locator: string | Element, timeout?: number | undefined): void;
218
+
219
+ /**
220
+ * @summary Clicks on a non-visible element.
221
+ * @description If the click causes new page to load, the command waits for page to load before
222
+ * proceeding.
223
+ * @function clickHidden
224
+ * @param {String|Element} locator - An element locator.
225
+ * @param {Boolean=} clickParent - If true, then parent of the element is clicked.
226
+ * @example <caption>[javascript] Usage example</caption>
227
+ * web.clickHidden("id=HiddenLink");
228
+ */
229
+ clickHidden(locator: string | Element, clickParent?: boolean | undefined): void;
230
+
231
+ /**
232
+ * @summary Closes the currently active window.
233
+ * @function closeWindow
234
+ * @example <caption>[javascript] Usage example</caption>
235
+ * web.init();//Opens browser session.
236
+ * web.open("www.yourwebsite.com");// Opens a website.
237
+ * web.closeWindow();//Closes the current window.
238
+ */
239
+ closeWindow(): void;
240
+
241
+ /**
242
+ * @summary Stop test execution and allow interactive command execution (REPL).
243
+ * @function debug
244
+ * @example <caption>[javascript] Usage example</caption>
245
+ * web.init();
246
+ * web.open("www.yourwebsite.com");
247
+ * web.debug();
248
+ */
249
+ debug(): void;
250
+
251
+ /**
252
+ * @summary Delete cookies visible to the current page.
253
+ * @function deleteCookies
254
+ * @param {String|String[]=} names - Cookie name or a list of cookie names to delete.
255
+ */
256
+ deleteCookies(names?: (string | string[]) | undefined): void;
257
+
258
+ /**
259
+ * @summary Deselects an option from multiple-choice drop-down list.
260
+ * @description Option locator can be one of the following (No prefix is same as label matching):
261
+ * - `label=STRING` Matches option based on the visible text.
262
+ * - `value=STRING` Matches option based on its value.
263
+ * - `index=STRING` Matches option based on its index. The index is 0-based.
264
+ * @function deselect
265
+ * @param {String} selectLocator - An element locator identifying a drop-down menu.
266
+ * @param {String} optionLocator - An option locator.
267
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
268
+ * @example <caption>[javascript] Usage example</caption>
269
+ * web.init();//Opens browser session.
270
+ * web.open("www.yourwebsite.com");// Opens a website.
271
+ * web.deselect("id=Selection","label=United States");//Deselect option from multiple choice drop down list.
272
+ */
273
+ deselect(selectLocator: string, optionLocator: string, timeout?: number | undefined): void;
274
+
275
+ /**
276
+ * @summary Double clicks on an element.
277
+ * @function doubleClick
278
+ * @param {String|Element} locator - An element locator.
279
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
280
+ * @example <caption>[javascript] Usage example</caption>
281
+ * web.init();//Opens browser session.
282
+ * web.open("www.yourwebsite.com");// Opens a website.
283
+ * web.doubleClick("id=Mark");//Double clicks on a element.
284
+ */
285
+ doubleClick(locator: string | Element, timeout?: number | undefined): void;
286
+
287
+ /**
288
+ * @summary Drag and Drop element into another element
289
+ * @function dragAndDrop
290
+ * @param {String} srcElement - Element to drag and drop.
291
+ * @param {String} dstElement - Destination element to drop into.
292
+ * @param {Number=} duration - How long the drag should take place.
293
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
294
+ * @example <caption>[javascript] Usage example. Drops grey rectangle into red square.</caption>
295
+ * web.init();
296
+ * web.open('http://webdriverjs.christian-bromann.com/');
297
+ * web.dragAndDrop('id=overlay', '/html/body/section/div[1]');
298
+ * web.pause(10*1000);
299
+ */
300
+ dragAndDrop(srcElement: string, dstElement: string, duration?: number | undefined, timeout?: number | undefined): void;
301
+
302
+ /**
303
+ * @summary Executes JavaScript in the context of the currently selected frame or window.
304
+ * @description If return value is null or there is no return value, `null` is returned.
305
+ * @function execute
306
+ * @param {String|Function} script - The JavaScript to execute.
307
+ * @param {...Object} arg - Optional arguments to be passed to the JavaScript function.
308
+ * @return {Object} The return value.
309
+ * @example <caption>[javascript] Usage example</caption>
310
+ * web.init();//Opens browser session.
311
+ * web.open("www.yourwebsite.com");// Opens a website.
312
+ * web.execute(function()
313
+ * {
314
+ * angular.element(".password").trigger("ng-click").click()
315
+ * }
316
+ * );//Executes/injects JavaScript code.
317
+
318
+ */
319
+ execute(...args: any[]): any;
320
+
321
+ fileBrowse(locator: any, filepath: any, timeout: any): void;
322
+
323
+ /**
324
+ * @summary Finds an element.
325
+ * @function findElement
326
+ * @param {String} locator - Element locator.
327
+ * @param {Element=} parent - Optional parent element for relative search.
328
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
329
+ * @return {Element} - A Element object.
330
+ * @example <caption>[javascript] Usage example</caption>
331
+ * web.open('https://www.wikipedia.org');
332
+ * var el = web.findElement("id=js-link-box-en");
333
+ * web.click(el);
334
+ */
335
+ findElement(locator: string, parent?: Element | undefined, timeout?: number | undefined): Element;
336
+
337
+ /**
338
+ * @summary Finds elements.
339
+ * @function findElements
340
+ * @param {String} locator - Element locator.
341
+ * @param {Element=} parent - Optional parent element for relative search.
342
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
343
+ * @return {Element[]} - Collection of Element objects.
344
+ * @example <caption>[javascript] Usage example</caption>
345
+ * web.open('https://www.wikipedia.org');
346
+ * var els = web.findElements("//div");
347
+ * for (let el of els) {
348
+ * var text = web.getText(el);
349
+ * log.info(text);
350
+ * }
351
+ */
352
+ findElements(locator: string, parent?: Element | undefined, timeout?: number | undefined): Element[];
353
+
354
+ /**
355
+ * @summary Fullscreen Window.
356
+ * @function fullscreenWindow
357
+ * @example <caption>[javascript] Usage example</caption>
358
+ * web.init();//Opens browser session.
359
+ * web.fullscreenWindow();
360
+ */
361
+ fullscreenWindow(): void;
362
+
363
+ /**
364
+ * @summary Gets the text displayed by an alert or confirm dialog.
365
+ * @function getAlertText
366
+ * @return {String} The alert's text.
367
+ * @example <caption>[javascript] Usage example</caption>
368
+ * web.init();//Opens browser session.
369
+ * web.open("www.yourwebsite.com");// Opens a website.
370
+ * var text = web.getAlertText();//Gets the text in the alert dialog.
371
+ */
372
+ getAlertText(): string;
373
+
374
+ /**
375
+ * @summary Returns the element's attribute.
376
+ * @function getAttribute
377
+ * @param {String|Element} locator - An element locator.
378
+ * @param {String} attribute - The name of the attribute to retrieve.
379
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
380
+ * @return {String} The attribute's value or null if no such attribute.
381
+ * @example <caption>[javascript] Usage example</caption>
382
+ * web.init();//Opens browser session.
383
+ * web.open("www.yourwebsite.com");// Opens a website.
384
+ * web.getAttribute("id=UserName","value");//Gets an attribute from an element.
385
+ */
386
+ getAttribute(locator: string | Element, attribute: string, timeout?: number | undefined): string;
387
+
388
+ /**
389
+ * @function getBrowserLogs
390
+ * @summary Collects logs from the browser console. Works only in Chrome.
391
+ * @return {Object[]} An array of browser console logs.
392
+ * @for chrome
393
+ * @example <caption>[javascript] Usage example</caption>
394
+ * web.init();//Opens browser session.
395
+ * web.open("www.yourwebsite.com");// Opens a website.
396
+ * var logs = web.getBrowserLogs(); //Collects logs from the browser console
397
+ */
398
+ getBrowserLogs(): any[];
399
+
400
+ /**
401
+ * @summary Returns a specific cookie or a list of cookies visible to the current page.
402
+ * @function getCookies
403
+ * @param {String} names - Names of the cookies to retrieve.
404
+ * @return {String} The attribute's value.
405
+ */
406
+ getCookies(names: string): string;
407
+
408
+ /**
409
+ * @summary Returns the value of a CSS property of an element.
410
+ * @function getCssValue
411
+ * @param {String|Element} locator - An element locator.
412
+ * @param {String} propertyName - CSS property name.
413
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
414
+ * @return {String} CSS property value or null if no such property.
415
+ * @example <caption>[javascript] Usage example</caption>
416
+ * web.init();//Opens browser session.
417
+ * web.open("www.yourwebsite.com");// Opens a website.
418
+ * web.getCssValue("id=UserName","color");//Gets a CSS value from an element.
419
+ */
420
+ getCssValue(locator: string | Element, propertyName: string, timeout?: number | undefined): string;
421
+
422
+ /**
423
+ * @summary Retrieves the count of elements matching the given locator.
424
+ * @function getElementCount
425
+ * @param {String|Element} locator - Element locator.
426
+ * @return {Number} Element count or 0 if no elements were found.
427
+ * @example <caption>[javascript] Usage example</caption>
428
+ * web.init();//Opens browser session.
429
+ * web.open("www.yourwebsite.com");// Opens a website.
430
+ * var count = web.getElementCount("//*[@class=Title]");//Gets the element count.
431
+ */
432
+ getElementCount(locator: string | Element): number;
433
+
434
+ /**
435
+ * @summary Gets source code of specified DOM element.
436
+ * @function getHTML
437
+ * @param {String|Element} locator - An element locator.
438
+ * @param {Boolean} includeElementTag - If true, it includes the element tag.
439
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
440
+ * @return {String} - Source code of the element.
441
+ * @example <caption>[javascript] Usage example</caption>
442
+ * web.getHTML("id=Username", false);
443
+ */
444
+ getHTML(locator: string | Element, includeElementTag: boolean, timeout?: number | undefined): string;
445
+
446
+ /**
447
+ * @summary Gets the source of the currently active window.
448
+ * @function getSource
449
+ * @return {String} The page source.
450
+ * @example <caption>[javascript] Usage example</caption>
451
+ * web.init();//Opens browser session.
452
+ * web.open("www.yourwebsite.com");// Opens a website.
453
+ * web.getSource();//Gets the source of the page.
454
+ */
455
+ getSource(): string;
456
+
457
+ /**
458
+ * @summary Returns the text (rendered text shown to the user; whitespace-trimmed) of an element.
459
+ * @function getText
460
+ * @param {String|Element} locator - An element locator.
461
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
462
+ * @return {String} The element's text.
463
+ * @example <caption>[javascript] Usage example</caption>
464
+ * web.init();//Opens browser session.
465
+ * web.open("www.yourwebsite.com");// Opens a website.
466
+ * var text = web.getText("id=Title");//Gets the text from an element.
467
+ */
468
+ getText(locator: string | Element, timeout?: number | undefined): string;
469
+
470
+ /**
471
+ * @summary Returns the title of the currently active window.
472
+ * @function getTitle
473
+ * @return {String} The page title.
474
+ */
475
+ getTitle(locator: any): string;
476
+
477
+ /**
478
+ * @summary Gets the URL of the currently active window.
479
+ * @function getUrl
480
+ * @return {String} The page URL.
481
+ * @example <caption>[javascript] Usage example</caption>
482
+ * web.init();//Opens browser session.
483
+ * web.open("www.yourwebsite.com");// Opens a website.
484
+ * web.getUrl();//Gets the url from the current page.
485
+ */
486
+ getUrl(): string;
487
+
488
+ /**
489
+ * @summary Returns the (whitespace-trimmed) value of an input field.
490
+ * @function getValue
491
+ * @param {String|Element} locator - An element locator.
492
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
493
+ * @return {String} The value.
494
+ * @example <caption>[javascript] Usage example</caption>
495
+ * web.init();//Opens browser session.
496
+ * web.open("www.yourwebsite.com");// Opens a website.
497
+ * web.getValue("id=UserName");//Gets the value from an element.
498
+ */
499
+ getValue(locator: string | Element, timeout?: number | undefined): string;
500
+
501
+ /**
502
+ * @summary Gets handles of currently open windows.
503
+ * @function getWindowHandles
504
+ * @return {String[]} Array of all available window handles.
505
+ * @example <caption>[javascript] Usage example</caption>
506
+ * web.init();//Opens browser session.
507
+ * web.open("www.yourwebsite.com");// Opens a website.
508
+ * web.getWindowHandles();//Gets the window handles of currently open windows.
509
+ */
510
+ getWindowHandles(): string[];
511
+
512
+ /**
513
+ * @summary Sets the size of the outer browser window.
514
+ * @function getWindowSize
515
+ * @return {Object} Size object. Example: { height: 1056, width: 1936, x: -8, y: -8 }
516
+ * @example <caption>[javascript] Usage example</caption>
517
+ * web.init();//Opens browser session.
518
+ * web.open("www.yourwebsite.com");// Opens a website.
519
+ * const sizeObject = web.getWindowSize();
520
+ */
521
+ getWindowSize(): any;
522
+
523
+ /**
524
+ * @summary Gets the source of the currently active window which displays `text/xml` page.
525
+ * @function getXMLPageSource
526
+ * @return {String} The XML page source.
527
+ * @example <caption>[javascript] Usage example</caption>
528
+ * web.init();//Opens browser session.
529
+ * web.open("www.yourwebsite.com");// Opens a website.
530
+ * var src = web.getXMLPageSource();//Gets the source of currently active window which displays `text/xml` page.
531
+ */
532
+ getXMLPageSource(): string;
533
+
534
+ /**
535
+ * @summary Return true if alert dialog is currently present on the screen.
536
+ * @function isAlertPresent
537
+ * @return {Boolean} True if alert is present, false otherwise.
538
+ * @example <caption>[javascript] Usage example</caption>
539
+ * web.init();//Opens browser session.
540
+ * web.open("www.yourwebsite.com");// Opens a website.
541
+ * var alertPresent = web.isAlertPresent();//Returns true if the alert dialog is displayed.
542
+ */
543
+ isAlertPresent(): boolean;
544
+
545
+ /**
546
+ * @summary _**deprecated**_ Use isSelected instead. Determines if checkbox or radio element is checked.
547
+ * @function isChecked
548
+ * @param {String|Element} locator - Element locator.
549
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
550
+ * @return {Boolean} - true if element is checked. false otherwise.
551
+ * @for android
552
+ * @example <caption>[javascript] Usage example</caption>
553
+ * web.init(caps);
554
+ * var checked = web.isChecked("id=checkBox");
555
+ */
556
+ isChecked(locator: string | Element, timeout?: number | undefined): boolean;
557
+
558
+ /**
559
+ * @summary Checks if element is present in the DOM. Returns false if element was not found
560
+ * within the specified timeout.
561
+ * @function isExist
562
+ * @param {String|Element} locator - An element locator.
563
+ * @param {Number=} timeout - Timeout in milliseconds to wait for element to appear. Default is 60 seconds.
564
+ * @return {Boolean} True if element was found. False otherwise.
565
+ * @example <caption>[javascript] Usage example</caption>
566
+ * web.init();//Opens browser session.
567
+ * web.open("www.yourwebsite.com");// Opens a website.
568
+ * web.isExist("id=SaveButton");// Returns true if the element exists in page.
569
+ */
570
+ isExist(locator: string | Element, timeout?: number | undefined): boolean;
571
+
572
+ /**
573
+ * @summary Returns true if the selected element is interactable.
574
+ * @description Element is considered interactable only if it exists, is visible, is within viewport (if not try scroll to it),
575
+ * its center is not overlapped with another element, and is not disabled.
576
+ * @function isInteractable
577
+ * @param {String|Element} locator - An element locator.
578
+ * @param {Number=} timeout - Timeout in milliseconds to wait for element to appear. Default is 60 seconds.
579
+ * @return {Boolean} True if element is interactable. False otherwise.
580
+ * @example <caption>[javascript] Usage example</caption>
581
+ * web.init();//Opens browser session.
582
+ * web.open("www.yourwebsite.com");// Opens a website.
583
+ * if (web.isInteractable("id=SaveButton")) {
584
+ * // the element is interactable
585
+ * }
586
+ */
587
+ isInteractable(locator: string | Element, timeout?: number | undefined): boolean;
588
+
589
+ /**
590
+ * @summary Determines whether an `option` or `input` element of type checkbox or radio is currently selected or not.
591
+ * @function isSelected
592
+ * @param {String|Element} locator - Element locator.
593
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
594
+ * @return {Boolean} - true if element is selected. false otherwise.
595
+ * @example <caption>[javascript] Usage example</caption>
596
+ * web.init();
597
+ * web.open('http://www.wikipedia.org');
598
+ * var a = web.isSelected("id=Selection");
599
+ * if (a) {
600
+ * ...
601
+ * } else {
602
+ * ...
603
+ * }
604
+ */
605
+ isSelected(locator: string | Element, timeout?: number | undefined): boolean;
606
+
607
+ /**
608
+ * @summary Checks if element is present and visible. Returns false if element was not found or
609
+ * wasn't visible within the specified timeout.
610
+ * @function isVisible
611
+ * @param {String|Element} locator - An element locator.
612
+ * @param {Number=} timeout - Timeout in milliseconds to wait for element to appear. Default is 60 seconds.
613
+ * @return {Boolean} True if element was found and it was visible. False otherwise.
614
+ * @example <caption>[javascript] Usage example</caption>
615
+ * web.init();//Opens browser session.
616
+ * web.open("www.yourwebsite.com");// Opens a website.
617
+ * web.isVisible("id=SaveButton");// Returns true if the element is displayed in page.
618
+ */
619
+ isVisible(locator: string | Element, timeout?: number | undefined): boolean;
620
+
621
+ /**
622
+ * @summary Makes hidden element visible.
623
+ * @description This a workaround command for situations which require manipulation of hidden
624
+ * elements, such as when using `web.type` command for file input fields which tend to be hidden.
625
+ * Specifically `makeVisible` will apply following styles to the specified element and all the
626
+ * parent elements:
627
+ * - visibility = 'visible' if set to 'hidden'
628
+ * - opacity = 1 if set to 0
629
+ * - display = 'block' if set to 'none'
630
+ * - width/height = 1px if set to 0.
631
+ * @function makeVisible
632
+ * @param {String|Element} locator - An element locator. If multiple elements match the locator, visibility
633
+ * is applied to all.
634
+ * @example <caption>[javascript] Usage example</caption>
635
+ * web.init();//Opens browser session.
636
+ * web.open("www.yourwebsite.com");// Opens a website.
637
+ * web.makeVisible("id=SaveButton");// Makes an invisible/hidden element to become visible.
638
+ */
639
+ makeVisible(locator: string | Element): void;
640
+
641
+ /**
642
+ * @summary Maximize Window.
643
+ * @function maximizeWindow
644
+ * @example <caption>[javascript] Usage example</caption>
645
+ * web.init();//Opens browser session.
646
+ * web.maximizeWindow();
647
+ */
648
+ maximizeWindow(): void;
649
+
650
+ /**
651
+ * @summary Minimize Window.
652
+ * @function minimizeWindow
653
+ * @example <caption>[javascript] Usage example</caption>
654
+ * web.init();//Opens browser session.
655
+ * web.minimizeWindow();
656
+ */
657
+ minimizeWindow(): void;
658
+
659
+ /**
660
+ * @summary Opens new tab.
661
+ * @description The `newWindow` command waits for the page to load before proceeding.
662
+ * @function newWindow
663
+ * @param {String} url - The URL to open; may be relative or absolute.
664
+ * @example <caption>[javascript] Usage example</caption>
665
+ * web.init();//Opens browser session.
666
+ * web.newWindow("www.yourwebsite.com");// Opens a website on new window.
667
+ */
668
+ newWindow(url: string): void;
669
+
670
+ /**
671
+ * @summary Opens an URL.
672
+ * @description The `open` command waits for the page to load before proceeding.
673
+ * @function open
674
+ * @param {String} url - The URL to open; may be relative or absolute.
675
+ * @example <caption>[javascript] Usage example</caption>
676
+ * web.init();//Opens browser session.
677
+ * web.open("www.yourwebsite.com");// Opens a website.
678
+ */
679
+ open(url: string): void;
680
+
681
+ /**
682
+ * @summary Pause test execution for the given amount of milliseconds.
683
+ * @function pause
684
+ * @param {Number} ms - Milliseconds to pause the execution for.
685
+ * @example <caption>[javascript] Usage example</caption>
686
+ * web.init();//Opens browser session.
687
+ * web.pause(10*1000);//Pauses the execution for 10 seconds (10000ms)
688
+ */
689
+ pause(ms: number): void;
690
+
691
+ /**
692
+ * @summary Points the mouse cursor over the specified element.
693
+ * @function point
694
+ * @param {String|Element} locator - An element locator. If the element is not visible, it will be scrolled into view.
695
+ * @param {Number=} xOffset - X offset to move to, relative to the top-left corner of the element.
696
+ If not specified, the mouse will move to the middle of the element.
697
+ * @param {Number=} yOffset - Y offset to move to, relative to the top-left corner of the element.
698
+ If not specified, the mouse will move to the middle of the element.
699
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
700
+ * @example <caption>[javascript] Usage example</caption>
701
+ * web.init();//Opens browser session.
702
+ * web.open("www.yourwebsite.com");// Opens a website.
703
+ * web.point("id=Selection");//Hovers a mouse over an element.
704
+ */
705
+ point(locator: string | Element, xOffset?: number | undefined, yOffset?: number | undefined, timeout?: number | undefined): void;
706
+
707
+ /**
708
+ * @summary Points the mouse cursor over the specified element.
709
+ * @description This method is similar to `web.point`, however it simulates the action using
710
+ * JavaScript instead of using WebDriver's functionality which doesn't work in all cases.
711
+ * @function pointJS
712
+ * @param {String|Element} locator - An element locator.
713
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
714
+ */
715
+ pointJS(locator: string | Element, timeout?: number | undefined): void;
716
+
717
+ /**
718
+ * @summary Causes the browser to reload the page.
719
+ * @function refresh
720
+ * @example <caption>[javascript] Usage example</caption>
721
+ * web.init();//Opens browser session.
722
+ * web.open("www.yourwebsite.com");// Opens a website.
723
+ * web.refresh();//Reloads the page
724
+ */
725
+ refresh(): void;
726
+
727
+ /**
728
+ * @summary Perform right click on an element.
729
+ * @function rightClick
730
+ * @param {String|Element} locator - An element locator.
731
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
732
+ * @example <caption>[javascript] Usage example</caption>
733
+ * web.init();
734
+ * web.open("www.yourwebsite.com");
735
+ * web.rightClick("id=someElement");
736
+ */
737
+ rightClick(locator: string | Element, timeout?: number | undefined): void;
738
+
739
+ /**
740
+ * @summary Perform right click on an element.
741
+ * @function rightClickActions
742
+ * @param {String|Element} locator - An element locator.
743
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
744
+ * @param {Number=} xOffset - x offset in pixels. Default is 0.
745
+ * @param {Number=} yOffset - y offset in pixels. Default is 0.
746
+ * @example <caption>[javascript] Usage example</caption>
747
+ * web.init();
748
+ * web.open("www.yourwebsite.com");
749
+ * web.rightClickActions("id=someElement", 10, -5);
750
+ */
751
+ rightClickActions(locator: string | Element, xOffset?: number | undefined, yOffset?: number | undefined, timeout?: number | undefined): Promise<any>;
752
+
753
+ /**
754
+ * @summary Scrolls the page or a container element to the location of the specified element.
755
+ * @function scrollToElement
756
+ * @param {String|Element} locator - An element locator.
757
+ * @param {Boolean=} alignToTop - If true, the top of the element will be aligned to the top of the
758
+ * visible area of the scrollable ancestor. This is the default.
759
+ * If false, the bottom of the element will be aligned to the bottom
760
+ * of the visible area of the scrollable ancestor.
761
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
762
+ * @example <caption>[javascript] Usage example</caption>
763
+ * web.init();//Opens browser session.
764
+ * web.open("www.yourwebsite.com");// Opens a website.
765
+ * web.scrollToElement("id=Button", true);// Scrolls to an element.
766
+ */
767
+ scrollToElement(locator: string | Element, alignToTop?: boolean | undefined, timeout?: number | undefined): void;
768
+
769
+ /**
770
+ * @summary Selects an option from a drop-down list using an option locator. This command works
771
+ * with multiple-choice lists as well.
772
+ * @description Option locator can be one of the following (No prefix is same as label matching):
773
+ * - `label=STRING` - Matches option based on the visible text.
774
+ * - `value=STRING` - Matches option based on its value.
775
+ * - `index=STRING` - Matches option based on its index. The index is 0-based.
776
+ * @function select
777
+ * @param {String} selectLocator - An element locator identifying a drop-down menu.
778
+ * @param {String} optionLocator - An option locator.
779
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
780
+ * @example <caption>[javascript] Usage example</caption>
781
+ * web.init();//Opens browser session.
782
+ * web.open("www.yourwebsite.com");// Opens a website.
783
+ * web.select("id=Selection","label=United States");// Selects an option from a list.
784
+ */
785
+ select(selectLocator: string, optionLocator: string, timeout?: number | undefined): void;
786
+
787
+ /**
788
+ * @summary Selects a frame or an iframe within the current window.
789
+ * @description Available frame locators:
790
+ * - `'parent'` - Select parent frame.
791
+ * - `'top'` - Select top window.
792
+ * - `NUMBER` - Select frame by its 0-based index.
793
+ * - `LOCATOR` - Locator identifying the frame (relative to the top window).
794
+ * Multiple locators can be passed in order to switch between nested frames.
795
+ * @function selectFrame
796
+ * @param {...String|Number} frameLocator - A locator identifying the frame or iframe. Or a series
797
+ * of locators.
798
+ * @example <caption>[javascript] Usage example</caption>
799
+ * web.init();//Opens browser session.
800
+ * web.open("www.yourwebsite.com");
801
+ * web.selectFrame("//iframe[@id='frame1']", "//iframe[@id='nested_frame']");
802
+ * web.click("id=SaveButton");//Clicks on element that exists in the second iframe
803
+ */
804
+ selectFrame(...args: (string | number)[]): void;
805
+
806
+ /**
807
+ * @summary Selects window. Once window has been selected, all commands go to that window.
808
+ * @description `windowLocator` can be:
809
+ * - `title=TITLE` Switch to the first window which matches the specified title. `TITLE` can be any of
810
+ * the supported string matching patterns (see top of the page). When using title locator, this command
811
+ * will wait for the window to appear first similarly to `waitForWindow` command.
812
+ * - `url=URL` Switch to the first window which matches the specified URL. `URL` can be any of
813
+ * the supported string matching patterns (see top of the page). When using url locator, this command
814
+ * will wait for the window to appear first similarly to `waitForWindow` command.
815
+ * - `windowHandle` Switch to a window using its unique handle.
816
+ * @function selectWindow
817
+ * @param {String=} windowLocator - Window locator.
818
+ * @param {Number=} timeout - Timeout in milliseconds when using 'title' window locating strategy.
819
+ * Default is 60 seconds.
820
+ * @return {String} windowHandle of the previously selected window.
821
+ * @example <caption>[javascript] Usage example</caption>
822
+ * web.init();//Opens browser session.
823
+ * web.open("www.yourwebsite.com");// Opens a website.
824
+ * web.selectWindow("title=Website");// Selects and focus a window.
825
+ */
826
+ selectWindow(windowLocator?: string | undefined, timeout?: number | undefined): string;
827
+
828
+ /**
829
+ * @summary Send a sequence of keyboard strokes to the active window or element.
830
+ * @description Refer to [Key Codes](https://w3c.github.io/webdriver/#keyboard-actions)
831
+ * for the list of supported raw keyboard key codes.
832
+ * @function sendKeys
833
+ * @param {(String|String[])} value - Sequence of key strokes to send. Can be either a string or an
834
+ * array of strings for sending raw key codes.
835
+ * @example <caption>[javascript] Usage example</caption>
836
+ * web.init();//Opens browser session.
837
+ * web.open("www.yourwebsite.com");// Opens a website.
838
+ * web.sendKeys("Hello World");
839
+ * web.sendKeys(["Backspace", "Backspace", "Enter"]); // send two Backspace key codes and Enter.
840
+ * // Unicode representation can be used directly as well:
841
+ * web.sendKeys("Hello World\uE003\uE003\uE007");
842
+ */
843
+ sendKeys(value: (string | string[])): void;
844
+
845
+ /**
846
+ * @summary Wait for Angular based app will be loaded
847
+ * @function setAutoWaitForAngular
848
+ * @param {Boolean} autoWaitForAngular - new autoWait value. Dafault is false;
849
+ * @param {String=} rootSelector - Selector for root element, need only for Angular 1
850
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
851
+ * @example <caption>[javascript] Usage example</caption>
852
+ * web.init();
853
+ * web.open("www.yourwebsite.com");
854
+ * web.setAutoWaitForAngular(true);
855
+ */
856
+ setAutoWaitForAngular(autoWaitForAngular?: boolean, rootSelector?: string | undefined, timeout?: number | undefined): void;
857
+
858
+ /**
859
+ * @summary Specifies the amount of time that Oxygen will wait for actions to complete.
860
+ * @description This includes the `open` command, `waitFor*` commands, and commands which wait
861
+ * for elements to appear in DOM or become visible before operating on them.
862
+ * If command wasn't able to complete within the specified period it will fail the
863
+ * test.
864
+ * The default time-out is 60 seconds.
865
+ * @function setTimeout
866
+ * @param {Number} timeout - A time-out in milliseconds.
867
+ * @example <caption>[javascript] Usage example</caption>
868
+ * web.init();//Opens browser session.
869
+ * web.open("www.yourwebsite.com");// Opens a website.
870
+ * web.setTimeout(60000);//Sets the time out to amount of milliseconds .
871
+ */
872
+ setTimeout(timeout: number): void;
873
+
874
+ /**
875
+ * @summary Sets the size of the outer browser window.
876
+ * @function setWindowSize
877
+ * @param {Number} width - Width in pixels.
878
+ * @param {Number} height - Height in pixels.
879
+ * @example <caption>[javascript] Usage example</caption>
880
+ * web.init();//Opens browser session.
881
+ * web.open("www.yourwebsite.com");// Opens a website.
882
+ * web.setWindowSize(100,40);//Sets the window size (width and height) in pixels.
883
+ */
884
+ setWindowSize(width: number, height: number): void;
885
+
886
+ /**
887
+ * @function takeScreenshot
888
+ * @summary Take a screenshot of the current page or screen and return it as base64 encoded string.
889
+ * @return {String} Screenshot image encoded as a base64 string.
890
+ * @example <caption>[javascript] Usage example</caption>
891
+ * web.init();
892
+ * web.open("www.yourwebsite.com");
893
+ * var ss = web.takeScreenshot();
894
+ * require("fs").writeFileSync("c:\\screenshot.png", ss, 'base64');
895
+ */
896
+ takeScreenshot(): string;
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
+ * @example <caption>[javascript] Usage example</caption>
907
+ * web.init();//Opens browser session.
908
+ * web.open("www.yourwebsite.com");// Opens a website.
909
+ * web.type("id=UserName","User1");//Types a string to field.
910
+ */
911
+ type(locator: string | Element, value: string, timeout?: number | undefined): void;
912
+
913
+ /**
914
+ * @summary Wait for Angular based app will be loaded
915
+ * @function waitForAngular
916
+ * @param {String=} rootSelector - Selector for root element, need only for Angular 1
917
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
918
+ * @example <caption>[javascript] Usage example</caption>
919
+ * web.init();
920
+ * web.open("www.yourwebsite.com");
921
+ * web.waitForAngular();
922
+ */
923
+ waitForAngular(rootSelector?: string | undefined, timeout?: number | undefined): void;
924
+
925
+ /**
926
+ * @summary Waits for element to become available in the DOM.
927
+ * @function waitForExist
928
+ * @param {String|Element} locator - An element locator.
929
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
930
+ * @example <caption>[javascript] Usage example</caption>
931
+ * web.init();//Opens browser session.
932
+ * web.open("www.yourwebsite.com");// Opens a website.
933
+ * web.waitForExist("id=UserName");//Waits for an element to exist in DOM.
934
+ */
935
+ waitForExist(locator: string | Element, timeout?: number | undefined): void;
936
+
937
+ /**
938
+ * @summary Waits for element to become interactable.
939
+ * @function waitForInteractable
940
+ * @param {String|Element} locator - An element locator.
941
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
942
+ * @example <caption>[javascript] Usage example</caption>
943
+ * web.init();//Opens browser session.
944
+ * web.open("www.yourwebsite.com");// Opens a website.
945
+ * web.waitForInteractable("id=UserName");//Waits for an element is clickable in DOM.
946
+ */
947
+ waitForInteractable(locator: string | Element, timeout?: number | undefined): void;
948
+
949
+ /**
950
+ * @summary Waits for element to become unavailable in the DOM.
951
+ * @function waitForNotExist
952
+ * @param {String|Element} locator - An element locator.
953
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
954
+ * @example <caption>[javascript] Usage example</caption>
955
+ * web.init();//Opens browser session.
956
+ * web.open("www.yourwebsite.com");// Opens a website.
957
+ * web.waitForNotExist("id=UserName");//Waits for an element to not exist in DOM.
958
+ */
959
+ waitForNotExist(locator: string | Element, timeout?: number | undefined): void;
960
+
961
+ /**
962
+ * @summary Waits for inner text of the given element to stop matching the specified pattern.
963
+ * @description Text pattern can be any of the supported
964
+ * string matching patterns(on the top of page).
965
+ * @function waitForNotText
966
+ * @param {String|Element} locator - An element locator.
967
+ * @param {String} pattern - Text pattern.
968
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
969
+ * @example <caption>[javascript] Usage example</caption>
970
+ * web.init();//Opens browser session.
971
+ * web.open("www.yourwebsite.com");// Opens a website.
972
+ * web.waitForNotText("id=Title","Website");//Waits for an element’s text to not match to expected string.
973
+ */
974
+ waitForNotText(locator: string | Element, pattern: string, timeout?: number | undefined): void;
975
+
976
+ /**
977
+ * @summary Waits for input element's value to stop matching the specified pattern.
978
+ * @description Value pattern can be any of the supported
979
+ * string matching patterns(on the top of page).
980
+ * @function waitForNotValue
981
+ * @param {String|Element} locator - An element locator.
982
+ * @param {String} pattern - Value pattern.
983
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
984
+ * @example <caption>[javascript] Usage example</caption>
985
+ * web.init();//Opens browser session.
986
+ * web.open("www.yourwebsite.com");// Opens a website.
987
+ * web.waitForNotValue("id=UserName","User");//Waits for an element’s value to not match to expected string.
988
+ */
989
+ waitForNotValue(locator: string | Element, pattern: string, timeout?: number | undefined): void;
990
+
991
+ /**
992
+ * @summary Waits for inner text of the given element to match the specified pattern.
993
+ * @description Text pattern can be any of the supported
994
+ * string matching patterns(on the top of page).
995
+ * @function waitForText
996
+ * @param {String|Element} locator - An element locator.
997
+ * @param {String} pattern - Text pattern.
998
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
999
+ * @example <caption>[javascript] Usage example</caption>
1000
+ * web.init();//Opens browser session.
1001
+ * web.open("www.yourwebsite.com");// Opens a website.
1002
+ * web.waitForText("id=Title","Website");//Waits for an element’s text to match to expected string.
1003
+ */
1004
+ waitForText(locator: string | Element, pattern: string, timeout?: number | undefined): void;
1005
+
1006
+ /**
1007
+ * @summary Waits for input element's value to match the specified pattern.
1008
+ * @description Value pattern can be any of the supported
1009
+ * string matching patterns(on the top of page).
1010
+ * @function waitForValue
1011
+ * @param {String|Element} locator - An element locator.
1012
+ * @param {String} pattern - Value pattern.
1013
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
1014
+ * @example <caption>[javascript] Usage example</caption>
1015
+ * web.init();//Opens browser session.
1016
+ * web.open("www.yourwebsite.com");// Opens a website.
1017
+ * web.waitForValue("id=Title","Website");//Waits for an element’s value to match to expected string.
1018
+ */
1019
+ waitForValue(locator: string | Element, pattern: string, timeout?: number | undefined): void;
1020
+
1021
+ /**
1022
+ * @summary Waits for element to become visible.
1023
+ * @function waitForVisible
1024
+ * @param {String|Element} locator - An element locator.
1025
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
1026
+ * @example <caption>[javascript] Usage example</caption>
1027
+ * web.init();//Opens browser session.
1028
+ * web.open("www.yourwebsite.com");// Opens a website.
1029
+ * web.waitForVisible("id=Title", 45*1000);//Waits for an element to be visible.
1030
+ */
1031
+ waitForVisible(locator: string | Element, timeout?: number | undefined): void;
1032
+
1033
+ /**
1034
+ * @summary Waits for a window to appear, but doesn't actually switches to it.
1035
+ * @description `windowLocator` can be:
1036
+ * - `title=TITLE` Wait for the first window which matches the specified title. `TITLE` can be
1037
+ * any of the supported string matching patterns(see top of the page).
1038
+ * - `url=URL` Wait for the first window which matches the specified URL. `URL` can be
1039
+ * any of the supported string matching patterns(see top of the page).
1040
+ * @function waitForWindow
1041
+ * @param {String} windowLocator - A window locator.
1042
+ * @param {Number=} timeout - Timeout in milliseconds. Default is 60 seconds.
1043
+ * @example <caption>[javascript] Usage example</caption>
1044
+ * web.init();//Opens browser session.
1045
+ * web.open("www.yourwebsite.com");// Opens a website.
1046
+ * web.waitForWindow("title=Website");//Waits for a window to appear.
1047
+ */
1048
+ waitForWindow(windowLocator: string, timeout?: number | undefined): void;
1049
+ }
1050
+ }