codeceptjs 3.5.12-beta.3 → 3.5.12-beta.5

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 (209) hide show
  1. package/docs/advanced.md +351 -0
  2. package/docs/ai.md +248 -0
  3. package/docs/api.md +323 -0
  4. package/docs/basics.md +979 -0
  5. package/docs/bdd.md +539 -0
  6. package/docs/best.md +237 -0
  7. package/docs/books.md +37 -0
  8. package/docs/bootstrap.md +135 -0
  9. package/docs/build/ApiDataFactory.js +410 -0
  10. package/docs/build/Appium.js +2027 -0
  11. package/docs/build/Expect.js +422 -0
  12. package/docs/build/FileSystem.js +228 -0
  13. package/docs/build/GraphQL.js +229 -0
  14. package/docs/build/GraphQLDataFactory.js +309 -0
  15. package/docs/build/JSONResponse.js +338 -0
  16. package/docs/build/Mochawesome.js +71 -0
  17. package/docs/build/Nightmare.js +2152 -0
  18. package/docs/build/OpenAI.js +126 -0
  19. package/docs/build/Playwright.js +5110 -0
  20. package/docs/build/Protractor.js +2706 -0
  21. package/docs/build/Puppeteer.js +3905 -0
  22. package/docs/build/REST.js +344 -0
  23. package/docs/build/TestCafe.js +2125 -0
  24. package/docs/build/WebDriver.js +4240 -0
  25. package/docs/changelog.md +2572 -0
  26. package/docs/commands.md +266 -0
  27. package/docs/community-helpers.md +58 -0
  28. package/docs/configuration.md +157 -0
  29. package/docs/continuous-integration.md +22 -0
  30. package/docs/custom-helpers.md +306 -0
  31. package/docs/data.md +379 -0
  32. package/docs/detox.md +235 -0
  33. package/docs/docker.md +136 -0
  34. package/docs/email.md +183 -0
  35. package/docs/examples.md +149 -0
  36. package/docs/helpers/ApiDataFactory.md +266 -0
  37. package/docs/helpers/Appium.md +1374 -0
  38. package/docs/helpers/Detox.md +586 -0
  39. package/docs/helpers/Expect.md +275 -0
  40. package/docs/helpers/FileSystem.md +152 -0
  41. package/docs/helpers/GraphQL.md +151 -0
  42. package/docs/helpers/GraphQLDataFactory.md +226 -0
  43. package/docs/helpers/JSONResponse.md +254 -0
  44. package/docs/helpers/Mochawesome.md +8 -0
  45. package/docs/helpers/MockRequest.md +377 -0
  46. package/docs/helpers/Nightmare.md +1305 -0
  47. package/docs/helpers/OpenAI.md +70 -0
  48. package/docs/helpers/Playwright.md +2759 -0
  49. package/docs/helpers/Polly.md +44 -0
  50. package/docs/helpers/Protractor.md +1769 -0
  51. package/docs/helpers/Puppeteer-firefox.md +86 -0
  52. package/docs/helpers/Puppeteer.md +2317 -0
  53. package/docs/helpers/REST.md +218 -0
  54. package/docs/helpers/TestCafe.md +1321 -0
  55. package/docs/helpers/WebDriver.md +2547 -0
  56. package/docs/hooks.md +340 -0
  57. package/docs/index.md +111 -0
  58. package/docs/installation.md +75 -0
  59. package/docs/internal-api.md +266 -0
  60. package/docs/locators.md +339 -0
  61. package/docs/mobile-react-native-locators.md +67 -0
  62. package/docs/mobile.md +338 -0
  63. package/docs/pageobjects.md +291 -0
  64. package/docs/parallel.md +400 -0
  65. package/docs/playwright.md +632 -0
  66. package/docs/plugins.md +1259 -0
  67. package/docs/puppeteer.md +316 -0
  68. package/docs/quickstart.md +162 -0
  69. package/docs/react.md +70 -0
  70. package/docs/reports.md +392 -0
  71. package/docs/secrets.md +36 -0
  72. package/docs/shadow.md +68 -0
  73. package/docs/shared/keys.mustache +31 -0
  74. package/docs/shared/react.mustache +1 -0
  75. package/docs/testcafe.md +174 -0
  76. package/docs/translation.md +247 -0
  77. package/docs/tutorial.md +271 -0
  78. package/docs/typescript.md +180 -0
  79. package/docs/ui.md +59 -0
  80. package/docs/videos.md +28 -0
  81. package/docs/visual.md +202 -0
  82. package/docs/vue.md +143 -0
  83. package/docs/webapi/amOnPage.mustache +11 -0
  84. package/docs/webapi/appendField.mustache +11 -0
  85. package/docs/webapi/attachFile.mustache +12 -0
  86. package/docs/webapi/blur.mustache +18 -0
  87. package/docs/webapi/checkOption.mustache +13 -0
  88. package/docs/webapi/clearCookie.mustache +9 -0
  89. package/docs/webapi/clearField.mustache +9 -0
  90. package/docs/webapi/click.mustache +25 -0
  91. package/docs/webapi/clickLink.mustache +8 -0
  92. package/docs/webapi/closeCurrentTab.mustache +7 -0
  93. package/docs/webapi/closeOtherTabs.mustache +8 -0
  94. package/docs/webapi/dontSee.mustache +11 -0
  95. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +10 -0
  96. package/docs/webapi/dontSeeCookie.mustache +8 -0
  97. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +10 -0
  98. package/docs/webapi/dontSeeElement.mustache +8 -0
  99. package/docs/webapi/dontSeeElementInDOM.mustache +8 -0
  100. package/docs/webapi/dontSeeInCurrentUrl.mustache +4 -0
  101. package/docs/webapi/dontSeeInField.mustache +11 -0
  102. package/docs/webapi/dontSeeInSource.mustache +8 -0
  103. package/docs/webapi/dontSeeInTitle.mustache +8 -0
  104. package/docs/webapi/doubleClick.mustache +13 -0
  105. package/docs/webapi/downloadFile.mustache +12 -0
  106. package/docs/webapi/dragAndDrop.mustache +9 -0
  107. package/docs/webapi/dragSlider.mustache +11 -0
  108. package/docs/webapi/executeAsyncScript.mustache +24 -0
  109. package/docs/webapi/executeScript.mustache +26 -0
  110. package/docs/webapi/fillField.mustache +16 -0
  111. package/docs/webapi/focus.mustache +13 -0
  112. package/docs/webapi/forceClick.mustache +28 -0
  113. package/docs/webapi/forceRightClick.mustache +18 -0
  114. package/docs/webapi/grabAllWindowHandles.mustache +7 -0
  115. package/docs/webapi/grabAttributeFrom.mustache +10 -0
  116. package/docs/webapi/grabAttributeFromAll.mustache +9 -0
  117. package/docs/webapi/grabBrowserLogs.mustache +9 -0
  118. package/docs/webapi/grabCookie.mustache +11 -0
  119. package/docs/webapi/grabCssPropertyFrom.mustache +11 -0
  120. package/docs/webapi/grabCssPropertyFromAll.mustache +10 -0
  121. package/docs/webapi/grabCurrentUrl.mustache +9 -0
  122. package/docs/webapi/grabCurrentWindowHandle.mustache +6 -0
  123. package/docs/webapi/grabDataFromPerformanceTiming.mustache +20 -0
  124. package/docs/webapi/grabElementBoundingRect.mustache +20 -0
  125. package/docs/webapi/grabGeoLocation.mustache +8 -0
  126. package/docs/webapi/grabHTMLFrom.mustache +10 -0
  127. package/docs/webapi/grabHTMLFromAll.mustache +9 -0
  128. package/docs/webapi/grabNumberOfOpenTabs.mustache +8 -0
  129. package/docs/webapi/grabNumberOfVisibleElements.mustache +9 -0
  130. package/docs/webapi/grabPageScrollPosition.mustache +8 -0
  131. package/docs/webapi/grabPopupText.mustache +5 -0
  132. package/docs/webapi/grabSource.mustache +8 -0
  133. package/docs/webapi/grabTextFrom.mustache +10 -0
  134. package/docs/webapi/grabTextFromAll.mustache +9 -0
  135. package/docs/webapi/grabTitle.mustache +8 -0
  136. package/docs/webapi/grabValueFrom.mustache +9 -0
  137. package/docs/webapi/grabValueFromAll.mustache +8 -0
  138. package/docs/webapi/grabWebElement.mustache +9 -0
  139. package/docs/webapi/grabWebElements.mustache +9 -0
  140. package/docs/webapi/moveCursorTo.mustache +12 -0
  141. package/docs/webapi/openNewTab.mustache +7 -0
  142. package/docs/webapi/pressKey.mustache +12 -0
  143. package/docs/webapi/pressKeyDown.mustache +12 -0
  144. package/docs/webapi/pressKeyUp.mustache +12 -0
  145. package/docs/webapi/pressKeyWithKeyNormalization.mustache +60 -0
  146. package/docs/webapi/refreshPage.mustache +6 -0
  147. package/docs/webapi/resizeWindow.mustache +6 -0
  148. package/docs/webapi/rightClick.mustache +14 -0
  149. package/docs/webapi/saveElementScreenshot.mustache +10 -0
  150. package/docs/webapi/saveScreenshot.mustache +12 -0
  151. package/docs/webapi/say.mustache +10 -0
  152. package/docs/webapi/scrollIntoView.mustache +11 -0
  153. package/docs/webapi/scrollPageToBottom.mustache +6 -0
  154. package/docs/webapi/scrollPageToTop.mustache +6 -0
  155. package/docs/webapi/scrollTo.mustache +12 -0
  156. package/docs/webapi/see.mustache +11 -0
  157. package/docs/webapi/seeAttributesOnElements.mustache +9 -0
  158. package/docs/webapi/seeCheckboxIsChecked.mustache +10 -0
  159. package/docs/webapi/seeCookie.mustache +8 -0
  160. package/docs/webapi/seeCssPropertiesOnElements.mustache +9 -0
  161. package/docs/webapi/seeCurrentUrlEquals.mustache +11 -0
  162. package/docs/webapi/seeElement.mustache +8 -0
  163. package/docs/webapi/seeElementInDOM.mustache +8 -0
  164. package/docs/webapi/seeInCurrentUrl.mustache +8 -0
  165. package/docs/webapi/seeInField.mustache +12 -0
  166. package/docs/webapi/seeInPopup.mustache +8 -0
  167. package/docs/webapi/seeInSource.mustache +7 -0
  168. package/docs/webapi/seeInTitle.mustache +8 -0
  169. package/docs/webapi/seeNumberOfElements.mustache +11 -0
  170. package/docs/webapi/seeNumberOfVisibleElements.mustache +10 -0
  171. package/docs/webapi/seeTextEquals.mustache +9 -0
  172. package/docs/webapi/seeTitleEquals.mustache +8 -0
  173. package/docs/webapi/selectOption.mustache +21 -0
  174. package/docs/webapi/setCookie.mustache +16 -0
  175. package/docs/webapi/setGeoLocation.mustache +12 -0
  176. package/docs/webapi/switchTo.mustache +9 -0
  177. package/docs/webapi/switchToNextTab.mustache +10 -0
  178. package/docs/webapi/switchToPreviousTab.mustache +10 -0
  179. package/docs/webapi/type.mustache +21 -0
  180. package/docs/webapi/uncheckOption.mustache +13 -0
  181. package/docs/webapi/wait.mustache +8 -0
  182. package/docs/webapi/waitForClickable.mustache +11 -0
  183. package/docs/webapi/waitForDetached.mustache +10 -0
  184. package/docs/webapi/waitForElement.mustache +11 -0
  185. package/docs/webapi/waitForEnabled.mustache +6 -0
  186. package/docs/webapi/waitForFunction.mustache +17 -0
  187. package/docs/webapi/waitForInvisible.mustache +10 -0
  188. package/docs/webapi/waitForNumberOfTabs.mustache +9 -0
  189. package/docs/webapi/waitForText.mustache +13 -0
  190. package/docs/webapi/waitForValue.mustache +10 -0
  191. package/docs/webapi/waitForVisible.mustache +10 -0
  192. package/docs/webapi/waitInUrl.mustache +9 -0
  193. package/docs/webapi/waitNumberOfVisibleElements.mustache +10 -0
  194. package/docs/webapi/waitToHide.mustache +10 -0
  195. package/docs/webapi/waitUrlEquals.mustache +10 -0
  196. package/docs/webdriver.md +701 -0
  197. package/docs/wiki/Books-&-Posts.md +27 -0
  198. package/docs/wiki/Community-Helpers-&-Plugins.md +53 -0
  199. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +61 -0
  200. package/docs/wiki/Examples.md +145 -0
  201. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +68 -0
  202. package/docs/wiki/Home.md +16 -0
  203. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +83 -0
  204. package/docs/wiki/Release-Process.md +24 -0
  205. package/docs/wiki/Roadmap.md +23 -0
  206. package/docs/wiki/Tests.md +1393 -0
  207. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +153 -0
  208. package/docs/wiki/Videos.md +19 -0
  209. package/package.json +2 -1
@@ -0,0 +1,586 @@
1
+ ---
2
+ permalink: /helpers/Detox
3
+ sidebar: auto
4
+ title: Detox
5
+ ---
6
+
7
+ # Detox
8
+
9
+
10
+ <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
11
+
12
+ ## Detox
13
+
14
+ **Extends Helper**
15
+
16
+ This is a wrapper on top of [Detox][1] library, aimied to unify testing experience for CodeceptJS framework.
17
+ Detox provides a grey box testing for mobile applications, playing especially good for React Native apps.
18
+
19
+ Detox plays quite differently from Appium. To establish detox testing you need to build a mobile application in a special way to inject Detox code.
20
+ This why **Detox is grey box testing** solution, so you need an access to application source code, and a way to build and execute it on emulator.
21
+
22
+ Comparing to Appium, Detox runs faster and more stable but requires an additional setup for build.
23
+
24
+ ### Setup
25
+
26
+ 1. [Install and configure Detox for iOS][2] and [Android][3]
27
+ 2. [Build an application][4] using `detox build` command.
28
+ 3. Install [CodeceptJS][5] and detox-helper:
29
+
30
+
31
+ npm i @codeceptjs/detox-helper --save
32
+
33
+ Detox configuration is required in `package.json` under `detox` section.
34
+
35
+ If you completed step 1 and step 2 you should have a configuration similar this:
36
+
37
+ ```js
38
+ "detox": {
39
+ "configurations": {
40
+ "ios.sim.debug": {
41
+ "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/example.app",
42
+ "build": "xcodebuild -project ios/example.xcodeproj -scheme example -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
43
+ "type": "ios.simulator",
44
+ "name": "iPhone 7"
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ ### Configuration
51
+
52
+ Besides Detox configuration, CodeceptJS should also be configured to use Detox.
53
+
54
+ In `codecept.conf.js` enable Detox helper:
55
+
56
+ ```js
57
+ helpers: {
58
+ Detox: {
59
+ require: '@codeceptjs/detox-helper',
60
+ configuration: '<detox-configuration-name>',
61
+ }
62
+ }
63
+ ```
64
+
65
+ It's important to specify a package name under `require` section and current detox configuration taken from `package.json`.
66
+
67
+ Options:
68
+
69
+ - `configuration` - a detox configuration name. Required.
70
+ - `reloadReactNative` - should be enabled for React Native applications.
71
+ - `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app.
72
+ - `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally.
73
+
74
+ ### Parameters
75
+
76
+ - `config`
77
+
78
+ ### appendField
79
+
80
+ Appends text into the field.
81
+ A field can be located by text, accessibility id, id.
82
+
83
+ ```js
84
+ I.appendField('name', 'davert');
85
+ ```
86
+
87
+ #### Parameters
88
+
89
+ - `field` **([string][6] \| [object][7])**
90
+ - `value` **[string][6]**
91
+
92
+ ### clearField
93
+
94
+ Clears a text field.
95
+ A field can be located by text, accessibility id, id.
96
+
97
+ ```js
98
+ I.clearField('~name');
99
+ ```
100
+
101
+ #### Parameters
102
+
103
+ - `field` **([string][6] \| [object][7])** an input element to clear
104
+
105
+ ### click
106
+
107
+ Clicks on an element.
108
+ Element can be located by its text or id or accessibility id
109
+
110
+ The second parameter is a context (id | type | accessibility id) to narrow the search.
111
+
112
+ Same as [tap][8]
113
+
114
+ ```js
115
+ I.click('Login'); // locate by text
116
+ I.click('~nav-1'); // locate by accessibility label
117
+ I.click('#user'); // locate by id
118
+ I.click('Login', '#nav'); // locate by text inside #nav
119
+ I.click({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and Android
120
+ ```
121
+
122
+ #### Parameters
123
+
124
+ - `locator` **([string][6] \| [object][7])**
125
+ - `context` **([string][6] \| [object][7] | null)** (optional, default `null`)
126
+
127
+ ### clickAtPoint
128
+
129
+ Performs click on element with horizontal and vertical offset.
130
+ An element is located by text, id, accessibility id.
131
+
132
+ ```js
133
+ I.clickAtPoint('Save', 10, 10);
134
+ I.clickAtPoint('~save', 10, 10); // locate by accessibility id
135
+ ```
136
+
137
+ #### Parameters
138
+
139
+ - `locator` **([string][6] \| [object][7])**
140
+ - `x` **[number][9]** horizontal offset (optional, default `0`)
141
+ - `y` **[number][9]** vertical offset (optional, default `0`)
142
+
143
+ ### dontSee
144
+
145
+ Checks text not to be visible.
146
+ Use second parameter to narrow down the search.
147
+
148
+ ```js
149
+ I.dontSee('Record created');
150
+ I.dontSee('Record updated', '#message');
151
+ I.dontSee('Record deleted', '~message');
152
+ ```
153
+
154
+ #### Parameters
155
+
156
+ - `text` **[string][6]** to check invisibility
157
+ - `context` **([string][6] \| [object][7] | null)** element in which to search for text (optional, default `null`)
158
+
159
+ ### dontSeeElement
160
+
161
+ Checks that element is not visible.
162
+ Use second parameter to narrow down the search.
163
+
164
+ ```js
165
+ I.dontSeeElement('~edit'); // located by accessibility id
166
+ I.dontSeeElement('~edit', '#menu'); // element inside #menu
167
+ ```
168
+
169
+ #### Parameters
170
+
171
+ - `locator` **([string][6] \| [object][7])** element to locate
172
+ - `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
173
+
174
+ ### dontSeeElementExists
175
+
176
+ Checks that element not exists.
177
+ Use second parameter to narrow down the search.
178
+
179
+ ```js
180
+ I.dontSeeElementExist('~edit'); // located by accessibility id
181
+ I.dontSeeElementExist('~edit', '#menu'); // element inside #menu
182
+ ```
183
+
184
+ #### Parameters
185
+
186
+ - `locator` **([string][6] \| [object][7])** element to locate
187
+ - `context` **([string][6] \| [object][7])** context element (optional, default `null`)
188
+
189
+ ### fillField
190
+
191
+ Fills in text field in an app.
192
+ A field can be located by text, accessibility id, id.
193
+
194
+ ```js
195
+ I.fillField('Username', 'davert');
196
+ I.fillField('~name', 'davert');
197
+ I.fillField({ android: 'NAME', ios: 'name' }, 'davert');
198
+ ```
199
+
200
+ #### Parameters
201
+
202
+ - `field` **([string][6] \| [object][7])** an input element to fill in
203
+ - `value` **[string][6]** value to fill
204
+
205
+ ### goBack
206
+
207
+ Goes back on Android
208
+
209
+ ```js
210
+ I.goBack(); // on Android only
211
+ ```
212
+
213
+ ### installApp
214
+
215
+ Installs a configured application.
216
+ Application is installed by default.
217
+
218
+ ```js
219
+ I.installApp();
220
+ ```
221
+
222
+ ### launchApp
223
+
224
+ Launches an application. If application instance already exists, use [relaunchApp][10].
225
+
226
+ ```js
227
+ I.launchApp();
228
+ ```
229
+
230
+ ### longPress
231
+
232
+ Taps an element and holds for a requested time.
233
+
234
+ ```js
235
+ I.longPress('Login', 2); // locate by text, hold for 2 seconds
236
+ I.longPress('~nav', 1); // locate by accessibility label, hold for second
237
+ I.longPress('Update', 2, '#menu'); // locate by text inside #menu, hold for 2 seconds
238
+ ```
239
+
240
+ #### Parameters
241
+
242
+ - `locator` **([string][6] \| [object][7])** element to locate
243
+ - `sec` **[number][9]** number of seconds to hold tap
244
+ - `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
245
+
246
+ ### multiTap
247
+
248
+ Multi taps on an element.
249
+ Element can be located by its text or id or accessibility id.
250
+
251
+ Set the number of taps in second argument.
252
+ Optionally define the context element by third argument.
253
+
254
+ ```js
255
+ I.multiTap('Login', 2); // locate by text
256
+ I.multiTap('~nav', 2); // locate by accessibility label
257
+ I.multiTap('#user', 2); // locate by id
258
+ I.multiTap('Update', 2, '#menu'); // locate by id
259
+ ```
260
+
261
+ #### Parameters
262
+
263
+ - `locator` **([string][6] \| [object][7])** element to locate
264
+ - `num` **[number][9]** number of taps
265
+ - `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
266
+
267
+ ### relaunchApp
268
+
269
+ Relaunches an application.
270
+
271
+ ```js
272
+ I.relaunchApp();
273
+ ```
274
+
275
+ ### runOnAndroid
276
+
277
+ Execute code only on Android
278
+
279
+ ```js
280
+ I.runOnAndroid(() => {
281
+ I.click('Button');
282
+ I.see('Hi, Android');
283
+ });
284
+ ```
285
+
286
+ #### Parameters
287
+
288
+ - `fn` **[Function][11]** a function which will be executed on android
289
+
290
+ ### runOnIOS
291
+
292
+ Execute code only on iOS
293
+
294
+ ```js
295
+ I.runOnIOS(() => {
296
+ I.click('Button');
297
+ I.see('Hi, IOS');
298
+ });
299
+ ```
300
+
301
+ #### Parameters
302
+
303
+ - `fn` **[Function][11]** a function which will be executed on iOS
304
+
305
+ ### saveScreenshot
306
+
307
+ Saves a screenshot to the output dir
308
+
309
+ ```js
310
+ I.saveScreenshot('main-window.png');
311
+ ```
312
+
313
+ #### Parameters
314
+
315
+ - `name` **[string][6]**
316
+
317
+ ### scrollDown
318
+
319
+ Scrolls to the bottom of an element.
320
+
321
+ ```js
322
+ I.scrollDown('#container');
323
+ ```
324
+
325
+ #### Parameters
326
+
327
+ - `locator` **([string][6] \| [object][7])**
328
+
329
+ ### scrollLeft
330
+
331
+ Scrolls to the left of an element.
332
+
333
+ ```js
334
+ I.scrollLeft('#container');
335
+ ```
336
+
337
+ #### Parameters
338
+
339
+ - `locator` **([string][6] \| [object][7])**
340
+
341
+ ### scrollRight
342
+
343
+ Scrolls to the right of an element.
344
+
345
+ ```js
346
+ I.scrollRight('#container');
347
+ ```
348
+
349
+ #### Parameters
350
+
351
+ - `locator` **([string][6] \| [object][7])**
352
+
353
+ ### scrollUp
354
+
355
+ Scrolls to the top of an element.
356
+
357
+ ```js
358
+ I.scrollUp('#container');
359
+ ```
360
+
361
+ #### Parameters
362
+
363
+ - `locator` **([string][6] \| [object][7])**
364
+
365
+ ### see
366
+
367
+ Checks text to be visible.
368
+ Use second parameter to narrow down the search.
369
+
370
+ ```js
371
+ I.see('Record created');
372
+ I.see('Record updated', '#message');
373
+ I.see('Record deleted', '~message');
374
+ ```
375
+
376
+ #### Parameters
377
+
378
+ - `text` **[string][6]** to check visibility
379
+ - `context` **([string][6] \| [object][7] | null)** element inside which to search for text (optional, default `null`)
380
+
381
+ ### seeElement
382
+
383
+ Checks for visibility of an element.
384
+ Use second parameter to narrow down the search.
385
+
386
+ ```js
387
+ I.seeElement('~edit'); // located by accessibility id
388
+ I.seeElement('~edit', '#menu'); // element inside #menu
389
+ ```
390
+
391
+ #### Parameters
392
+
393
+ - `locator` **([string][6] \| [object][7])** element to locate
394
+ - `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
395
+
396
+ ### seeElementExists
397
+
398
+ Checks for existence of an element. An element can be visible or not.
399
+ Use second parameter to narrow down the search.
400
+
401
+ ```js
402
+ I.seeElementExists('~edit'); // located by accessibility id
403
+ I.seeElementExists('~edit', '#menu'); // element inside #menu
404
+ ```
405
+
406
+ #### Parameters
407
+
408
+ - `locator` **([string][6] \| [object][7])** element to locate
409
+ - `context` **([string][6] \| [object][7])** context element (optional, default `null`)
410
+
411
+ ### setLandscapeOrientation
412
+
413
+ Switches device to landscape orientation
414
+
415
+ ```js
416
+ I.setLandscapeOrientation();
417
+ ```
418
+
419
+ ### setPortraitOrientation
420
+
421
+ Switches device to portrait orientation
422
+
423
+ ```js
424
+ I.setPortraitOrientation();
425
+ ```
426
+
427
+ ### shakeDevice
428
+
429
+ Shakes the device.
430
+
431
+ ```js
432
+ I.shakeDevice();
433
+ ```
434
+
435
+ ### swipeDown
436
+
437
+ Performs a swipe up inside an element.
438
+ Can be `slow` or `fast` swipe.
439
+
440
+ ```js
441
+ I.swipeUp('#container');
442
+ ```
443
+
444
+ #### Parameters
445
+
446
+ - `locator` **([string][6] \| [object][7])** an element on which to perform swipe
447
+ - `speed` **[string][6]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`)
448
+
449
+ ### swipeLeft
450
+
451
+ Performs a swipe up inside an element.
452
+ Can be `slow` or `fast` swipe.
453
+
454
+ ```js
455
+ I.swipeUp('#container');
456
+ ```
457
+
458
+ #### Parameters
459
+
460
+ - `locator` **([string][6] \| [object][7])** an element on which to perform swipe
461
+ - `speed` **[string][6]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`)
462
+
463
+ ### swipeRight
464
+
465
+ Performs a swipe up inside an element.
466
+ Can be `slow` or `fast` swipe.
467
+
468
+ ```js
469
+ I.swipeUp('#container');
470
+ ```
471
+
472
+ #### Parameters
473
+
474
+ - `locator` **([string][6] \| [object][7])** an element on which to perform swipe
475
+ - `speed` **[string][6]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`)
476
+
477
+ ### swipeUp
478
+
479
+ Performs a swipe up inside an element.
480
+ Can be `slow` or `fast` swipe.
481
+
482
+ ```js
483
+ I.swipeUp('#container');
484
+ ```
485
+
486
+ #### Parameters
487
+
488
+ - `locator` **([string][6] \| [object][7])** an element on which to perform swipe
489
+ - `speed` **[string][6]** a speed to perform: `slow` or `fast`. (optional, default `'slow'`)
490
+
491
+ ### tap
492
+
493
+ Taps on an element.
494
+ Element can be located by its text or id or accessibility id.
495
+
496
+ The second parameter is a context element to narrow the search.
497
+
498
+ Same as [click][12]
499
+
500
+ ```js
501
+ I.tap('Login'); // locate by text
502
+ I.tap('~nav-1'); // locate by accessibility label
503
+ I.tap('#user'); // locate by id
504
+ I.tap('Login', '#nav'); // locate by text inside #nav
505
+ I.tap({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and Android
506
+ ```
507
+
508
+ #### Parameters
509
+
510
+ - `locator` **([string][6] \| [object][7])**
511
+ - `context` **([string][6] \| [object][7] | null)** (optional, default `null`)
512
+
513
+ ### wait
514
+
515
+ Waits for number of seconds
516
+
517
+ ```js
518
+ I.wait(2); // waits for 2 seconds
519
+ ```
520
+
521
+ #### Parameters
522
+
523
+ - `sec` **[number][9]** number of seconds to wait
524
+
525
+ ### waitForElement
526
+
527
+ Waits for an element to exist on page.
528
+
529
+ ```js
530
+ I.waitForElement('#message', 1); // wait for 1 second
531
+ ```
532
+
533
+ #### Parameters
534
+
535
+ - `locator` **([string][6] \| [object][7])** an element to wait for
536
+ - `sec` **[number][9]** number of seconds to wait, 5 by default (optional, default `5`)
537
+
538
+ ### waitForElementVisible
539
+
540
+ Waits for an element to be visible on page.
541
+
542
+ ```js
543
+ I.waitForElementVisible('#message', 1); // wait for 1 second
544
+ ```
545
+
546
+ #### Parameters
547
+
548
+ - `locator` **([string][6] \| [object][7])** an element to wait for
549
+ - `sec` **[number][9]** number of seconds to wait (optional, default `5`)
550
+
551
+ ### waitToHide
552
+
553
+ Waits an elment to become not visible.
554
+
555
+ ```js
556
+ I.waitToHide('#message', 2); // wait for 2 seconds
557
+ ```
558
+
559
+ #### Parameters
560
+
561
+ - `locator` **([string][6] \| [object][7])** an element to wait for
562
+ - `sec` **[number][9]** number of seconds to wait (optional, default `5`)
563
+
564
+ [1]: https://github.com/wix/Detox
565
+
566
+ [2]: https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md
567
+
568
+ [3]: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md
569
+
570
+ [4]: https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md#step-4-build-your-app-and-run-detox-tests
571
+
572
+ [5]: https://codecept.io
573
+
574
+ [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
575
+
576
+ [7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
577
+
578
+ [8]: #tap
579
+
580
+ [9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
581
+
582
+ [10]: #relaunchApp
583
+
584
+ [11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
585
+
586
+ [12]: #click