codeceptjs 3.4.1 → 3.5.1-2.beta.7

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 (281) hide show
  1. package/README.md +31 -30
  2. package/bin/codecept.js +1 -1
  3. package/lib/actor.js +6 -3
  4. package/lib/ai.js +180 -0
  5. package/lib/cli.js +13 -3
  6. package/lib/codecept.js +8 -0
  7. package/lib/colorUtils.js +10 -0
  8. package/lib/command/definitions.js +2 -7
  9. package/lib/command/dryRun.js +11 -2
  10. package/lib/command/generate.js +46 -3
  11. package/lib/command/info.js +24 -0
  12. package/lib/command/init.js +64 -6
  13. package/lib/command/interactive.js +15 -1
  14. package/lib/command/run-multiple/collection.js +17 -5
  15. package/lib/command/run-multiple.js +4 -2
  16. package/lib/command/run-workers.js +68 -5
  17. package/lib/command/run.js +7 -0
  18. package/lib/command/workers/runTests.js +39 -0
  19. package/lib/container.js +13 -3
  20. package/lib/data/context.js +14 -6
  21. package/lib/event.js +4 -0
  22. package/lib/helper/ApiDataFactory.js +2 -1
  23. package/lib/helper/Appium.js +116 -29
  24. package/lib/helper/Expect.js +422 -0
  25. package/lib/helper/FileSystem.js +1 -1
  26. package/lib/helper/GraphQL.js +25 -0
  27. package/lib/helper/JSONResponse.js +4 -4
  28. package/lib/helper/Nightmare.js +10 -5
  29. package/lib/helper/OpenAI.js +126 -0
  30. package/lib/helper/Playwright.js +1298 -229
  31. package/lib/helper/Protractor.js +12 -7
  32. package/lib/helper/Puppeteer.js +204 -64
  33. package/lib/helper/REST.js +15 -5
  34. package/lib/helper/TestCafe.js +45 -10
  35. package/lib/helper/WebDriver.js +252 -83
  36. package/lib/helper/errors/ElementNotFound.js +2 -1
  37. package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
  38. package/lib/helper/scripts/blurElement.js +17 -0
  39. package/lib/helper/scripts/focusElement.js +17 -0
  40. package/lib/helper/scripts/highlightElement.js +20 -0
  41. package/lib/html.js +258 -0
  42. package/lib/interfaces/bdd.js +1 -1
  43. package/lib/interfaces/gherkin.js +37 -3
  44. package/lib/interfaces/scenarioConfig.js +1 -0
  45. package/lib/listener/retry.js +2 -1
  46. package/lib/locator.js +17 -4
  47. package/lib/mochaFactory.js +2 -1
  48. package/lib/output.js +1 -1
  49. package/lib/pause.js +78 -19
  50. package/lib/plugin/autoLogin.js +45 -10
  51. package/lib/plugin/debugErrors.js +67 -0
  52. package/lib/plugin/fakerTransform.js +4 -6
  53. package/lib/plugin/heal.js +209 -0
  54. package/lib/plugin/retryFailedStep.js +10 -1
  55. package/lib/plugin/retryTo.js +2 -4
  56. package/lib/plugin/screenshotOnFail.js +11 -2
  57. package/lib/plugin/selenoid.js +6 -1
  58. package/lib/plugin/standardActingHelpers.js +0 -2
  59. package/lib/plugin/stepByStepReport.js +2 -2
  60. package/lib/plugin/tryTo.js +5 -7
  61. package/lib/plugin/wdio.js +0 -1
  62. package/lib/recorder.js +22 -11
  63. package/lib/secret.js +5 -4
  64. package/lib/session.js +1 -1
  65. package/lib/step.js +36 -12
  66. package/lib/ui.js +5 -3
  67. package/lib/utils.js +22 -1
  68. package/lib/workers.js +83 -10
  69. package/package.json +117 -95
  70. package/translations/de-DE.js +5 -0
  71. package/translations/fr-FR.js +14 -1
  72. package/translations/it-IT.js +1 -0
  73. package/translations/ja-JP.js +14 -9
  74. package/translations/pl-PL.js +5 -0
  75. package/translations/pt-BR.js +1 -0
  76. package/translations/ru-RU.js +1 -0
  77. package/translations/zh-CN.js +5 -0
  78. package/translations/zh-TW.js +5 -0
  79. package/typings/index.d.ts +51 -15
  80. package/typings/promiseBasedTypes.d.ts +864 -802
  81. package/typings/types.d.ts +1339 -744
  82. package/CHANGELOG.md +0 -2427
  83. package/docs/advanced.md +0 -351
  84. package/docs/api.md +0 -323
  85. package/docs/basics.md +0 -980
  86. package/docs/bdd.md +0 -535
  87. package/docs/best.md +0 -237
  88. package/docs/books.md +0 -37
  89. package/docs/bootstrap.md +0 -135
  90. package/docs/build/ApiDataFactory.js +0 -409
  91. package/docs/build/Appium.js +0 -1938
  92. package/docs/build/FileSystem.js +0 -228
  93. package/docs/build/GraphQL.js +0 -204
  94. package/docs/build/GraphQLDataFactory.js +0 -309
  95. package/docs/build/JSONResponse.js +0 -338
  96. package/docs/build/Mochawesome.js +0 -71
  97. package/docs/build/Nightmare.js +0 -2145
  98. package/docs/build/Playwright.js +0 -3986
  99. package/docs/build/Polly.js +0 -42
  100. package/docs/build/Protractor.js +0 -2699
  101. package/docs/build/Puppeteer.js +0 -3710
  102. package/docs/build/REST.js +0 -334
  103. package/docs/build/SeleniumWebdriver.js +0 -76
  104. package/docs/build/TestCafe.js +0 -2057
  105. package/docs/build/WebDriver.js +0 -4017
  106. package/docs/changelog.md +0 -2436
  107. package/docs/commands.md +0 -254
  108. package/docs/community-helpers.md +0 -58
  109. package/docs/configuration.md +0 -157
  110. package/docs/continuous-integration.md +0 -22
  111. package/docs/custom-helpers.md +0 -306
  112. package/docs/data.md +0 -375
  113. package/docs/detox.md +0 -235
  114. package/docs/docker.md +0 -137
  115. package/docs/email.md +0 -183
  116. package/docs/examples.md +0 -149
  117. package/docs/helpers/ApiDataFactory.md +0 -266
  118. package/docs/helpers/Appium.md +0 -1312
  119. package/docs/helpers/Detox.md +0 -586
  120. package/docs/helpers/FileSystem.md +0 -152
  121. package/docs/helpers/GraphQL.md +0 -130
  122. package/docs/helpers/GraphQLDataFactory.md +0 -226
  123. package/docs/helpers/JSONResponse.md +0 -254
  124. package/docs/helpers/Mochawesome.md +0 -8
  125. package/docs/helpers/MockRequest.md +0 -377
  126. package/docs/helpers/Nightmare.md +0 -1256
  127. package/docs/helpers/Playwright.md +0 -2208
  128. package/docs/helpers/Polly.md +0 -44
  129. package/docs/helpers/Puppeteer-firefox.md +0 -86
  130. package/docs/helpers/Puppeteer.md +0 -2141
  131. package/docs/helpers/REST.md +0 -217
  132. package/docs/helpers/TestCafe.md +0 -1222
  133. package/docs/helpers/WebDriver.md +0 -2319
  134. package/docs/hooks.md +0 -340
  135. package/docs/index.md +0 -111
  136. package/docs/installation.md +0 -75
  137. package/docs/internal-api.md +0 -265
  138. package/docs/locators.md +0 -331
  139. package/docs/mobile-react-native-locators.md +0 -67
  140. package/docs/mobile.md +0 -297
  141. package/docs/nightmare.md +0 -223
  142. package/docs/pageobjects.md +0 -291
  143. package/docs/parallel.md +0 -232
  144. package/docs/playwright.md +0 -609
  145. package/docs/plugins.md +0 -1171
  146. package/docs/puppeteer.md +0 -316
  147. package/docs/quickstart.md +0 -163
  148. package/docs/react.md +0 -69
  149. package/docs/reports.md +0 -392
  150. package/docs/secrets.md +0 -30
  151. package/docs/shadow.md +0 -68
  152. package/docs/shared/keys.mustache +0 -31
  153. package/docs/shared/react.mustache +0 -1
  154. package/docs/testcafe.md +0 -174
  155. package/docs/translation.md +0 -247
  156. package/docs/tutorial.md +0 -271
  157. package/docs/typescript.md +0 -180
  158. package/docs/ui.md +0 -59
  159. package/docs/videos.md +0 -28
  160. package/docs/visual.md +0 -202
  161. package/docs/vue.md +0 -121
  162. package/docs/webapi/amOnPage.mustache +0 -11
  163. package/docs/webapi/appendField.mustache +0 -9
  164. package/docs/webapi/attachFile.mustache +0 -12
  165. package/docs/webapi/checkOption.mustache +0 -13
  166. package/docs/webapi/clearCookie.mustache +0 -10
  167. package/docs/webapi/clearField.mustache +0 -9
  168. package/docs/webapi/click.mustache +0 -25
  169. package/docs/webapi/clickLink.mustache +0 -8
  170. package/docs/webapi/closeCurrentTab.mustache +0 -7
  171. package/docs/webapi/closeOtherTabs.mustache +0 -8
  172. package/docs/webapi/dontSee.mustache +0 -11
  173. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
  174. package/docs/webapi/dontSeeCookie.mustache +0 -8
  175. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
  176. package/docs/webapi/dontSeeElement.mustache +0 -8
  177. package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
  178. package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
  179. package/docs/webapi/dontSeeInField.mustache +0 -11
  180. package/docs/webapi/dontSeeInSource.mustache +0 -8
  181. package/docs/webapi/dontSeeInTitle.mustache +0 -8
  182. package/docs/webapi/doubleClick.mustache +0 -13
  183. package/docs/webapi/downloadFile.mustache +0 -12
  184. package/docs/webapi/dragAndDrop.mustache +0 -9
  185. package/docs/webapi/dragSlider.mustache +0 -11
  186. package/docs/webapi/executeAsyncScript.mustache +0 -24
  187. package/docs/webapi/executeScript.mustache +0 -26
  188. package/docs/webapi/fillField.mustache +0 -16
  189. package/docs/webapi/forceClick.mustache +0 -28
  190. package/docs/webapi/forceRightClick.mustache +0 -18
  191. package/docs/webapi/grabAllWindowHandles.mustache +0 -7
  192. package/docs/webapi/grabAttributeFrom.mustache +0 -10
  193. package/docs/webapi/grabAttributeFromAll.mustache +0 -9
  194. package/docs/webapi/grabBrowserLogs.mustache +0 -9
  195. package/docs/webapi/grabCookie.mustache +0 -11
  196. package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
  197. package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
  198. package/docs/webapi/grabCurrentUrl.mustache +0 -9
  199. package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
  200. package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
  201. package/docs/webapi/grabElementBoundingRect.mustache +0 -20
  202. package/docs/webapi/grabGeoLocation.mustache +0 -8
  203. package/docs/webapi/grabHTMLFrom.mustache +0 -10
  204. package/docs/webapi/grabHTMLFromAll.mustache +0 -9
  205. package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
  206. package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
  207. package/docs/webapi/grabPageScrollPosition.mustache +0 -8
  208. package/docs/webapi/grabPopupText.mustache +0 -5
  209. package/docs/webapi/grabSource.mustache +0 -8
  210. package/docs/webapi/grabTextFrom.mustache +0 -10
  211. package/docs/webapi/grabTextFromAll.mustache +0 -9
  212. package/docs/webapi/grabTitle.mustache +0 -8
  213. package/docs/webapi/grabValueFrom.mustache +0 -9
  214. package/docs/webapi/grabValueFromAll.mustache +0 -8
  215. package/docs/webapi/moveCursorTo.mustache +0 -12
  216. package/docs/webapi/openNewTab.mustache +0 -7
  217. package/docs/webapi/pressKey.mustache +0 -12
  218. package/docs/webapi/pressKeyDown.mustache +0 -12
  219. package/docs/webapi/pressKeyUp.mustache +0 -12
  220. package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
  221. package/docs/webapi/refreshPage.mustache +0 -6
  222. package/docs/webapi/resizeWindow.mustache +0 -6
  223. package/docs/webapi/rightClick.mustache +0 -14
  224. package/docs/webapi/saveElementScreenshot.mustache +0 -10
  225. package/docs/webapi/saveScreenshot.mustache +0 -12
  226. package/docs/webapi/say.mustache +0 -10
  227. package/docs/webapi/scrollIntoView.mustache +0 -11
  228. package/docs/webapi/scrollPageToBottom.mustache +0 -6
  229. package/docs/webapi/scrollPageToTop.mustache +0 -6
  230. package/docs/webapi/scrollTo.mustache +0 -12
  231. package/docs/webapi/see.mustache +0 -11
  232. package/docs/webapi/seeAttributesOnElements.mustache +0 -9
  233. package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
  234. package/docs/webapi/seeCookie.mustache +0 -8
  235. package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
  236. package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
  237. package/docs/webapi/seeElement.mustache +0 -8
  238. package/docs/webapi/seeElementInDOM.mustache +0 -8
  239. package/docs/webapi/seeInCurrentUrl.mustache +0 -8
  240. package/docs/webapi/seeInField.mustache +0 -12
  241. package/docs/webapi/seeInPopup.mustache +0 -8
  242. package/docs/webapi/seeInSource.mustache +0 -7
  243. package/docs/webapi/seeInTitle.mustache +0 -8
  244. package/docs/webapi/seeNumberOfElements.mustache +0 -11
  245. package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
  246. package/docs/webapi/seeTextEquals.mustache +0 -9
  247. package/docs/webapi/seeTitleEquals.mustache +0 -8
  248. package/docs/webapi/selectOption.mustache +0 -21
  249. package/docs/webapi/setCookie.mustache +0 -16
  250. package/docs/webapi/setGeoLocation.mustache +0 -12
  251. package/docs/webapi/switchTo.mustache +0 -9
  252. package/docs/webapi/switchToNextTab.mustache +0 -10
  253. package/docs/webapi/switchToPreviousTab.mustache +0 -10
  254. package/docs/webapi/type.mustache +0 -18
  255. package/docs/webapi/uncheckOption.mustache +0 -13
  256. package/docs/webapi/wait.mustache +0 -8
  257. package/docs/webapi/waitForClickable.mustache +0 -11
  258. package/docs/webapi/waitForDetached.mustache +0 -10
  259. package/docs/webapi/waitForElement.mustache +0 -11
  260. package/docs/webapi/waitForEnabled.mustache +0 -6
  261. package/docs/webapi/waitForFunction.mustache +0 -17
  262. package/docs/webapi/waitForInvisible.mustache +0 -10
  263. package/docs/webapi/waitForText.mustache +0 -13
  264. package/docs/webapi/waitForValue.mustache +0 -10
  265. package/docs/webapi/waitForVisible.mustache +0 -10
  266. package/docs/webapi/waitInUrl.mustache +0 -9
  267. package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
  268. package/docs/webapi/waitToHide.mustache +0 -10
  269. package/docs/webapi/waitUrlEquals.mustache +0 -10
  270. package/docs/webdriver.md +0 -657
  271. package/docs/wiki/Books-&-Posts.md +0 -27
  272. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -49
  273. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -29
  274. package/docs/wiki/Examples.md +0 -139
  275. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  276. package/docs/wiki/Home.md +0 -16
  277. package/docs/wiki/Release-Process.md +0 -24
  278. package/docs/wiki/Roadmap.md +0 -23
  279. package/docs/wiki/Tests.md +0 -1393
  280. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  281. package/docs/wiki/Videos.md +0 -19
@@ -1,2319 +0,0 @@
1
- ---
2
- permalink: /helpers/WebDriver
3
- editLink: false
4
- sidebar: auto
5
- title: WebDriver
6
- ---
7
-
8
- <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
9
-
10
- ## WebDriver
11
-
12
- **Extends Helper**
13
-
14
- WebDriver helper which wraps [webdriverio][1] library to
15
- manipulate browser using Selenium WebDriver or PhantomJS.
16
-
17
- WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver][2] for more details.
18
-
19
-
20
-
21
- ## Configuration
22
-
23
- This helper should be configured in codecept.conf.js
24
-
25
- Type: [object][16]
26
-
27
- ### Properties
28
-
29
- - `url` **[string][17]** base url of website to be tested.
30
- - `browser` **[string][17]** browser in which to perform testing.
31
- - `basicAuth` **[string][17]?** (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
32
- - `host` **[string][17]?** WebDriver host to connect.
33
- - `port` **[number][20]?** WebDriver port to connect.
34
- - `protocol` **[string][17]?** protocol for WebDriver server.
35
- - `path` **[string][17]?** path to WebDriver server.
36
- - `restart` **[boolean][29]?** restart browser between tests.
37
- - `smartWait` **([boolean][29] | [number][20])?** **enables [SmartWait][33]**; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000.
38
- - `disableScreenshots` **[boolean][29]?** don't save screenshots on failure.
39
- - `fullPageScreenshots` **[boolean][29]?** (optional - make full page screenshots on failure.
40
- - `uniqueScreenshotNames` **[boolean][29]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
41
- - `keepBrowserState` **[boolean][29]?** keep browser state between tests when `restart` is set to false.
42
- - `keepCookies` **[boolean][29]?** keep cookies between tests when `restart` set to false.
43
- - `windowSize` **[string][17]?** default window size. Set to `maximize` or a dimension in the format `640x480`.
44
- - `waitForTimeout` **[number][20]?** sets default wait time in _ms_ for all `wait*` functions.
45
- - `desiredCapabilities` **[object][16]?** Selenium's [desired capabilities][6].
46
- - `manualStart` **[boolean][29]?** do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
47
- - `timeouts` **[object][16]?** [WebDriver timeouts][34] defined as hash.
48
-
49
-
50
-
51
- Example:
52
-
53
- ```js
54
- {
55
- helpers: {
56
- WebDriver : {
57
- smartWait: 5000,
58
- browser: "chrome",
59
- restart: false,
60
- windowSize: "maximize",
61
- timeouts: {
62
- "script": 60000,
63
- "page load": 10000
64
- }
65
- }
66
- }
67
- }
68
- ```
69
-
70
- Example with basic authentication
71
-
72
- ```js
73
- {
74
- helpers: {
75
- WebDriver : {
76
- smartWait: 5000,
77
- browser: "chrome",
78
- basicAuth: {username: 'username', password: 'password'},
79
- restart: false,
80
- windowSize: "maximize",
81
- timeouts: {
82
- "script": 60000,
83
- "page load": 10000
84
- }
85
- }
86
- }
87
- }
88
- ```
89
-
90
- Additional configuration params can be used from [webdriverio
91
- website][3].
92
-
93
- ### Headless Chrome
94
-
95
- ```js
96
- {
97
- helpers: {
98
- WebDriver : {
99
- url: "http://localhost",
100
- browser: "chrome",
101
- desiredCapabilities: {
102
- chromeOptions: {
103
- args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
104
- }
105
- }
106
- }
107
- }
108
- }
109
- ```
110
-
111
- ### Internet Explorer
112
-
113
- Additional configuration params can be used from [IE options][4]
114
-
115
- ```js
116
- {
117
- helpers: {
118
- WebDriver : {
119
- url: "http://localhost",
120
- browser: "internet explorer",
121
- desiredCapabilities: {
122
- ieOptions: {
123
- "ie.browserCommandLineSwitches": "-private",
124
- "ie.usePerProcessProxy": true,
125
- "ie.ensureCleanSession": true,
126
- }
127
- }
128
- }
129
- }
130
- }
131
- ```
132
-
133
- ### Selenoid Options
134
-
135
- [Selenoid][5] is a modern way to run Selenium inside Docker containers.
136
- Selenoid is easy to set up and provides more features than original Selenium Server. Use `selenoidOptions` to set Selenoid capabilities
137
-
138
- ```js
139
- {
140
- helpers: {
141
- WebDriver : {
142
- url: "http://localhost",
143
- browser: "chrome",
144
- desiredCapabilities: {
145
- selenoidOptions: {
146
- enableVNC: true,
147
- }
148
- }
149
- }
150
- }
151
- }
152
- ```
153
-
154
- ### Connect Through proxy
155
-
156
- CodeceptJS also provides flexible options when you want to execute tests to Selenium servers through proxy. You will
157
- need to update the `helpers.WebDriver.capabilities.proxy` key.
158
-
159
- ```js
160
- {
161
- helpers: {
162
- WebDriver: {
163
- capabilities: {
164
- proxy: {
165
- "proxyType": "manual|pac",
166
- "proxyAutoconfigUrl": "URL TO PAC FILE",
167
- "httpProxy": "PROXY SERVER",
168
- "sslProxy": "PROXY SERVER",
169
- "ftpProxy": "PROXY SERVER",
170
- "socksProxy": "PROXY SERVER",
171
- "socksUsername": "USERNAME",
172
- "socksPassword": "PASSWORD",
173
- "noProxy": "BYPASS ADDRESSES"
174
- }
175
- }
176
- }
177
- }
178
- }
179
- ```
180
-
181
- For example,
182
-
183
- ```js
184
- {
185
- helpers: {
186
- WebDriver: {
187
- capabilities: {
188
- proxy: {
189
- "proxyType": "manual",
190
- "httpProxy": "http://corporate.proxy:8080",
191
- "socksUsername": "codeceptjs",
192
- "socksPassword": "secret",
193
- "noProxy": "127.0.0.1,localhost"
194
- }
195
- }
196
- }
197
- }
198
- }
199
- ```
200
-
201
- Please refer to [Selenium - Proxy Object][6] for more
202
- information.
203
-
204
- ### Cloud Providers
205
-
206
- WebDriver makes it possible to execute tests against services like `Sauce Labs` `BrowserStack` `TestingBot`
207
- Check out their documentation on [available parameters][7]
208
-
209
- Connecting to `BrowserStack` and `Sauce Labs` is simple. All you need to do
210
- is set the `user` and `key` parameters. WebDriver automatically know which
211
- service provider to connect to.
212
-
213
- ```js
214
- {
215
- helpers:{
216
- WebDriver: {
217
- url: "YOUR_DESIRED_HOST",
218
- user: "YOUR_BROWSERSTACK_USER",
219
- key: "YOUR_BROWSERSTACK_KEY",
220
- capabilities: {
221
- "browserName": "chrome",
222
-
223
- // only set this if you're using BrowserStackLocal to test a local domain
224
- // "browserstack.local": true,
225
-
226
- // set this option to tell browserstack to provide addition debugging info
227
- // "browserstack.debug": true,
228
- }
229
- }
230
- }
231
- }
232
- ```
233
-
234
- #### SauceLabs
235
-
236
- SauceLabs can be configured via wdio service, which should be installed additionally:
237
-
238
- npm i @wdio/sauce-service --save
239
-
240
- It is important to make sure it is compatible with current webdriverio version.
241
-
242
- Enable `wdio` plugin in plugins list and add `sauce` service:
243
-
244
- ```js
245
- plugins: {
246
- wdio: {
247
- enabled: true,
248
- services: ['sauce'],
249
- user: ... ,// saucelabs username
250
- key: ... // saucelabs api key
251
- // additional config, from sauce service
252
- }
253
- }
254
- ```
255
-
256
- See [complete reference on webdriver.io][8].
257
-
258
- > Alternatively, use [codeceptjs-saucehelper][9] for better reporting.
259
-
260
- #### BrowserStack
261
-
262
- BrowserStack can be configured via wdio service, which should be installed additionally:
263
-
264
- npm i @wdio/browserstack-service --save
265
-
266
- It is important to make sure it is compatible with current webdriverio version.
267
-
268
- Enable `wdio` plugin in plugins list and add `browserstack` service:
269
-
270
- ```js
271
- plugins: {
272
- wdio: {
273
- enabled: true,
274
- services: ['browserstack'],
275
- user: ... ,// browserstack username
276
- key: ... // browserstack api key
277
- // additional config, from browserstack service
278
- }
279
- }
280
- ```
281
-
282
- See [complete reference on webdriver.io][10].
283
-
284
- > Alternatively, use [codeceptjs-bshelper][11] for better reporting.
285
-
286
- #### TestingBot
287
-
288
- > **Recommended**: use official [TestingBot Helper][12].
289
-
290
- Alternatively, TestingBot can be configured via wdio service, which should be installed additionally:
291
-
292
- npm i @wdio/testingbot-service --save
293
-
294
- It is important to make sure it is compatible with current webdriverio version.
295
-
296
- Enable `wdio` plugin in plugins list and add `testingbot` service:
297
-
298
- ```js
299
- plugins: {
300
- wdio: {
301
- enabled: true,
302
- services: ['testingbot'],
303
- user: ... ,// testingbot key
304
- key: ... // testingbot secret
305
- // additional config, from testingbot service
306
- }
307
- }
308
- ```
309
-
310
- See [complete reference on webdriver.io][13].
311
-
312
- #### Applitools
313
-
314
- Visual testing via Applitools service
315
-
316
- > Use [CodeceptJS Applitools Helper][14] with Applitools wdio service.
317
-
318
- ### Multiremote Capabilities
319
-
320
- This is a work in progress but you can control two browsers at a time right out of the box.
321
- Individual control is something that is planned for a later version.
322
-
323
- Here is the [webdriverio docs][15] on the subject
324
-
325
- ```js
326
- {
327
- helpers: {
328
- WebDriver: {
329
- "multiremote": {
330
- "MyChrome": {
331
- "desiredCapabilities": {
332
- "browserName": "chrome"
333
- }
334
- },
335
- "MyFirefox": {
336
- "desiredCapabilities": {
337
- "browserName": "firefox"
338
- }
339
- }
340
- }
341
- }
342
- }
343
- }
344
- ```
345
-
346
- ## Access From Helpers
347
-
348
- Receive a WebDriver client from a custom helper by accessing `browser` property:
349
-
350
- ```js
351
- const { WebDriver } = this.helpers;
352
- const browser = WebDriver.browser
353
- ```
354
-
355
- ## Methods
356
-
357
- ### Parameters
358
-
359
- - `config`
360
-
361
- ### _isShadowLocator
362
-
363
- Check if locator is type of "Shadow"
364
-
365
- #### Parameters
366
-
367
- - `locator` **[object][16]**
368
-
369
- ### _locate
370
-
371
- Get elements by different locator types, including strict locator.
372
- Should be used in custom helpers:
373
-
374
- ```js
375
- this.helpers['WebDriver']._locate({name: 'password'}).then //...
376
- ```
377
-
378
- #### Parameters
379
-
380
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
381
- - `smartWait`
382
-
383
- ### _locateCheckable
384
-
385
- Find a checkbox by providing human readable text:
386
-
387
- ```js
388
- this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').then // ...
389
- ```
390
-
391
- #### Parameters
392
-
393
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
394
-
395
- ### _locateClickable
396
-
397
- Find a clickable element by providing human readable text:
398
-
399
- ```js
400
- const els = await this.helpers.WebDriver._locateClickable('Next page');
401
- const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages');
402
- ```
403
-
404
- #### Parameters
405
-
406
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
407
- - `context`
408
-
409
- ### _locateFields
410
-
411
- Find field elements by providing human readable text:
412
-
413
- ```js
414
- this.helpers['WebDriver']._locateFields('Your email').then // ...
415
- ```
416
-
417
- #### Parameters
418
-
419
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
420
-
421
- ### _locateShadow
422
-
423
- Locate Element within the Shadow Dom
424
-
425
- #### Parameters
426
-
427
- - `locator` **[object][16]**
428
-
429
- ### _smartWait
430
-
431
- Smart Wait to locate an element
432
-
433
- #### Parameters
434
-
435
- - `locator` **[object][16]**
436
-
437
- ### acceptPopup
438
-
439
- Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
440
- Don't confuse popups with modal windows, as created by [various
441
- libraries][18].
442
-
443
- ### amOnPage
444
-
445
- Opens a web page in a browser. Requires relative or absolute url.
446
- If url starts with `/`, opens a web page of a site defined in `url` config parameter.
447
-
448
- ```js
449
- I.amOnPage('/'); // opens main page of website
450
- I.amOnPage('https://github.com'); // opens github
451
- I.amOnPage('/login'); // opens a login page
452
- ```
453
-
454
- #### Parameters
455
-
456
- - `url` **[string][17]** url path or global url.
457
-
458
- Returns **void** automatically synchronized promise with recorder #!
459
-
460
- ### appendField
461
-
462
- Appends text to a input field or textarea.
463
- Field is located by name, label, CSS or XPath
464
-
465
- ```js
466
- I.appendField('#myTextField', 'appended');
467
- ```
468
-
469
- #### Parameters
470
-
471
- - `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator
472
- - `value` **[string][17]** text value to append.
473
- ⚠️ returns a _promise_ which is synchronized internally by recorder
474
-
475
-
476
- This action supports [React locators](https://codecept.io/react#locators)
477
-
478
-
479
- ### attachFile
480
-
481
- Attaches a file to element located by label, name, CSS or XPath
482
- Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
483
- File will be uploaded to remote system (if tests are running remotely).
484
-
485
- ```js
486
- I.attachFile('Avatar', 'data/avatar.jpg');
487
- I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
488
- ```
489
-
490
- #### Parameters
491
-
492
- - `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
493
- - `pathToFile` **[string][17]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
494
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested
495
-
496
- ### cancelPopup
497
-
498
- Dismisses the active JavaScript popup, as created by window.alert|window.confirm|window.prompt.
499
-
500
- ### checkOption
501
-
502
- Selects a checkbox or radio button.
503
- Element is located by label or name or CSS or XPath.
504
-
505
- The second parameter is a context (CSS or XPath locator) to narrow the search.
506
-
507
- ```js
508
- I.checkOption('#agree');
509
- I.checkOption('I Agree to Terms and Conditions');
510
- I.checkOption('agree', '//form');
511
- ```
512
-
513
- #### Parameters
514
-
515
- - `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
516
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
517
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested
518
-
519
- ### clearCookie
520
-
521
- Clears a cookie by name,
522
- if none provided clears all cookies.
523
-
524
- ```js
525
- I.clearCookie();
526
- I.clearCookie('test');
527
- ```
528
-
529
- #### Parameters
530
-
531
- - `cookie` **[string][17]?** (optional, `null` by default) cookie name
532
- ⚠️ returns a _promise_ which is synchronized internally by recorder
533
-
534
- ### clearField
535
-
536
- Clears a `<textarea>` or text `<input>` element's value.
537
-
538
- ```js
539
- I.clearField('Email');
540
- I.clearField('user[email]');
541
- I.clearField('#email');
542
- ```
543
-
544
- #### Parameters
545
-
546
- - `field`
547
- - `editable` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
548
- ⚠️ returns a _promise_ which is synchronized internally by recorder.
549
-
550
- ### click
551
-
552
- Perform a click on a link or a button, given by a locator.
553
- If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
554
- For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
555
- For images, the "alt" attribute and inner text of any parent links are searched.
556
-
557
- The second parameter is a context (CSS or XPath locator) to narrow the search.
558
-
559
- ```js
560
- // simple link
561
- I.click('Logout');
562
- // button of form
563
- I.click('Submit');
564
- // CSS button
565
- I.click('#form input[type=submit]');
566
- // XPath
567
- I.click('//form/*[@type=submit]');
568
- // link in context
569
- I.click('Logout', '#nav');
570
- // using strict locator
571
- I.click({css: 'nav a.login'});
572
- ```
573
-
574
- #### Parameters
575
-
576
- - `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
577
- - `context` **([string][17]? | [object][16] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
578
- ⚠️ returns a _promise_ which is synchronized internally by recorder
579
-
580
-
581
- This action supports [React locators](https://codecept.io/react#locators)
582
-
583
-
584
- ### closeCurrentTab
585
-
586
- Close current tab.
587
-
588
- ```js
589
- I.closeCurrentTab();
590
- ```
591
-
592
- ⚠️ returns a _promise_ which is synchronized internally by recorder
593
-
594
- ### closeOtherTabs
595
-
596
- Close all tabs except for the current one.
597
-
598
- ```js
599
- I.closeOtherTabs();
600
- ```
601
-
602
- ⚠️ returns a _promise_ which is synchronized internally by recorder
603
-
604
- ### defineTimeout
605
-
606
- Set [WebDriver timeouts][19] in realtime.
607
-
608
- Timeouts are expected to be passed as object:
609
-
610
- ```js
611
- I.defineTimeout({ script: 5000 });
612
- I.defineTimeout({ implicit: 10000, pageLoad: 10000, script: 5000 });
613
- ```
614
-
615
- #### Parameters
616
-
617
- - `timeouts` **any** WebDriver timeouts object.
618
-
619
- ### dontSee
620
-
621
- Opposite to `see`. Checks that a text is not present on a page.
622
- Use context parameter to narrow down the search.
623
-
624
- ```js
625
- I.dontSee('Login'); // assume we are already logged in.
626
- I.dontSee('Login', '.nav'); // no login inside .nav element
627
- ```
628
-
629
- #### Parameters
630
-
631
- - `text` **[string][17]** which is not present.
632
- - `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
633
- ⚠️ returns a _promise_ which is synchronized internally by recorder
634
-
635
-
636
- This action supports [React locators](https://codecept.io/react#locators)
637
-
638
-
639
- ### dontSeeCheckboxIsChecked
640
-
641
- Verifies that the specified checkbox is not checked.
642
-
643
- ```js
644
- I.dontSeeCheckboxIsChecked('#agree'); // located by ID
645
- I.dontSeeCheckboxIsChecked('I agree to terms'); // located by label
646
- I.dontSeeCheckboxIsChecked('agree'); // located by name
647
- ```
648
-
649
- #### Parameters
650
-
651
- - `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
652
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested
653
-
654
- ### dontSeeCookie
655
-
656
- Checks that cookie with given name does not exist.
657
-
658
- ```js
659
- I.dontSeeCookie('auth'); // no auth cookie
660
- ```
661
-
662
- #### Parameters
663
-
664
- - `name` **[string][17]** cookie name.
665
- ⚠️ returns a _promise_ which is synchronized internally by recorder
666
-
667
- ### dontSeeCurrentUrlEquals
668
-
669
- Checks that current url is not equal to provided one.
670
- If a relative url provided, a configured url will be prepended to it.
671
-
672
- ```js
673
- I.dontSeeCurrentUrlEquals('/login'); // relative url are ok
674
- I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
675
- ```
676
-
677
- #### Parameters
678
-
679
- - `url` **[string][17]** value to check.
680
- ⚠️ returns a _promise_ which is synchronized internally by recorder
681
-
682
- ### dontSeeElement
683
-
684
- Opposite to `seeElement`. Checks that element is not visible (or in DOM)
685
-
686
- ```js
687
- I.dontSeeElement('.modal'); // modal is not shown
688
- ```
689
-
690
- #### Parameters
691
-
692
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
693
- ⚠️ returns a _promise_ which is synchronized internally by recorder
694
-
695
-
696
- This action supports [React locators](https://codecept.io/react#locators)
697
-
698
-
699
- ### dontSeeElementInDOM
700
-
701
- Opposite to `seeElementInDOM`. Checks that element is not on page.
702
-
703
- ```js
704
- I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
705
- ```
706
-
707
- #### Parameters
708
-
709
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|Strict locator.
710
- ⚠️ returns a _promise_ which is synchronized internally by recorder
711
-
712
- ### dontSeeInCurrentUrl
713
-
714
- Checks that current url does not contain a provided fragment.
715
-
716
- #### Parameters
717
-
718
- - `url` **[string][17]** value to check.
719
- ⚠️ returns a _promise_ which is synchronized internally by recorder
720
-
721
- ### dontSeeInField
722
-
723
- Checks that value of input field or textarea doesn't equal to given value
724
- Opposite to `seeInField`.
725
-
726
- ```js
727
- I.dontSeeInField('email', 'user@user.com'); // field by name
728
- I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
729
- ```
730
-
731
- #### Parameters
732
-
733
- - `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
734
- - `value` **[string][17]** value to check.
735
- ⚠️ returns a _promise_ which is synchronized internally by recorder
736
-
737
- ### dontSeeInSource
738
-
739
- Checks that the current page does not contains the given string in its raw source code.
740
-
741
- ```js
742
- I.dontSeeInSource('<!--'); // no comments in source
743
- ```
744
-
745
- #### Parameters
746
-
747
- - `text`
748
- - `value` **[string][17]** to check.
749
- ⚠️ returns a _promise_ which is synchronized internally by recorder
750
-
751
- ### dontSeeInTitle
752
-
753
- Checks that title does not contain text.
754
-
755
- ```js
756
- I.dontSeeInTitle('Error');
757
- ```
758
-
759
- #### Parameters
760
-
761
- - `text` **[string][17]** value to check.
762
- ⚠️ returns a _promise_ which is synchronized internally by recorder
763
-
764
- ### doubleClick
765
-
766
- Performs a double-click on an element matched by link|button|label|CSS or XPath.
767
- Context can be specified as second parameter to narrow search.
768
-
769
- ```js
770
- I.doubleClick('Edit');
771
- I.doubleClick('Edit', '.actions');
772
- I.doubleClick({css: 'button.accept'});
773
- I.doubleClick('.btn.edit');
774
- ```
775
-
776
- #### Parameters
777
-
778
- - `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
779
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
780
- ⚠️ returns a _promise_ which is synchronized internally by recorder
781
-
782
-
783
- This action supports [React locators](https://codecept.io/react#locators)
784
-
785
-
786
- ### dragAndDrop
787
-
788
- Drag an item to a destination element.
789
-
790
- ```js
791
- I.dragAndDrop('#dragHandle', '#container');
792
- ```
793
-
794
- #### Parameters
795
-
796
- - `srcElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
797
- - `destElement` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
798
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested
799
-
800
- ### dragSlider
801
-
802
- Drag the scrubber of a slider to a given position
803
- For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
804
-
805
- ```js
806
- I.dragSlider('#slider', 30);
807
- I.dragSlider('#slider', -70);
808
- ```
809
-
810
- #### Parameters
811
-
812
- - `locator` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
813
- - `offsetX` **[number][20]** position to drag.
814
- ⚠️ returns a _promise_ which is synchronized internally by recorder
815
-
816
- ### executeAsyncScript
817
-
818
- Executes async script on page.
819
- Provided function should execute a passed callback (as first argument) to signal it is finished.
820
-
821
- Example: In Vue.js to make components completely rendered we are waiting for [nextTick][21].
822
-
823
- ```js
824
- I.executeAsyncScript(function(done) {
825
- Vue.nextTick(done); // waiting for next tick
826
- });
827
- ```
828
-
829
- By passing value to `done()` function you can return values.
830
- Additional arguments can be passed as well, while `done` function is always last parameter in arguments list.
831
-
832
- ```js
833
- let val = await I.executeAsyncScript(function(url, done) {
834
- // in browser context
835
- $.ajax(url, { success: (data) => done(data); }
836
- }, 'http://ajax.callback.url/');
837
- ```
838
-
839
- #### Parameters
840
-
841
- - `args` **...any** to be passed to function.
842
- ⚠️ returns a _promise_ which is synchronized internally by recorder
843
- - `fn` **([string][17] | [function][22])** function to be executed in browser context.
844
-
845
- ### executeScript
846
-
847
- Executes sync script on a page.
848
- Pass arguments to function as additional parameters.
849
- Will return execution result to a test.
850
- In this case you should use async function and await to receive results.
851
-
852
- Example with jQuery DatePicker:
853
-
854
- ```js
855
- // change date of jQuery DatePicker
856
- I.executeScript(function() {
857
- // now we are inside browser context
858
- $('date').datetimepicker('setDate', new Date());
859
- });
860
- ```
861
-
862
- Can return values. Don't forget to use `await` to get them.
863
-
864
- ```js
865
- let date = await I.executeScript(function(el) {
866
- // only basic types can be returned
867
- return $(el).datetimepicker('getDate').toString();
868
- }, '#date'); // passing jquery selector
869
- ```
870
-
871
- #### Parameters
872
-
873
- - `args` **...any** to be passed to function.
874
- ⚠️ returns a _promise_ which is synchronized internally by recorderWraps [execute][23] command.
875
- - `fn` **([string][17] | [function][22])** function to be executed in browser context.
876
-
877
- ### fillField
878
-
879
- Fills a text field or textarea, after clearing its value, with the given string.
880
- Field is located by name, label, CSS, or XPath.
881
-
882
- ```js
883
- // by label
884
- I.fillField('Email', 'hello@world.com');
885
- // by name
886
- I.fillField('password', secret('123456'));
887
- // by CSS
888
- I.fillField('form#login input[name=username]', 'John');
889
- // or by strict locator
890
- I.fillField({css: 'form#login input[name=username]'}, 'John');
891
- ```
892
-
893
- #### Parameters
894
-
895
- - `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
896
- - `value` **([string][17] | [object][16])** text value to fill.
897
- ⚠️ returns a _promise_ which is synchronized internally by recorder
898
-
899
-
900
- This action supports [React locators](https://codecept.io/react#locators)
901
-
902
- {{ custom }}
903
-
904
- ### forceClick
905
-
906
- Perform an emulated click on a link or a button, given by a locator.
907
- Unlike normal click instead of sending native event, emulates a click with JavaScript.
908
- This works on hidden, animated or inactive elements as well.
909
-
910
- If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
911
- For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
912
- For images, the "alt" attribute and inner text of any parent links are searched.
913
-
914
- The second parameter is a context (CSS or XPath locator) to narrow the search.
915
-
916
- ```js
917
- // simple link
918
- I.forceClick('Logout');
919
- // button of form
920
- I.forceClick('Submit');
921
- // CSS button
922
- I.forceClick('#form input[type=submit]');
923
- // XPath
924
- I.forceClick('//form/*[@type=submit]');
925
- // link in context
926
- I.forceClick('Logout', '#nav');
927
- // using strict locator
928
- I.forceClick({css: 'nav a.login'});
929
- ```
930
-
931
- #### Parameters
932
-
933
- - `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
934
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
935
- ⚠️ returns a _promise_ which is synchronized internally by recorder
936
-
937
-
938
- This action supports [React locators](https://codecept.io/react#locators)
939
-
940
-
941
- ### forceRightClick
942
-
943
- Emulates right click on an element.
944
- Unlike normal click instead of sending native event, emulates a click with JavaScript.
945
- This works on hidden, animated or inactive elements as well.
946
-
947
- If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
948
- For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
949
- For images, the "alt" attribute and inner text of any parent links are searched.
950
-
951
- The second parameter is a context (CSS or XPath locator) to narrow the search.
952
-
953
- ```js
954
- // simple link
955
- I.forceRightClick('Menu');
956
- ```
957
-
958
- #### Parameters
959
-
960
- - `locator` **([string][17] | [object][16])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
961
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
962
- ⚠️ returns a _promise_ which is synchronized internally by recorder
963
-
964
-
965
- This action supports [React locators](https://codecept.io/react#locators)
966
-
967
-
968
- ### grabAllWindowHandles
969
-
970
- Get all Window Handles.
971
- Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
972
-
973
- ```js
974
- const windows = await I.grabAllWindowHandles();
975
- ```
976
-
977
- Returns **[Promise][24]&lt;[Array][25]&lt;[string][17]>>**
978
-
979
- ### grabAttributeFrom
980
-
981
- Retrieves an attribute from an element located by CSS or XPath and returns it to test.
982
- Resumes test execution, so **should be used inside async with `await`** operator.
983
- If more than one element is found - attribute of first element is returned.
984
-
985
- ```js
986
- let hint = await I.grabAttributeFrom('#tooltip', 'title');
987
- ```
988
-
989
- #### Parameters
990
-
991
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
992
- - `attr` **[string][17]** attribute name.
993
-
994
- Returns **[Promise][24]&lt;[string][17]>** attribute value
995
-
996
- ### grabAttributeFromAll
997
-
998
- Retrieves an array of attributes from elements located by CSS or XPath and returns it to test.
999
- Resumes test execution, so **should be used inside async with `await`** operator.
1000
-
1001
- ```js
1002
- let hints = await I.grabAttributeFromAll('.tooltip', 'title');
1003
- ```
1004
-
1005
- #### Parameters
1006
-
1007
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1008
- - `attr` **[string][17]** attribute name.
1009
-
1010
- Returns **[Promise][24]&lt;[Array][25]&lt;[string][17]>>** attribute value
1011
-
1012
- ### grabBrowserLogs
1013
-
1014
- Get JS log from browser. Log buffer is reset after each request.
1015
- Resumes test execution, so **should be used inside an async function with `await`** operator.
1016
-
1017
- ```js
1018
- let logs = await I.grabBrowserLogs();
1019
- console.log(JSON.stringify(logs))
1020
- ```
1021
-
1022
- Returns **([Promise][24]&lt;[Array][25]&lt;[object][16]>> | [undefined][26])** all browser logs
1023
-
1024
- ### grabCookie
1025
-
1026
- Gets a cookie object by name.
1027
- If none provided gets all cookies.
1028
- Resumes test execution, so **should be used inside async function with `await`** operator.
1029
-
1030
- ```js
1031
- let cookie = await I.grabCookie('auth');
1032
- assert(cookie.value, '123456');
1033
- ```
1034
-
1035
- #### Parameters
1036
-
1037
- - `name` **[string][17]?** cookie name.
1038
-
1039
- Returns **([Promise][24]&lt;[string][17]> | [Promise][24]&lt;[Array][25]&lt;[string][17]>>)** attribute value
1040
-
1041
- ### grabCssPropertyFrom
1042
-
1043
- Grab CSS property for given locator
1044
- Resumes test execution, so **should be used inside an async function with `await`** operator.
1045
- If more than one element is found - value of first element is returned.
1046
-
1047
- ```js
1048
- const value = await I.grabCssPropertyFrom('h3', 'font-weight');
1049
- ```
1050
-
1051
- #### Parameters
1052
-
1053
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1054
- - `cssProperty` **[string][17]** CSS property name.
1055
-
1056
- Returns **[Promise][24]&lt;[string][17]>** CSS value
1057
-
1058
- ### grabCssPropertyFromAll
1059
-
1060
- Grab array of CSS properties for given locator
1061
- Resumes test execution, so **should be used inside an async function with `await`** operator.
1062
-
1063
- ```js
1064
- const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
1065
- ```
1066
-
1067
- #### Parameters
1068
-
1069
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1070
- - `cssProperty` **[string][17]** CSS property name.
1071
-
1072
- Returns **[Promise][24]&lt;[Array][25]&lt;[string][17]>>** CSS value
1073
-
1074
- ### grabCurrentUrl
1075
-
1076
- Get current URL from browser.
1077
- Resumes test execution, so should be used inside an async function.
1078
-
1079
- ```js
1080
- let url = await I.grabCurrentUrl();
1081
- console.log(`Current URL is [${url}]`);
1082
- ```
1083
-
1084
- Returns **[Promise][24]&lt;[string][17]>** current URL
1085
-
1086
- ### grabCurrentWindowHandle
1087
-
1088
- Get the current Window Handle.
1089
- Useful for referencing it when calling `I.switchToWindow(handle)`
1090
-
1091
- ```js
1092
- const window = await I.grabCurrentWindowHandle();
1093
- ```
1094
-
1095
- Returns **[Promise][24]&lt;[string][17]>**
1096
-
1097
- ### grabElementBoundingRect
1098
-
1099
- Grab the width, height, location of given locator.
1100
- Provide `width` or `height`as second param to get your desired prop.
1101
- Resumes test execution, so **should be used inside an async function with `await`** operator.
1102
-
1103
- Returns an object with `x`, `y`, `width`, `height` keys.
1104
-
1105
- ```js
1106
- const value = await I.grabElementBoundingRect('h3');
1107
- // value is like { x: 226.5, y: 89, width: 527, height: 220 }
1108
- ```
1109
-
1110
- To get only one metric use second parameter:
1111
-
1112
- ```js
1113
- const width = await I.grabElementBoundingRect('h3', 'width');
1114
- // width == 527
1115
- ```
1116
-
1117
- #### Parameters
1118
-
1119
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1120
- - `prop`
1121
- - `elementSize` **[string][17]?** x, y, width or height of the given element.
1122
-
1123
- Returns **([Promise][24]&lt;DOMRect> | [Promise][24]&lt;[number][20]>)** Element bounding rectangle
1124
-
1125
- ### grabGeoLocation
1126
-
1127
- Return the current geo location
1128
- Resumes test execution, so **should be used inside async function with `await`** operator.
1129
-
1130
- ```js
1131
- let geoLocation = await I.grabGeoLocation();
1132
- ```
1133
-
1134
- Returns **[Promise][24]&lt;{latitude: [number][20], longitude: [number][20], altitude: [number][20]}>**
1135
-
1136
- ### grabHTMLFrom
1137
-
1138
- Retrieves the innerHTML from an element located by CSS or XPath and returns it to test.
1139
- Resumes test execution, so **should be used inside async function with `await`** operator.
1140
- If more than one element is found - HTML of first element is returned.
1141
-
1142
- ```js
1143
- let postHTML = await I.grabHTMLFrom('#post');
1144
- ```
1145
-
1146
- #### Parameters
1147
-
1148
- - `locator`
1149
- - `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1150
-
1151
- Returns **[Promise][24]&lt;[string][17]>** HTML code for an element
1152
-
1153
- ### grabHTMLFromAll
1154
-
1155
- Retrieves all the innerHTML from elements located by CSS or XPath and returns it to test.
1156
- Resumes test execution, so **should be used inside async function with `await`** operator.
1157
-
1158
- ```js
1159
- let postHTMLs = await I.grabHTMLFromAll('.post');
1160
- ```
1161
-
1162
- #### Parameters
1163
-
1164
- - `locator`
1165
- - `element` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1166
-
1167
- Returns **[Promise][24]&lt;[Array][25]&lt;[string][17]>>** HTML code for an element
1168
-
1169
- ### grabNumberOfOpenTabs
1170
-
1171
- Grab number of open tabs.
1172
- Resumes test execution, so **should be used inside async function with `await`** operator.
1173
-
1174
- ```js
1175
- let tabs = await I.grabNumberOfOpenTabs();
1176
- ```
1177
-
1178
- Returns **[Promise][24]&lt;[number][20]>** number of open tabs
1179
-
1180
- ### grabNumberOfVisibleElements
1181
-
1182
- Grab number of visible elements by locator.
1183
- Resumes test execution, so **should be used inside async function with `await`** operator.
1184
-
1185
- ```js
1186
- let numOfElements = await I.grabNumberOfVisibleElements('p');
1187
- ```
1188
-
1189
- #### Parameters
1190
-
1191
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1192
-
1193
- Returns **[Promise][24]&lt;[number][20]>** number of visible elements
1194
-
1195
- ### grabPageScrollPosition
1196
-
1197
- Retrieves a page scroll position and returns it to test.
1198
- Resumes test execution, so **should be used inside an async function with `await`** operator.
1199
-
1200
- ```js
1201
- let { x, y } = await I.grabPageScrollPosition();
1202
- ```
1203
-
1204
- Returns **[Promise][24]&lt;PageScrollPosition>** scroll position
1205
-
1206
- ### grabPopupText
1207
-
1208
- Grab the text within the popup. If no popup is visible then it will return null.
1209
-
1210
- ```js
1211
- await I.grabPopupText();
1212
- ```
1213
-
1214
- Returns **[Promise][24]&lt;[string][17]>**
1215
-
1216
- ### grabSource
1217
-
1218
- Retrieves page source and returns it to test.
1219
- Resumes test execution, so **should be used inside async function with `await`** operator.
1220
-
1221
- ```js
1222
- let pageSource = await I.grabSource();
1223
- ```
1224
-
1225
- Returns **[Promise][24]&lt;[string][17]>** source code
1226
-
1227
- ### grabTextFrom
1228
-
1229
- Retrieves a text from an element located by CSS or XPath and returns it to test.
1230
- Resumes test execution, so **should be used inside async with `await`** operator.
1231
-
1232
- ```js
1233
- let pin = await I.grabTextFrom('#pin');
1234
- ```
1235
-
1236
- If multiple elements found returns first element.
1237
-
1238
- #### Parameters
1239
-
1240
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1241
-
1242
- Returns **[Promise][24]&lt;[string][17]>** attribute value
1243
-
1244
- ### grabTextFromAll
1245
-
1246
- Retrieves all texts from an element located by CSS or XPath and returns it to test.
1247
- Resumes test execution, so **should be used inside async with `await`** operator.
1248
-
1249
- ```js
1250
- let pins = await I.grabTextFromAll('#pin li');
1251
- ```
1252
-
1253
- #### Parameters
1254
-
1255
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1256
-
1257
- Returns **[Promise][24]&lt;[Array][25]&lt;[string][17]>>** attribute value
1258
-
1259
- ### grabTitle
1260
-
1261
- Retrieves a page title and returns it to test.
1262
- Resumes test execution, so **should be used inside async with `await`** operator.
1263
-
1264
- ```js
1265
- let title = await I.grabTitle();
1266
- ```
1267
-
1268
- Returns **[Promise][24]&lt;[string][17]>** title
1269
-
1270
- ### grabValueFrom
1271
-
1272
- Retrieves a value from a form element located by CSS or XPath and returns it to test.
1273
- Resumes test execution, so **should be used inside async function with `await`** operator.
1274
- If more than one element is found - value of first element is returned.
1275
-
1276
- ```js
1277
- let email = await I.grabValueFrom('input[name=email]');
1278
- ```
1279
-
1280
- #### Parameters
1281
-
1282
- - `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
1283
-
1284
- Returns **[Promise][24]&lt;[string][17]>** attribute value
1285
-
1286
- ### grabValueFromAll
1287
-
1288
- Retrieves an array of value from a form located by CSS or XPath and returns it to test.
1289
- Resumes test execution, so **should be used inside async function with `await`** operator.
1290
-
1291
- ```js
1292
- let inputs = await I.grabValueFromAll('//form/input');
1293
- ```
1294
-
1295
- #### Parameters
1296
-
1297
- - `locator` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
1298
-
1299
- Returns **[Promise][24]&lt;[Array][25]&lt;[string][17]>>** attribute value
1300
-
1301
- ### moveCursorTo
1302
-
1303
- Moves cursor to element matched by locator.
1304
- Extra shift can be set with offsetX and offsetY options.
1305
-
1306
- ```js
1307
- I.moveCursorTo('.tooltip');
1308
- I.moveCursorTo('#submit', 5,5);
1309
- ```
1310
-
1311
- #### Parameters
1312
-
1313
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1314
- - `xOffset`
1315
- - `yOffset`
1316
- - `offsetX` **[number][20]** (optional, `0` by default) X-axis offset.
1317
- - `offsetY` **[number][20]** (optional, `0` by default) Y-axis offset.
1318
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1319
-
1320
- ### openNewTab
1321
-
1322
- Open new tab and switch to it.
1323
-
1324
- ```js
1325
- I.openNewTab();
1326
- ```
1327
-
1328
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1329
-
1330
- #### Parameters
1331
-
1332
- - `url`
1333
- - `windowName`
1334
-
1335
- ### pressKey
1336
-
1337
- Presses a key in the browser (on a focused element).
1338
-
1339
- _Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][27].
1340
-
1341
- ```js
1342
- I.pressKey('Backspace');
1343
- ```
1344
-
1345
- To press a key in combination with modifier keys, pass the sequence as an array. All modifier keys (`'Alt'`, `'Control'`, `'Meta'`, `'Shift'`) will be released afterwards.
1346
-
1347
- ```js
1348
- I.pressKey(['Control', 'Z']);
1349
- ```
1350
-
1351
- For specifying operation modifier key based on operating system it is suggested to use `'CommandOrControl'`.
1352
- This will press `'Command'` (also known as `'Meta'`) on macOS machines and `'Control'` on non-macOS machines.
1353
-
1354
- ```js
1355
- I.pressKey(['CommandOrControl', 'Z']);
1356
- ```
1357
-
1358
- Some of the supported key names are:
1359
-
1360
- - `'AltLeft'` or `'Alt'`
1361
- - `'AltRight'`
1362
- - `'ArrowDown'`
1363
- - `'ArrowLeft'`
1364
- - `'ArrowRight'`
1365
- - `'ArrowUp'`
1366
- - `'Backspace'`
1367
- - `'Clear'`
1368
- - `'ControlLeft'` or `'Control'`
1369
- - `'ControlRight'`
1370
- - `'Command'`
1371
- - `'CommandOrControl'`
1372
- - `'Delete'`
1373
- - `'End'`
1374
- - `'Enter'`
1375
- - `'Escape'`
1376
- - `'F1'` to `'F12'`
1377
- - `'Home'`
1378
- - `'Insert'`
1379
- - `'MetaLeft'` or `'Meta'`
1380
- - `'MetaRight'`
1381
- - `'Numpad0'` to `'Numpad9'`
1382
- - `'NumpadAdd'`
1383
- - `'NumpadDecimal'`
1384
- - `'NumpadDivide'`
1385
- - `'NumpadMultiply'`
1386
- - `'NumpadSubtract'`
1387
- - `'PageDown'`
1388
- - `'PageUp'`
1389
- - `'Pause'`
1390
- - `'Return'`
1391
- - `'ShiftLeft'` or `'Shift'`
1392
- - `'ShiftRight'`
1393
- - `'Space'`
1394
- - `'Tab'`
1395
-
1396
- #### Parameters
1397
-
1398
- - `key` **([string][17] | [Array][25]&lt;[string][17]>)** key or array of keys to press.
1399
- ⚠️ returns a _promise_ which is synchronized internally by recorder_Note:_ In case a text field or textarea is focused be aware that some browsers do not respect active modifier when combining modifier keys with other keys.
1400
-
1401
- ### pressKeyDown
1402
-
1403
- Presses a key in the browser and leaves it in a down state.
1404
-
1405
- To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][28]).
1406
-
1407
- ```js
1408
- I.pressKeyDown('Control');
1409
- I.click('#element');
1410
- I.pressKeyUp('Control');
1411
- ```
1412
-
1413
- #### Parameters
1414
-
1415
- - `key` **[string][17]** name of key to press down.
1416
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1417
-
1418
- ### pressKeyUp
1419
-
1420
- Releases a key in the browser which was previously set to a down state.
1421
-
1422
- To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][28]).
1423
-
1424
- ```js
1425
- I.pressKeyDown('Control');
1426
- I.click('#element');
1427
- I.pressKeyUp('Control');
1428
- ```
1429
-
1430
- #### Parameters
1431
-
1432
- - `key` **[string][17]** name of key to release.
1433
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1434
-
1435
- ### refreshPage
1436
-
1437
- Reload the current page.
1438
-
1439
- ```js
1440
- I.refreshPage();
1441
- ```
1442
-
1443
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1444
-
1445
- ### resizeWindow
1446
-
1447
- Resize the current window to provided width and height.
1448
- First parameter can be set to `maximize`.
1449
-
1450
- #### Parameters
1451
-
1452
- - `width` **[number][20]** width in pixels or `maximize`.
1453
- - `height` **[number][20]** height in pixels.
1454
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested in web, in apps doesn't work
1455
-
1456
- ### rightClick
1457
-
1458
- Performs right click on a clickable element matched by semantic locator, CSS or XPath.
1459
-
1460
- ```js
1461
- // right click element with id el
1462
- I.rightClick('#el');
1463
- // right click link or button with text "Click me"
1464
- I.rightClick('Click me');
1465
- // right click button with text "Click me" inside .context
1466
- I.rightClick('Click me', '.context');
1467
- ```
1468
-
1469
- #### Parameters
1470
-
1471
- - `locator` **([string][17] | [object][16])** clickable element located by CSS|XPath|strict locator.
1472
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
1473
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1474
-
1475
-
1476
- This action supports [React locators](https://codecept.io/react#locators)
1477
-
1478
-
1479
- ### runInWeb
1480
-
1481
- Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
1482
-
1483
- #### Parameters
1484
-
1485
- - `fn`
1486
-
1487
- ### runOnAndroid
1488
-
1489
- Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
1490
-
1491
- #### Parameters
1492
-
1493
- - `caps` **any**
1494
- - `fn` **any**
1495
-
1496
- ### runOnIOS
1497
-
1498
- Placeholder for ~ locator only test case write once run on both Appium and WebDriver.
1499
-
1500
- #### Parameters
1501
-
1502
- - `caps` **any**
1503
- - `fn` **any**
1504
-
1505
- ### saveElementScreenshot
1506
-
1507
- Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
1508
- Filename is relative to output folder.
1509
-
1510
- ```js
1511
- I.saveElementScreenshot(`#submit`,'debug.png');
1512
- ```
1513
-
1514
- #### Parameters
1515
-
1516
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1517
- - `fileName` **[string][17]** file name to save.
1518
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1519
-
1520
- ### saveScreenshot
1521
-
1522
- Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
1523
- Filename is relative to output folder.
1524
- Optionally resize the window to the full available page `scrollHeight` and `scrollWidth` to capture the entire page by passing `true` in as the second argument.
1525
-
1526
- ```js
1527
- I.saveScreenshot('debug.png');
1528
- I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scrollWidth before taking screenshot
1529
- ```
1530
-
1531
- #### Parameters
1532
-
1533
- - `fileName` **[string][17]** file name to save.
1534
- - `fullPage` **[boolean][29]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
1535
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1536
-
1537
- ### scrollIntoView
1538
-
1539
- Scroll element into viewport.
1540
-
1541
- ```js
1542
- I.scrollIntoView('#submit');
1543
- I.scrollIntoView('#submit', true);
1544
- I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
1545
- ```
1546
-
1547
- #### Parameters
1548
-
1549
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1550
- - `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][30].
1551
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1552
-
1553
- ### scrollPageToBottom
1554
-
1555
- Scroll page to the bottom.
1556
-
1557
- ```js
1558
- I.scrollPageToBottom();
1559
- ```
1560
-
1561
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1562
-
1563
- ### scrollPageToTop
1564
-
1565
- Scroll page to the top.
1566
-
1567
- ```js
1568
- I.scrollPageToTop();
1569
- ```
1570
-
1571
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1572
-
1573
- ### scrollTo
1574
-
1575
- Scrolls to element matched by locator.
1576
- Extra shift can be set with offsetX and offsetY options.
1577
-
1578
- ```js
1579
- I.scrollTo('footer');
1580
- I.scrollTo('#submit', 5, 5);
1581
- ```
1582
-
1583
- #### Parameters
1584
-
1585
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1586
- - `offsetX` **[number][20]** (optional, `0` by default) X-axis offset.
1587
- - `offsetY` **[number][20]** (optional, `0` by default) Y-axis offset.
1588
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1589
-
1590
- ### see
1591
-
1592
- Checks that a page contains a visible text.
1593
- Use context parameter to narrow down the search.
1594
-
1595
- ```js
1596
- I.see('Welcome'); // text welcome on a page
1597
- I.see('Welcome', '.content'); // text inside .content div
1598
- I.see('Register', {css: 'form.register'}); // use strict locator
1599
- ```
1600
-
1601
- #### Parameters
1602
-
1603
- - `text` **[string][17]** expected on page.
1604
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1605
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1606
-
1607
-
1608
- This action supports [React locators](https://codecept.io/react#locators)
1609
-
1610
-
1611
- ### seeAttributesOnElements
1612
-
1613
- Checks that all elements with given locator have given attributes.
1614
-
1615
- ```js
1616
- I.seeAttributesOnElements('//form', { method: "post"});
1617
- ```
1618
-
1619
- #### Parameters
1620
-
1621
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1622
- - `attributes` **[object][16]** attributes and their values to check.
1623
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1624
-
1625
- ### seeCheckboxIsChecked
1626
-
1627
- Verifies that the specified checkbox is checked.
1628
-
1629
- ```js
1630
- I.seeCheckboxIsChecked('Agree');
1631
- I.seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
1632
- I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
1633
- ```
1634
-
1635
- #### Parameters
1636
-
1637
- - `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
1638
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested
1639
-
1640
- ### seeCookie
1641
-
1642
- Checks that cookie with given name exists.
1643
-
1644
- ```js
1645
- I.seeCookie('Auth');
1646
- ```
1647
-
1648
- #### Parameters
1649
-
1650
- - `name` **[string][17]** cookie name.
1651
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1652
-
1653
- ### seeCssPropertiesOnElements
1654
-
1655
- Checks that all elements with given locator have given CSS properties.
1656
-
1657
- ```js
1658
- I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
1659
- ```
1660
-
1661
- #### Parameters
1662
-
1663
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1664
- - `cssProperties` **[object][16]** object with CSS properties and their values to check.
1665
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1666
-
1667
- ### seeCurrentUrlEquals
1668
-
1669
- Checks that current url is equal to provided one.
1670
- If a relative url provided, a configured url will be prepended to it.
1671
- So both examples will work:
1672
-
1673
- ```js
1674
- I.seeCurrentUrlEquals('/register');
1675
- I.seeCurrentUrlEquals('http://my.site.com/register');
1676
- ```
1677
-
1678
- #### Parameters
1679
-
1680
- - `url` **[string][17]** value to check.
1681
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1682
-
1683
- ### seeElement
1684
-
1685
- Checks that a given Element is visible
1686
- Element is located by CSS or XPath.
1687
-
1688
- ```js
1689
- I.seeElement('#modal');
1690
- ```
1691
-
1692
- #### Parameters
1693
-
1694
- - `locator` **([string][17] | [object][16])** located by CSS|XPath|strict locator.
1695
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1696
-
1697
-
1698
- This action supports [React locators](https://codecept.io/react#locators)
1699
-
1700
-
1701
- ### seeElementInDOM
1702
-
1703
- Checks that a given Element is present in the DOM
1704
- Element is located by CSS or XPath.
1705
-
1706
- ```js
1707
- I.seeElementInDOM('#modal');
1708
- ```
1709
-
1710
- #### Parameters
1711
-
1712
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1713
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1714
-
1715
- ### seeInCurrentUrl
1716
-
1717
- Checks that current url contains a provided fragment.
1718
-
1719
- ```js
1720
- I.seeInCurrentUrl('/register'); // we are on registration page
1721
- ```
1722
-
1723
- #### Parameters
1724
-
1725
- - `url` **[string][17]** a fragment to check
1726
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1727
-
1728
- ### seeInField
1729
-
1730
- Checks that the given input field or textarea equals to given value.
1731
- For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
1732
-
1733
- ```js
1734
- I.seeInField('Username', 'davert');
1735
- I.seeInField({css: 'form textarea'},'Type your comment here');
1736
- I.seeInField('form input[type=hidden]','hidden_value');
1737
- I.seeInField('#searchform input','Search');
1738
- ```
1739
-
1740
- #### Parameters
1741
-
1742
- - `field` **([string][17] | [object][16])** located by label|name|CSS|XPath|strict locator.
1743
- - `value` **[string][17]** value to check.
1744
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1745
-
1746
- ### seeInPopup
1747
-
1748
- Checks that the active JavaScript popup, as created by `window.alert|window.confirm|window.prompt`, contains the
1749
- given string.
1750
-
1751
- #### Parameters
1752
-
1753
- - `text` **[string][17]** value to check.
1754
-
1755
- ### seeInSource
1756
-
1757
- Checks that the current page contains the given string in its raw source code.
1758
-
1759
- ```js
1760
- I.seeInSource('<h1>Green eggs &amp; ham</h1>');
1761
- ```
1762
-
1763
- #### Parameters
1764
-
1765
- - `text` **[string][17]** value to check.
1766
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1767
-
1768
- ### seeInTitle
1769
-
1770
- Checks that title contains text.
1771
-
1772
- ```js
1773
- I.seeInTitle('Home Page');
1774
- ```
1775
-
1776
- #### Parameters
1777
-
1778
- - `text` **[string][17]** text value to check.
1779
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1780
-
1781
- ### seeNumberOfElements
1782
-
1783
- Asserts that an element appears a given number of times in the DOM.
1784
- Element is located by label or name or CSS or XPath.
1785
-
1786
- ```js
1787
- I.seeNumberOfElements('#submitBtn', 1);
1788
- ```
1789
-
1790
- #### Parameters
1791
-
1792
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1793
- - `num` **[number][20]** number of elements.
1794
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1795
-
1796
-
1797
- This action supports [React locators](https://codecept.io/react#locators)
1798
-
1799
-
1800
- ### seeNumberOfVisibleElements
1801
-
1802
- Asserts that an element is visible a given number of times.
1803
- Element is located by CSS or XPath.
1804
-
1805
- ```js
1806
- I.seeNumberOfVisibleElements('.buttons', 3);
1807
- ```
1808
-
1809
- #### Parameters
1810
-
1811
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
1812
- - `num` **[number][20]** number of elements.
1813
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1814
-
1815
-
1816
- This action supports [React locators](https://codecept.io/react#locators)
1817
-
1818
-
1819
- ### seeTextEquals
1820
-
1821
- Checks that text is equal to provided one.
1822
-
1823
- ```js
1824
- I.seeTextEquals('text', 'h1');
1825
- ```
1826
-
1827
- #### Parameters
1828
-
1829
- - `text` **[string][17]** element value to check.
1830
- - `context` **([string][17] | [object][16])?** element located by CSS|XPath|strict locator.
1831
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1832
-
1833
- ### seeTitleEquals
1834
-
1835
- Checks that title is equal to provided one.
1836
-
1837
- ```js
1838
- I.seeTitleEquals('Test title.');
1839
- ```
1840
-
1841
- #### Parameters
1842
-
1843
- - `text` **[string][17]** value to check.
1844
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1845
-
1846
- ### selectOption
1847
-
1848
- Selects an option in a drop-down select.
1849
- Field is searched by label | name | CSS | XPath.
1850
- Option is selected by visible text or by value.
1851
-
1852
- ```js
1853
- I.selectOption('Choose Plan', 'Monthly'); // select by label
1854
- I.selectOption('subscription', 'Monthly'); // match option by text
1855
- I.selectOption('subscription', '0'); // or by value
1856
- I.selectOption('//form/select[@name=account]','Premium');
1857
- I.selectOption('form select[name=account]', 'Premium');
1858
- I.selectOption({css: 'form select[name=account]'}, 'Premium');
1859
- ```
1860
-
1861
- Provide an array for the second argument to select multiple options.
1862
-
1863
- ```js
1864
- I.selectOption('Which OS do you use?', ['Android', 'iOS']);
1865
- ```
1866
-
1867
- #### Parameters
1868
-
1869
- - `select` **([string][17] | [object][16])** field located by label|name|CSS|XPath|strict locator.
1870
- - `option` **([string][17] | [Array][25]&lt;any>)** visible text or value of option.
1871
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1872
-
1873
- ### setCookie
1874
-
1875
- Sets cookie(s).
1876
-
1877
- Can be a single cookie object or an array of cookies:
1878
-
1879
- ```js
1880
- I.setCookie({name: 'auth', value: true});
1881
-
1882
- // as array
1883
- I.setCookie([
1884
- {name: 'auth', value: true},
1885
- {name: 'agree', value: true}
1886
- ]);
1887
- ```
1888
-
1889
- #### Parameters
1890
-
1891
- - `cookie` **(Cookie | [Array][25]&lt;Cookie>)** a cookie object or array of cookie objects.
1892
- ⚠️ returns a _promise_ which is synchronized internally by recorderUses Selenium's JSON [cookie
1893
- format][31].
1894
-
1895
- ### setGeoLocation
1896
-
1897
- Set the current geo location
1898
-
1899
- ```js
1900
- I.setGeoLocation(121.21, 11.56);
1901
- I.setGeoLocation(121.21, 11.56, 10);
1902
- ```
1903
-
1904
- #### Parameters
1905
-
1906
- - `latitude` **[number][20]** to set.
1907
- - `longitude` **[number][20]** to set
1908
- - `altitude` **[number][20]?** (optional, null by default) to set
1909
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1910
-
1911
- ### switchTo
1912
-
1913
- Switches frame or in case of null locator reverts to parent.
1914
-
1915
- ```js
1916
- I.switchTo('iframe'); // switch to first iframe
1917
- I.switchTo(); // switch back to main page
1918
- ```
1919
-
1920
- #### Parameters
1921
-
1922
- - `locator` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS|XPath|strict locator.
1923
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1924
-
1925
- ### switchToNextTab
1926
-
1927
- Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
1928
-
1929
- ```js
1930
- I.switchToNextTab();
1931
- I.switchToNextTab(2);
1932
- ```
1933
-
1934
- #### Parameters
1935
-
1936
- - `num` **[number][20]?** (optional) number of tabs to switch forward, default: 1.
1937
- - `sec` **([number][20] | null)?** (optional) time in seconds to wait.
1938
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1939
-
1940
- ### switchToPreviousTab
1941
-
1942
- Switch focus to a particular tab by its number. It waits tabs loading and then switch tab.
1943
-
1944
- ```js
1945
- I.switchToPreviousTab();
1946
- I.switchToPreviousTab(2);
1947
- ```
1948
-
1949
- #### Parameters
1950
-
1951
- - `num` **[number][20]?** (optional) number of tabs to switch backward, default: 1.
1952
- - `sec` **[number][20]??** (optional) time in seconds to wait.
1953
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1954
-
1955
- ### switchToWindow
1956
-
1957
- Switch to the window with a specified handle.
1958
-
1959
- ```js
1960
- const windows = await I.grabAllWindowHandles();
1961
- // ... do something
1962
- await I.switchToWindow( windows[0] );
1963
-
1964
- const window = await I.grabCurrentWindowHandle();
1965
- // ... do something
1966
- await I.switchToWindow( window );
1967
- ```
1968
-
1969
- #### Parameters
1970
-
1971
- - `window` **[string][17]** name of window handle.
1972
-
1973
- ### type
1974
-
1975
- Types out the given text into an active field.
1976
- To slow down typing use a second parameter, to set interval between key presses.
1977
- _Note:_ Should be used when [`fillField`][27] is not an option.
1978
-
1979
- ```js
1980
- // passing in a string
1981
- I.type('Type this out.');
1982
-
1983
- // typing values with a 100ms interval
1984
- I.type('4141555311111111', 100);
1985
-
1986
- // passing in an array
1987
- I.type(['T', 'E', 'X', 'T']);
1988
- ```
1989
-
1990
- #### Parameters
1991
-
1992
- - `keys`
1993
- - `delay` **[number][20]?** (optional) delay in ms between key presses
1994
- ⚠️ returns a _promise_ which is synchronized internally by recorder
1995
- - `key` **([string][17] | [Array][25]&lt;[string][17]>)** or array of keys to type.
1996
-
1997
- ### uncheckOption
1998
-
1999
- Unselects a checkbox or radio button.
2000
- Element is located by label or name or CSS or XPath.
2001
-
2002
- The second parameter is a context (CSS or XPath locator) to narrow the search.
2003
-
2004
- ```js
2005
- I.uncheckOption('#agree');
2006
- I.uncheckOption('I Agree to Terms and Conditions');
2007
- I.uncheckOption('agree', '//form');
2008
- ```
2009
-
2010
- #### Parameters
2011
-
2012
- - `field` **([string][17] | [object][16])** checkbox located by label | name | CSS | XPath | strict locator.
2013
- - `context` **([string][17]? | [object][16])** (optional, `null` by default) element located by CSS | XPath | strict locator.
2014
- ⚠️ returns a _promise_ which is synchronized internally by recorderAppium: not tested
2015
-
2016
- ### useWebDriverTo
2017
-
2018
- Use [webdriverio][32] API inside a test.
2019
-
2020
- First argument is a description of an action.
2021
- Second argument is async function that gets this helper as parameter.
2022
-
2023
- { [`browser`][32]) } object from WebDriver API is available.
2024
-
2025
- ```js
2026
- I.useWebDriverTo('open multiple windows', async ({ browser }) {
2027
- // create new window
2028
- await browser.newWindow('https://webdriver.io');
2029
- });
2030
- ```
2031
-
2032
- #### Parameters
2033
-
2034
- - `description` **[string][17]** used to show in logs.
2035
- - `fn` **[function][22]** async functuion that executed with WebDriver helper as argument
2036
-
2037
- ### wait
2038
-
2039
- Pauses execution for a number of seconds.
2040
-
2041
- ```js
2042
- I.wait(2); // wait 2 secs
2043
- ```
2044
-
2045
- #### Parameters
2046
-
2047
- - `sec` **[number][20]** number of second to wait.
2048
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2049
-
2050
- ### waitForClickable
2051
-
2052
- Waits for element to be clickable (by default waits for 1sec).
2053
- Element can be located by CSS or XPath.
2054
-
2055
- ```js
2056
- I.waitForClickable('.btn.continue');
2057
- I.waitForClickable('.btn.continue', 5); // wait for 5 secs
2058
- ```
2059
-
2060
- #### Parameters
2061
-
2062
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2063
- - `waitTimeout`
2064
- - `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
2065
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2066
-
2067
- ### waitForDetached
2068
-
2069
- Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
2070
- Element can be located by CSS or XPath.
2071
-
2072
- ```js
2073
- I.waitForDetached('#popup');
2074
- ```
2075
-
2076
- #### Parameters
2077
-
2078
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2079
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2080
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2081
-
2082
- ### waitForElement
2083
-
2084
- Waits for element to be present on page (by default waits for 1sec).
2085
- Element can be located by CSS or XPath.
2086
-
2087
- ```js
2088
- I.waitForElement('.btn.continue');
2089
- I.waitForElement('.btn.continue', 5); // wait for 5 secs
2090
- ```
2091
-
2092
- #### Parameters
2093
-
2094
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2095
- - `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
2096
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2097
-
2098
- ### waitForEnabled
2099
-
2100
- Waits for element to become enabled (by default waits for 1sec).
2101
- Element can be located by CSS or XPath.
2102
-
2103
- #### Parameters
2104
-
2105
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2106
- - `sec` **[number][20]** (optional) time in seconds to wait, 1 by default.
2107
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2108
-
2109
- ### waitForFunction
2110
-
2111
- Waits for a function to return true (waits for 1 sec by default).
2112
- Running in browser context.
2113
-
2114
- ```js
2115
- I.waitForFunction(fn[, [args[, timeout]])
2116
- ```
2117
-
2118
- ```js
2119
- I.waitForFunction(() => window.requests == 0);
2120
- I.waitForFunction(() => window.requests == 0, 5); // waits for 5 sec
2121
- I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
2122
- ```
2123
-
2124
- #### Parameters
2125
-
2126
- - `fn` **([string][17] | [function][22])** to be executed in browser context.
2127
- - `argsOrSec` **([Array][25]&lt;any> | [number][20])?** (optional, `1` by default) arguments for function or seconds.
2128
- - `sec` **[number][20]?** (optional, `1` by default) time in seconds to wait
2129
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2130
-
2131
- ### waitForInvisible
2132
-
2133
- Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
2134
- Element can be located by CSS or XPath.
2135
-
2136
- ```js
2137
- I.waitForInvisible('#popup');
2138
- ```
2139
-
2140
- #### Parameters
2141
-
2142
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2143
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2144
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2145
-
2146
- ### waitForText
2147
-
2148
- Waits for a text to appear (by default waits for 1sec).
2149
- Element can be located by CSS or XPath.
2150
- Narrow down search results by providing context.
2151
-
2152
- ```js
2153
- I.waitForText('Thank you, form has been submitted');
2154
- I.waitForText('Thank you, form has been submitted', 5, '#modal');
2155
- ```
2156
-
2157
- #### Parameters
2158
-
2159
- - `text` **[string][17]** to wait for.
2160
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2161
- - `context` **([string][17] | [object][16])?** (optional) element located by CSS|XPath|strict locator.
2162
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2163
-
2164
- ### waitForValue
2165
-
2166
- Waits for the specified value to be in value attribute.
2167
-
2168
- ```js
2169
- I.waitForValue('//input', "GoodValue");
2170
- ```
2171
-
2172
- #### Parameters
2173
-
2174
- - `field` **([string][17] | [object][16])** input field.
2175
- - `value` **[string][17]** expected value.
2176
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2177
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2178
-
2179
- ### waitForVisible
2180
-
2181
- Waits for an element to become visible on a page (by default waits for 1sec).
2182
- Element can be located by CSS or XPath.
2183
-
2184
- ```js
2185
- I.waitForVisible('#popup');
2186
- ```
2187
-
2188
- #### Parameters
2189
-
2190
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2191
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2192
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2193
-
2194
- ### waitInUrl
2195
-
2196
- Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
2197
-
2198
- ```js
2199
- I.waitInUrl('/info', 2);
2200
- ```
2201
-
2202
- #### Parameters
2203
-
2204
- - `urlPart` **[string][17]** value to check.
2205
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2206
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2207
-
2208
- ### waitNumberOfVisibleElements
2209
-
2210
- Waits for a specified number of elements on the page.
2211
-
2212
- ```js
2213
- I.waitNumberOfVisibleElements('a', 3);
2214
- ```
2215
-
2216
- #### Parameters
2217
-
2218
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2219
- - `num` **[number][20]** number of elements.
2220
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2221
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2222
-
2223
- ### waitToHide
2224
-
2225
- Waits for an element to hide (by default waits for 1sec).
2226
- Element can be located by CSS or XPath.
2227
-
2228
- ```js
2229
- I.waitToHide('#popup');
2230
- ```
2231
-
2232
- #### Parameters
2233
-
2234
- - `locator` **([string][17] | [object][16])** element located by CSS|XPath|strict locator.
2235
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2236
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2237
-
2238
- ### waitUrlEquals
2239
-
2240
- Waits for the entire URL to match the expected
2241
-
2242
- ```js
2243
- I.waitUrlEquals('/info', 2);
2244
- I.waitUrlEquals('http://127.0.0.1:8000/info');
2245
- ```
2246
-
2247
- #### Parameters
2248
-
2249
- - `urlPart` **[string][17]** value to check.
2250
- - `sec` **[number][20]** (optional, `1` by default) time in seconds to wait
2251
- ⚠️ returns a _promise_ which is synchronized internally by recorder
2252
-
2253
- [1]: http://webdriver.io/
2254
-
2255
- [2]: https://codecept.io/webdriver/#testing-with-webdriver
2256
-
2257
- [3]: http://webdriver.io/guide/getstarted/configuration.html
2258
-
2259
- [4]: https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html
2260
-
2261
- [5]: https://aerokube.com/selenoid/latest/
2262
-
2263
- [6]: https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities
2264
-
2265
- [7]: http://webdriver.io/guide/usage/cloudservices.html
2266
-
2267
- [8]: https://webdriver.io/docs/sauce-service.html
2268
-
2269
- [9]: https://github.com/puneet0191/codeceptjs-saucehelper/
2270
-
2271
- [10]: https://webdriver.io/docs/browserstack-service.html
2272
-
2273
- [11]: https://github.com/PeterNgTr/codeceptjs-bshelper
2274
-
2275
- [12]: https://github.com/testingbot/codeceptjs-tbhelper
2276
-
2277
- [13]: https://webdriver.io/docs/testingbot-service.html
2278
-
2279
- [14]: https://github.com/PeterNgTr/codeceptjs-applitoolshelper
2280
-
2281
- [15]: http://webdriver.io/guide/usage/multiremote.html
2282
-
2283
- [16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
2284
-
2285
- [17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
2286
-
2287
- [18]: http://jster.net/category/windows-modals-popups
2288
-
2289
- [19]: https://webdriver.io/docs/timeouts.html
2290
-
2291
- [20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
2292
-
2293
- [21]: https://vuejs.org/v2/api/#Vue-nextTick
2294
-
2295
- [22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
2296
-
2297
- [23]: http://webdriver.io/api/protocol/execute.html
2298
-
2299
- [24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
2300
-
2301
- [25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
2302
-
2303
- [26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined
2304
-
2305
- [27]: #fillfield
2306
-
2307
- [28]: #click
2308
-
2309
- [29]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
2310
-
2311
- [30]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
2312
-
2313
- [31]: https://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object
2314
-
2315
- [32]: https://webdriver.io/docs/api.html
2316
-
2317
- [33]: http://codecept.io/acceptance/#smartwait
2318
-
2319
- [34]: http://webdriver.io/docs/timeouts.html