codeceptjs 3.3.1 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +4 -25
- package/docs/api.md +4 -0
- package/docs/basics.md +2 -0
- package/docs/build/Appium.js +18 -28
- package/docs/build/JSONResponse.js +44 -3
- package/docs/build/Nightmare.js +53 -53
- package/docs/build/Playwright.js +95 -103
- package/docs/build/Protractor.js +66 -66
- package/docs/build/Puppeteer.js +74 -74
- package/docs/build/REST.js +8 -4
- package/docs/build/TestCafe.js +53 -53
- package/docs/build/WebDriver.js +84 -86
- package/docs/changelog.md +49 -0
- package/docs/helpers/Appium.md +212 -268
- package/docs/helpers/JSONResponse.md +24 -0
- package/docs/helpers/Nightmare.md +92 -141
- package/docs/helpers/Playwright.md +302 -413
- package/docs/helpers/Puppeteer.md +171 -231
- package/docs/helpers/REST.md +2 -0
- package/docs/helpers/TestCafe.md +125 -174
- package/docs/helpers/WebDriver.md +184 -247
- package/docs/plugins.md +41 -1
- package/docs/secrets.md +30 -0
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +1 -1
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/cli.js +1 -1
- package/lib/command/interactive.js +1 -1
- package/lib/command/run-workers.js +1 -1
- package/lib/command/workers/runTests.js +15 -0
- package/lib/helper/Appium.js +0 -10
- package/lib/helper/JSONResponse.js +44 -3
- package/lib/helper/Playwright.js +24 -32
- package/lib/helper/REST.js +8 -4
- package/lib/helper/WebDriver.js +5 -7
- package/lib/output.js +4 -0
- package/lib/plugin/customLocator.js +50 -3
- package/lib/plugin/retryFailedStep.js +1 -1
- package/lib/plugin/retryTo.js +1 -8
- package/lib/secret.js +30 -0
- package/lib/step.js +1 -1
- package/package.json +4 -4
- package/typings/types.d.ts +1016 -520
package/docs/helpers/Appium.md
CHANGED
|
@@ -150,8 +150,6 @@ I.runOnAndroid((caps) => {
|
|
|
150
150
|
- `caps` **any**
|
|
151
151
|
- `fn` **any**
|
|
152
152
|
|
|
153
|
-
Returns **[Promise][4]<any>**
|
|
154
|
-
|
|
155
153
|
### runOnAndroid
|
|
156
154
|
|
|
157
155
|
Execute code only on Android
|
|
@@ -188,8 +186,6 @@ I.runOnAndroid((caps) => {
|
|
|
188
186
|
- `caps` **any**
|
|
189
187
|
- `fn` **any**
|
|
190
188
|
|
|
191
|
-
Returns **[Promise][4]<any>**
|
|
192
|
-
|
|
193
189
|
### runInWeb
|
|
194
190
|
|
|
195
191
|
Execute code only in Web mode.
|
|
@@ -205,8 +201,6 @@ I.runInWeb(() => {
|
|
|
205
201
|
|
|
206
202
|
- `fn` **any**
|
|
207
203
|
|
|
208
|
-
Returns **[Promise][4]<any>**
|
|
209
|
-
|
|
210
204
|
### seeAppIsInstalled
|
|
211
205
|
|
|
212
206
|
Check if an app is installed.
|
|
@@ -217,9 +211,9 @@ I.seeAppIsInstalled("com.example.android.apis");
|
|
|
217
211
|
|
|
218
212
|
#### Parameters
|
|
219
213
|
|
|
220
|
-
- `bundleId` **[string][
|
|
214
|
+
- `bundleId` **[string][4]** String ID of bundled app
|
|
221
215
|
|
|
222
|
-
Returns **[Promise][
|
|
216
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
223
217
|
|
|
224
218
|
### seeAppIsNotInstalled
|
|
225
219
|
|
|
@@ -231,9 +225,9 @@ I.seeAppIsNotInstalled("com.example.android.apis");
|
|
|
231
225
|
|
|
232
226
|
#### Parameters
|
|
233
227
|
|
|
234
|
-
- `bundleId` **[string][
|
|
228
|
+
- `bundleId` **[string][4]** String ID of bundled app
|
|
235
229
|
|
|
236
|
-
Returns **[Promise][
|
|
230
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
237
231
|
|
|
238
232
|
### installApp
|
|
239
233
|
|
|
@@ -245,9 +239,9 @@ I.installApp('/path/to/file.apk');
|
|
|
245
239
|
|
|
246
240
|
#### Parameters
|
|
247
241
|
|
|
248
|
-
- `path` **[string][
|
|
242
|
+
- `path` **[string][4]** path to apk file
|
|
249
243
|
|
|
250
|
-
Returns **[Promise][
|
|
244
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
251
245
|
|
|
252
246
|
### removeApp
|
|
253
247
|
|
|
@@ -261,10 +255,8 @@ Appium: support only Android
|
|
|
261
255
|
|
|
262
256
|
#### Parameters
|
|
263
257
|
|
|
264
|
-
- `appId` **[string][
|
|
265
|
-
- `bundleId` **[string][
|
|
266
|
-
|
|
267
|
-
Returns **[Promise][4]<any>**
|
|
258
|
+
- `appId` **[string][4]**
|
|
259
|
+
- `bundleId` **[string][4]?** ID of bundle
|
|
268
260
|
|
|
269
261
|
### seeCurrentActivityIs
|
|
270
262
|
|
|
@@ -276,9 +268,9 @@ I.seeCurrentActivityIs(".HomeScreenActivity")
|
|
|
276
268
|
|
|
277
269
|
#### Parameters
|
|
278
270
|
|
|
279
|
-
- `currentActivity` **[string][
|
|
271
|
+
- `currentActivity` **[string][4]**
|
|
280
272
|
|
|
281
|
-
Returns **[Promise][
|
|
273
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
282
274
|
|
|
283
275
|
### seeDeviceIsLocked
|
|
284
276
|
|
|
@@ -288,7 +280,7 @@ Check whether the device is locked.
|
|
|
288
280
|
I.seeDeviceIsLocked();
|
|
289
281
|
```
|
|
290
282
|
|
|
291
|
-
Returns **[Promise][
|
|
283
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
292
284
|
|
|
293
285
|
### seeDeviceIsUnlocked
|
|
294
286
|
|
|
@@ -298,7 +290,7 @@ Check whether the device is not locked.
|
|
|
298
290
|
I.seeDeviceIsUnlocked();
|
|
299
291
|
```
|
|
300
292
|
|
|
301
|
-
Returns **[Promise][
|
|
293
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
302
294
|
|
|
303
295
|
### seeOrientationIs
|
|
304
296
|
|
|
@@ -313,7 +305,7 @@ I.seeOrientationIs('LANDSCAPE')
|
|
|
313
305
|
|
|
314
306
|
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS
|
|
315
307
|
|
|
316
|
-
Returns **[Promise][
|
|
308
|
+
Returns **[Promise][5]<void>**
|
|
317
309
|
|
|
318
310
|
### setOrientation
|
|
319
311
|
|
|
@@ -326,9 +318,7 @@ I.setOrientation('LANDSCAPE')
|
|
|
326
318
|
|
|
327
319
|
#### Parameters
|
|
328
320
|
|
|
329
|
-
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or
|
|
330
|
-
|
|
331
|
-
Returns **[Promise][4]<any>** Appium: support Android and iOS
|
|
321
|
+
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS
|
|
332
322
|
|
|
333
323
|
### grabAllContexts
|
|
334
324
|
|
|
@@ -336,7 +326,7 @@ Get list of all available contexts
|
|
|
336
326
|
|
|
337
327
|
let contexts = await I.grabAllContexts();
|
|
338
328
|
|
|
339
|
-
Returns **[Promise][
|
|
329
|
+
Returns **[Promise][5]<[Array][6]<[string][4]>>** Appium: support Android and iOS
|
|
340
330
|
|
|
341
331
|
### grabContext
|
|
342
332
|
|
|
@@ -346,7 +336,7 @@ Retrieve current context
|
|
|
346
336
|
let context = await I.grabContext();
|
|
347
337
|
```
|
|
348
338
|
|
|
349
|
-
Returns **[Promise][
|
|
339
|
+
Returns **[Promise][5]<([string][4] | null)>** Appium: support Android and iOS
|
|
350
340
|
|
|
351
341
|
### grabCurrentActivity
|
|
352
342
|
|
|
@@ -356,7 +346,7 @@ Get current device activity.
|
|
|
356
346
|
let activity = await I.grabCurrentActivity();
|
|
357
347
|
```
|
|
358
348
|
|
|
359
|
-
Returns **[Promise][
|
|
349
|
+
Returns **[Promise][5]<[string][4]>** Appium: support only Android
|
|
360
350
|
|
|
361
351
|
### grabNetworkConnection
|
|
362
352
|
|
|
@@ -368,7 +358,7 @@ properties to the response object to allow easier assertions.
|
|
|
368
358
|
let con = await I.grabNetworkConnection();
|
|
369
359
|
```
|
|
370
360
|
|
|
371
|
-
Returns **[Promise][
|
|
361
|
+
Returns **[Promise][5]<{}>** Appium: support only Android
|
|
372
362
|
|
|
373
363
|
### grabOrientation
|
|
374
364
|
|
|
@@ -378,7 +368,7 @@ Get current orientation.
|
|
|
378
368
|
let orientation = await I.grabOrientation();
|
|
379
369
|
```
|
|
380
370
|
|
|
381
|
-
Returns **[Promise][
|
|
371
|
+
Returns **[Promise][5]<[string][4]>** Appium: support Android and iOS
|
|
382
372
|
|
|
383
373
|
### grabSettings
|
|
384
374
|
|
|
@@ -388,7 +378,7 @@ Get all the currently specified settings.
|
|
|
388
378
|
let settings = await I.grabSettings();
|
|
389
379
|
```
|
|
390
380
|
|
|
391
|
-
Returns **[Promise][
|
|
381
|
+
Returns **[Promise][5]<[string][4]>** Appium: support Android and iOS
|
|
392
382
|
|
|
393
383
|
### \_switchToContext
|
|
394
384
|
|
|
@@ -398,8 +388,6 @@ Switch to the specified context.
|
|
|
398
388
|
|
|
399
389
|
- `context` **any** the context to switch to
|
|
400
390
|
|
|
401
|
-
Returns **[Promise][4]<any>**
|
|
402
|
-
|
|
403
391
|
### switchToWeb
|
|
404
392
|
|
|
405
393
|
Switches to web context.
|
|
@@ -415,9 +403,9 @@ I.switchToWeb('WEBVIEW_io.selendroid.testapp');
|
|
|
415
403
|
|
|
416
404
|
#### Parameters
|
|
417
405
|
|
|
418
|
-
- `context` **[string][
|
|
406
|
+
- `context` **[string][4]?**
|
|
419
407
|
|
|
420
|
-
Returns **[Promise][
|
|
408
|
+
Returns **[Promise][5]<void>**
|
|
421
409
|
|
|
422
410
|
### switchToNative
|
|
423
411
|
|
|
@@ -435,7 +423,7 @@ I.switchToNative('SOME_OTHER_CONTEXT');
|
|
|
435
423
|
|
|
436
424
|
- `context` **any?** (optional, default `null`)
|
|
437
425
|
|
|
438
|
-
Returns **[Promise][
|
|
426
|
+
Returns **[Promise][5]<void>**
|
|
439
427
|
|
|
440
428
|
### startActivity
|
|
441
429
|
|
|
@@ -450,7 +438,7 @@ I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
|
|
|
450
438
|
- `appPackage`
|
|
451
439
|
- `appActivity`
|
|
452
440
|
|
|
453
|
-
Returns **[Promise][
|
|
441
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
454
442
|
|
|
455
443
|
### setNetworkConnection
|
|
456
444
|
|
|
@@ -474,7 +462,7 @@ See corresponding [webdriverio reference][7].
|
|
|
474
462
|
|
|
475
463
|
- `value`
|
|
476
464
|
|
|
477
|
-
Returns **[Promise][
|
|
465
|
+
Returns **[Promise][5]<{}>** Appium: support only Android
|
|
478
466
|
|
|
479
467
|
### setSettings
|
|
480
468
|
|
|
@@ -486,9 +474,7 @@ I.setSettings({cyberdelia: 'open'});
|
|
|
486
474
|
|
|
487
475
|
#### Parameters
|
|
488
476
|
|
|
489
|
-
- `settings` **[object][8]**
|
|
490
|
-
|
|
491
|
-
Returns **[Promise][4]<any>** Appium: support Android and iOS
|
|
477
|
+
- `settings` **[object][8]** objectAppium: support Android and iOS
|
|
492
478
|
|
|
493
479
|
### hideDeviceKeyboard
|
|
494
480
|
|
|
@@ -508,9 +494,7 @@ Appium: support Android and iOS
|
|
|
508
494
|
#### Parameters
|
|
509
495
|
|
|
510
496
|
- `strategy` **(`"tapOutside"` \| `"pressKey"`)?** Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
|
|
511
|
-
- `key` **[string][
|
|
512
|
-
|
|
513
|
-
Returns **[Promise][4]<any>**
|
|
497
|
+
- `key` **[string][4]?** Optional key
|
|
514
498
|
|
|
515
499
|
### sendDeviceKeyEvent
|
|
516
500
|
|
|
@@ -525,7 +509,7 @@ I.sendDeviceKeyEvent(3);
|
|
|
525
509
|
|
|
526
510
|
- `keyValue` **[number][10]** Device specific key value
|
|
527
511
|
|
|
528
|
-
Returns **[Promise][
|
|
512
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
529
513
|
|
|
530
514
|
### openNotifications
|
|
531
515
|
|
|
@@ -535,7 +519,7 @@ Open the notifications panel on the device.
|
|
|
535
519
|
I.openNotifications();
|
|
536
520
|
```
|
|
537
521
|
|
|
538
|
-
Returns **[Promise][
|
|
522
|
+
Returns **[Promise][5]<void>** Appium: support only Android
|
|
539
523
|
|
|
540
524
|
### makeTouchAction
|
|
541
525
|
|
|
@@ -554,7 +538,7 @@ I.makeTouchAction("~buttonStartWebviewCD", 'tap');
|
|
|
554
538
|
- `locator`
|
|
555
539
|
- `action`
|
|
556
540
|
|
|
557
|
-
Returns **[Promise][
|
|
541
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
558
542
|
|
|
559
543
|
### tap
|
|
560
544
|
|
|
@@ -570,7 +554,7 @@ Shortcut for `makeTouchAction`
|
|
|
570
554
|
|
|
571
555
|
- `locator` **any**
|
|
572
556
|
|
|
573
|
-
Returns **[Promise][
|
|
557
|
+
Returns **[Promise][5]<void>**
|
|
574
558
|
|
|
575
559
|
### swipe
|
|
576
560
|
|
|
@@ -585,12 +569,12 @@ I.swipe(locator, 800, 1200, 1000);
|
|
|
585
569
|
|
|
586
570
|
#### Parameters
|
|
587
571
|
|
|
588
|
-
- `locator` **([string][
|
|
572
|
+
- `locator` **([string][4] \| [object][8])**
|
|
589
573
|
- `xoffset` **[number][10]**
|
|
590
574
|
- `yoffset` **[number][10]**
|
|
591
575
|
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
592
576
|
|
|
593
|
-
Returns **[Promise][
|
|
577
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
594
578
|
|
|
595
579
|
### performSwipe
|
|
596
580
|
|
|
@@ -603,9 +587,7 @@ I.performSwipe({ x: 300, y: 100 }, { x: 200, y: 100 });
|
|
|
603
587
|
#### Parameters
|
|
604
588
|
|
|
605
589
|
- `from` **[object][8]**
|
|
606
|
-
- `to` **[object][8]**
|
|
607
|
-
|
|
608
|
-
Returns **[Promise][4]<any>** Appium: support Android and iOS
|
|
590
|
+
- `to` **[object][8]** Appium: support Android and iOS
|
|
609
591
|
|
|
610
592
|
### swipeDown
|
|
611
593
|
|
|
@@ -620,11 +602,11 @@ I.swipeDown(locator, 1200, 1000); // set offset and speed
|
|
|
620
602
|
|
|
621
603
|
#### Parameters
|
|
622
604
|
|
|
623
|
-
- `locator` **([string][
|
|
605
|
+
- `locator` **([string][4] \| [object][8])**
|
|
624
606
|
- `yoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
625
607
|
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
626
608
|
|
|
627
|
-
Returns **[Promise][
|
|
609
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
628
610
|
|
|
629
611
|
### swipeLeft
|
|
630
612
|
|
|
@@ -639,11 +621,11 @@ I.swipeLeft(locator, 1200, 1000); // set offset and speed
|
|
|
639
621
|
|
|
640
622
|
#### Parameters
|
|
641
623
|
|
|
642
|
-
- `locator` **([string][
|
|
624
|
+
- `locator` **([string][4] \| [object][8])**
|
|
643
625
|
- `xoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
644
626
|
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
645
627
|
|
|
646
|
-
Returns **[Promise][
|
|
628
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
647
629
|
|
|
648
630
|
### swipeRight
|
|
649
631
|
|
|
@@ -658,11 +640,11 @@ I.swipeRight(locator, 1200, 1000); // set offset and speed
|
|
|
658
640
|
|
|
659
641
|
#### Parameters
|
|
660
642
|
|
|
661
|
-
- `locator` **([string][
|
|
643
|
+
- `locator` **([string][4] \| [object][8])**
|
|
662
644
|
- `xoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
663
645
|
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
664
646
|
|
|
665
|
-
Returns **[Promise][
|
|
647
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
666
648
|
|
|
667
649
|
### swipeUp
|
|
668
650
|
|
|
@@ -677,11 +659,11 @@ I.swipeUp(locator, 1200, 1000); // set offset and speed
|
|
|
677
659
|
|
|
678
660
|
#### Parameters
|
|
679
661
|
|
|
680
|
-
- `locator` **([string][
|
|
662
|
+
- `locator` **([string][4] \| [object][8])**
|
|
681
663
|
- `yoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
682
664
|
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
683
665
|
|
|
684
|
-
Returns **[Promise][
|
|
666
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
685
667
|
|
|
686
668
|
### swipeTo
|
|
687
669
|
|
|
@@ -699,14 +681,14 @@ I.swipeTo(
|
|
|
699
681
|
|
|
700
682
|
#### Parameters
|
|
701
683
|
|
|
702
|
-
- `searchableLocator` **[string][
|
|
703
|
-
- `scrollLocator` **[string][
|
|
704
|
-
- `direction` **[string][
|
|
684
|
+
- `searchableLocator` **[string][4]**
|
|
685
|
+
- `scrollLocator` **[string][4]**
|
|
686
|
+
- `direction` **[string][4]**
|
|
705
687
|
- `timeout` **[number][10]**
|
|
706
688
|
- `offset` **[number][10]**
|
|
707
689
|
- `speed` **[number][10]**
|
|
708
690
|
|
|
709
|
-
Returns **[Promise][
|
|
691
|
+
Returns **[Promise][5]<void>** Appium: support Android and iOS
|
|
710
692
|
|
|
711
693
|
### touchPerform
|
|
712
694
|
|
|
@@ -739,8 +721,6 @@ Appium: support Android and iOS
|
|
|
739
721
|
|
|
740
722
|
- `actions` **[Array][6]** Array of touch actions
|
|
741
723
|
|
|
742
|
-
Returns **[Promise][4]<any>**
|
|
743
|
-
|
|
744
724
|
### pullFile
|
|
745
725
|
|
|
746
726
|
Pulls a file from the device.
|
|
@@ -753,10 +733,10 @@ I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);
|
|
|
753
733
|
|
|
754
734
|
#### Parameters
|
|
755
735
|
|
|
756
|
-
- `path` **[string][
|
|
757
|
-
- `dest` **[string][
|
|
736
|
+
- `path` **[string][4]**
|
|
737
|
+
- `dest` **[string][4]**
|
|
758
738
|
|
|
759
|
-
Returns **[Promise][
|
|
739
|
+
Returns **[Promise][5]<[string][4]>** Appium: support Android and iOS
|
|
760
740
|
|
|
761
741
|
### shakeDevice
|
|
762
742
|
|
|
@@ -766,7 +746,7 @@ Perform a shake action on the device.
|
|
|
766
746
|
I.shakeDevice();
|
|
767
747
|
```
|
|
768
748
|
|
|
769
|
-
Returns **[Promise][
|
|
749
|
+
Returns **[Promise][5]<void>** Appium: support only iOS
|
|
770
750
|
|
|
771
751
|
### rotate
|
|
772
752
|
|
|
@@ -787,7 +767,7 @@ See corresponding [webdriverio reference][13].
|
|
|
787
767
|
- `rotation`
|
|
788
768
|
- `touchCount`
|
|
789
769
|
|
|
790
|
-
Returns **[Promise][
|
|
770
|
+
Returns **[Promise][5]<void>** Appium: support only iOS
|
|
791
771
|
|
|
792
772
|
### setImmediateValue
|
|
793
773
|
|
|
@@ -800,7 +780,7 @@ See corresponding [webdriverio reference][14].
|
|
|
800
780
|
- `id`
|
|
801
781
|
- `value`
|
|
802
782
|
|
|
803
|
-
Returns **[Promise][
|
|
783
|
+
Returns **[Promise][5]<void>** Appium: support only iOS
|
|
804
784
|
|
|
805
785
|
### simulateTouchId
|
|
806
786
|
|
|
@@ -816,7 +796,7 @@ I.touchId(false); // simulates invalid fingerprint
|
|
|
816
796
|
|
|
817
797
|
- `match`
|
|
818
798
|
|
|
819
|
-
Returns **[Promise][
|
|
799
|
+
Returns **[Promise][5]<void>** Appium: support only iOS
|
|
820
800
|
TODO: not tested
|
|
821
801
|
|
|
822
802
|
### closeApp
|
|
@@ -827,7 +807,7 @@ Close the given application.
|
|
|
827
807
|
I.closeApp();
|
|
828
808
|
```
|
|
829
809
|
|
|
830
|
-
Returns **[Promise][
|
|
810
|
+
Returns **[Promise][5]<void>** Appium: support only iOS
|
|
831
811
|
|
|
832
812
|
### appendField
|
|
833
813
|
|
|
@@ -840,10 +820,9 @@ I.appendField('#myTextField', 'appended');
|
|
|
840
820
|
|
|
841
821
|
#### Parameters
|
|
842
822
|
|
|
843
|
-
- `field` **([string][
|
|
844
|
-
- `value` **[string][
|
|
845
|
-
|
|
846
|
-
Returns **[Promise][4]<any>**
|
|
823
|
+
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator
|
|
824
|
+
- `value` **[string][4]** text value to append.
|
|
825
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
847
826
|
|
|
848
827
|
### checkOption
|
|
849
828
|
|
|
@@ -860,10 +839,9 @@ I.checkOption('agree', '//form');
|
|
|
860
839
|
|
|
861
840
|
#### Parameters
|
|
862
841
|
|
|
863
|
-
- `field` **([string][
|
|
864
|
-
- `context` **([string][
|
|
865
|
-
|
|
866
|
-
Returns **[Promise][4]<any>**
|
|
842
|
+
- `field` **([string][4] \| [object][8])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
843
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
844
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
867
845
|
|
|
868
846
|
### click
|
|
869
847
|
|
|
@@ -891,10 +869,9 @@ I.click({css: 'nav a.login'});
|
|
|
891
869
|
|
|
892
870
|
#### Parameters
|
|
893
871
|
|
|
894
|
-
- `locator` **([string][
|
|
895
|
-
- `context` **([string][
|
|
896
|
-
|
|
897
|
-
Returns **[Promise][4]<any>**
|
|
872
|
+
- `locator` **([string][4] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
873
|
+
- `context` **([string][4]? | [object][8] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
874
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
898
875
|
|
|
899
876
|
### dontSeeCheckboxIsChecked
|
|
900
877
|
|
|
@@ -908,9 +885,8 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
908
885
|
|
|
909
886
|
#### Parameters
|
|
910
887
|
|
|
911
|
-
- `field` **([string][
|
|
912
|
-
|
|
913
|
-
Returns **[Promise][4]<any>**
|
|
888
|
+
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
889
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
914
890
|
|
|
915
891
|
### dontSeeElement
|
|
916
892
|
|
|
@@ -922,9 +898,8 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
922
898
|
|
|
923
899
|
#### Parameters
|
|
924
900
|
|
|
925
|
-
- `locator` **([string][
|
|
926
|
-
|
|
927
|
-
Returns **[Promise][4]<any>**
|
|
901
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|Strict locator.
|
|
902
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
928
903
|
|
|
929
904
|
### dontSeeInField
|
|
930
905
|
|
|
@@ -938,10 +913,9 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
938
913
|
|
|
939
914
|
#### Parameters
|
|
940
915
|
|
|
941
|
-
- `field` **([string][
|
|
942
|
-
- `value` **[string][
|
|
943
|
-
|
|
944
|
-
Returns **[Promise][4]<any>**
|
|
916
|
+
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
917
|
+
- `value` **[string][4]** value to check.
|
|
918
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
945
919
|
|
|
946
920
|
### dontSee
|
|
947
921
|
|
|
@@ -955,10 +929,9 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
955
929
|
|
|
956
930
|
#### Parameters
|
|
957
931
|
|
|
958
|
-
- `text` **[string][
|
|
959
|
-
- `context` **([string][
|
|
960
|
-
|
|
961
|
-
Returns **[Promise][4]<any>**
|
|
932
|
+
- `text` **[string][4]** which is not present.
|
|
933
|
+
- `context` **([string][4] \| [object][8])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
934
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
962
935
|
|
|
963
936
|
### fillField
|
|
964
937
|
|
|
@@ -978,10 +951,9 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
978
951
|
|
|
979
952
|
#### Parameters
|
|
980
953
|
|
|
981
|
-
- `field` **([string][
|
|
982
|
-
- `value` **([string][
|
|
983
|
-
|
|
984
|
-
Returns **[Promise][4]<any>**
|
|
954
|
+
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
955
|
+
- `value` **([string][4] \| [object][8])** text value to fill.
|
|
956
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
985
957
|
|
|
986
958
|
### grabTextFromAll
|
|
987
959
|
|
|
@@ -994,9 +966,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
994
966
|
|
|
995
967
|
#### Parameters
|
|
996
968
|
|
|
997
|
-
- `locator` **([string][
|
|
969
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
998
970
|
|
|
999
|
-
Returns **[Promise][
|
|
971
|
+
Returns **[Promise][5]<[Array][6]<[string][4]>>** attribute value
|
|
1000
972
|
|
|
1001
973
|
### grabTextFrom
|
|
1002
974
|
|
|
@@ -1011,9 +983,9 @@ If multiple elements found returns first element.
|
|
|
1011
983
|
|
|
1012
984
|
#### Parameters
|
|
1013
985
|
|
|
1014
|
-
- `locator` **([string][
|
|
986
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1015
987
|
|
|
1016
|
-
Returns **[Promise][
|
|
988
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
1017
989
|
|
|
1018
990
|
### grabNumberOfVisibleElements
|
|
1019
991
|
|
|
@@ -1026,9 +998,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1026
998
|
|
|
1027
999
|
#### Parameters
|
|
1028
1000
|
|
|
1029
|
-
- `locator` **([string][
|
|
1001
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1030
1002
|
|
|
1031
|
-
Returns **[Promise][
|
|
1003
|
+
Returns **[Promise][5]<[number][10]>** number of visible elements
|
|
1032
1004
|
|
|
1033
1005
|
### grabAttributeFrom
|
|
1034
1006
|
|
|
@@ -1044,10 +1016,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
1044
1016
|
|
|
1045
1017
|
#### Parameters
|
|
1046
1018
|
|
|
1047
|
-
- `locator` **([string][
|
|
1048
|
-
- `attr` **[string][
|
|
1019
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1020
|
+
- `attr` **[string][4]** attribute name.
|
|
1049
1021
|
|
|
1050
|
-
Returns **[Promise][
|
|
1022
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
1051
1023
|
|
|
1052
1024
|
### grabAttributeFromAll
|
|
1053
1025
|
|
|
@@ -1061,10 +1033,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1061
1033
|
|
|
1062
1034
|
#### Parameters
|
|
1063
1035
|
|
|
1064
|
-
- `locator` **([string][
|
|
1065
|
-
- `attr` **[string][
|
|
1036
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1037
|
+
- `attr` **[string][4]** attribute name.
|
|
1066
1038
|
|
|
1067
|
-
Returns **[Promise][
|
|
1039
|
+
Returns **[Promise][5]<[Array][6]<[string][4]>>** attribute value
|
|
1068
1040
|
|
|
1069
1041
|
### grabValueFromAll
|
|
1070
1042
|
|
|
@@ -1077,9 +1049,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1077
1049
|
|
|
1078
1050
|
#### Parameters
|
|
1079
1051
|
|
|
1080
|
-
- `locator` **([string][
|
|
1052
|
+
- `locator` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1081
1053
|
|
|
1082
|
-
Returns **[Promise][
|
|
1054
|
+
Returns **[Promise][5]<[Array][6]<[string][4]>>** attribute value
|
|
1083
1055
|
|
|
1084
1056
|
### grabValueFrom
|
|
1085
1057
|
|
|
@@ -1093,9 +1065,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1093
1065
|
|
|
1094
1066
|
#### Parameters
|
|
1095
1067
|
|
|
1096
|
-
- `locator` **([string][
|
|
1068
|
+
- `locator` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1097
1069
|
|
|
1098
|
-
Returns **[Promise][
|
|
1070
|
+
Returns **[Promise][5]<[string][4]>** attribute value
|
|
1099
1071
|
|
|
1100
1072
|
### saveScreenshot
|
|
1101
1073
|
|
|
@@ -1108,9 +1080,9 @@ I.saveScreenshot('debug.png');
|
|
|
1108
1080
|
|
|
1109
1081
|
#### Parameters
|
|
1110
1082
|
|
|
1111
|
-
- `fileName` **[string][
|
|
1083
|
+
- `fileName` **[string][4]** file name to save.
|
|
1112
1084
|
|
|
1113
|
-
Returns **[Promise][
|
|
1085
|
+
Returns **[Promise][5]<void>**
|
|
1114
1086
|
|
|
1115
1087
|
### scrollIntoView
|
|
1116
1088
|
|
|
@@ -1124,10 +1096,9 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1124
1096
|
|
|
1125
1097
|
#### Parameters
|
|
1126
1098
|
|
|
1127
|
-
- `locator` **([string][
|
|
1099
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1128
1100
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][15].
|
|
1129
|
-
|
|
1130
|
-
Returns **[Promise][4]<any>** Supported only for web testing
|
|
1101
|
+
[!] returns a _promise_ which is synchronized internally by recorderSupported only for web testing
|
|
1131
1102
|
|
|
1132
1103
|
### seeCheckboxIsChecked
|
|
1133
1104
|
|
|
@@ -1141,9 +1112,8 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1141
1112
|
|
|
1142
1113
|
#### Parameters
|
|
1143
1114
|
|
|
1144
|
-
- `field` **([string][
|
|
1145
|
-
|
|
1146
|
-
Returns **[Promise][4]<any>**
|
|
1115
|
+
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1116
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1147
1117
|
|
|
1148
1118
|
### seeElement
|
|
1149
1119
|
|
|
@@ -1156,9 +1126,8 @@ I.seeElement('#modal');
|
|
|
1156
1126
|
|
|
1157
1127
|
#### Parameters
|
|
1158
1128
|
|
|
1159
|
-
- `locator` **([string][
|
|
1160
|
-
|
|
1161
|
-
Returns **[Promise][4]<any>**
|
|
1129
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1130
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1162
1131
|
|
|
1163
1132
|
### seeInField
|
|
1164
1133
|
|
|
@@ -1174,10 +1143,9 @@ I.seeInField('#searchform input','Search');
|
|
|
1174
1143
|
|
|
1175
1144
|
#### Parameters
|
|
1176
1145
|
|
|
1177
|
-
- `field` **([string][
|
|
1178
|
-
- `value` **[string][
|
|
1179
|
-
|
|
1180
|
-
Returns **[Promise][4]<any>**
|
|
1146
|
+
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1147
|
+
- `value` **[string][4]** value to check.
|
|
1148
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1181
1149
|
|
|
1182
1150
|
### see
|
|
1183
1151
|
|
|
@@ -1192,10 +1160,9 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1192
1160
|
|
|
1193
1161
|
#### Parameters
|
|
1194
1162
|
|
|
1195
|
-
- `text` **[string][
|
|
1196
|
-
- `context` **([string][
|
|
1197
|
-
|
|
1198
|
-
Returns **[Promise][4]<any>**
|
|
1163
|
+
- `text` **[string][4]** expected on page.
|
|
1164
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1165
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1199
1166
|
|
|
1200
1167
|
### selectOption
|
|
1201
1168
|
|
|
@@ -1220,10 +1187,9 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1220
1187
|
|
|
1221
1188
|
#### Parameters
|
|
1222
1189
|
|
|
1223
|
-
- `select` **([string][
|
|
1224
|
-
- `option` **([string][
|
|
1225
|
-
|
|
1226
|
-
Returns **[Promise][4]<any>** Supported only for web testing
|
|
1190
|
+
- `select` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1191
|
+
- `option` **([string][4] \| [Array][6]<any>)** visible text or value of option.
|
|
1192
|
+
[!] returns a _promise_ which is synchronized internally by recorderSupported only for web testing
|
|
1227
1193
|
|
|
1228
1194
|
### waitForElement
|
|
1229
1195
|
|
|
@@ -1237,10 +1203,9 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1237
1203
|
|
|
1238
1204
|
#### Parameters
|
|
1239
1205
|
|
|
1240
|
-
- `locator` **([string][
|
|
1241
|
-
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
|
|
1242
|
-
|
|
1243
|
-
Returns **[Promise][4]<any>**
|
|
1206
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1207
|
+
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
|
|
1208
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1244
1209
|
|
|
1245
1210
|
### waitForVisible
|
|
1246
1211
|
|
|
@@ -1253,10 +1218,9 @@ I.waitForVisible('#popup');
|
|
|
1253
1218
|
|
|
1254
1219
|
#### Parameters
|
|
1255
1220
|
|
|
1256
|
-
- `locator` **([string][
|
|
1257
|
-
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1258
|
-
|
|
1259
|
-
Returns **[Promise][4]<any>**
|
|
1221
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1222
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1223
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
|
|
1260
1224
|
|
|
1261
1225
|
### waitForInvisible
|
|
1262
1226
|
|
|
@@ -1269,10 +1233,9 @@ I.waitForInvisible('#popup');
|
|
|
1269
1233
|
|
|
1270
1234
|
#### Parameters
|
|
1271
1235
|
|
|
1272
|
-
- `locator` **([string][
|
|
1273
|
-
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1274
|
-
|
|
1275
|
-
Returns **[Promise][4]<any>**
|
|
1236
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1237
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1238
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
|
|
1276
1239
|
|
|
1277
1240
|
### waitForText
|
|
1278
1241
|
|
|
@@ -1287,11 +1250,10 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1287
1250
|
|
|
1288
1251
|
#### Parameters
|
|
1289
1252
|
|
|
1290
|
-
- `text` **[string][
|
|
1253
|
+
- `text` **[string][4]** to wait for.
|
|
1291
1254
|
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
|
|
1292
|
-
- `context` **([string][
|
|
1293
|
-
|
|
1294
|
-
Returns **[Promise][4]<any>**
|
|
1255
|
+
- `context` **([string][4] \| [object][8])?** (optional) element located by CSS|XPath|strict locator.
|
|
1256
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1295
1257
|
|
|
1296
1258
|
### useWebDriverTo
|
|
1297
1259
|
|
|
@@ -1311,7 +1273,7 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
1311
1273
|
|
|
1312
1274
|
#### Parameters
|
|
1313
1275
|
|
|
1314
|
-
- `description` **[string][
|
|
1276
|
+
- `description` **[string][4]** used to show in logs.
|
|
1315
1277
|
- `fn` **[function][17]** async functuion that executed with WebDriver helper as argument
|
|
1316
1278
|
|
|
1317
1279
|
### \_isShadowLocator
|
|
@@ -1349,7 +1311,7 @@ this.helpers['WebDriver']._locate({name: 'password'}).then //...
|
|
|
1349
1311
|
|
|
1350
1312
|
#### Parameters
|
|
1351
1313
|
|
|
1352
|
-
- `locator` **([string][
|
|
1314
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1353
1315
|
- `smartWait` (optional, default `false`)
|
|
1354
1316
|
|
|
1355
1317
|
### \_locateCheckable
|
|
@@ -1362,7 +1324,7 @@ this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').
|
|
|
1362
1324
|
|
|
1363
1325
|
#### Parameters
|
|
1364
1326
|
|
|
1365
|
-
- `locator` **([string][
|
|
1327
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1366
1328
|
|
|
1367
1329
|
### \_locateClickable
|
|
1368
1330
|
|
|
@@ -1375,7 +1337,7 @@ const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages')
|
|
|
1375
1337
|
|
|
1376
1338
|
#### Parameters
|
|
1377
1339
|
|
|
1378
|
-
- `locator` **([string][
|
|
1340
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1379
1341
|
- `context`
|
|
1380
1342
|
|
|
1381
1343
|
### \_locateFields
|
|
@@ -1388,7 +1350,7 @@ this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
|
1388
1350
|
|
|
1389
1351
|
#### Parameters
|
|
1390
1352
|
|
|
1391
|
-
- `locator` **([string][
|
|
1353
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1392
1354
|
|
|
1393
1355
|
### defineTimeout
|
|
1394
1356
|
|
|
@@ -1418,9 +1380,9 @@ I.amOnPage('/login'); // opens a login page
|
|
|
1418
1380
|
|
|
1419
1381
|
#### Parameters
|
|
1420
1382
|
|
|
1421
|
-
- `url` **[string][
|
|
1383
|
+
- `url` **[string][4]** url path or global url.
|
|
1422
1384
|
|
|
1423
|
-
Returns **
|
|
1385
|
+
Returns **void** automatically synchronized promise with recorder #!
|
|
1424
1386
|
|
|
1425
1387
|
### forceClick
|
|
1426
1388
|
|
|
@@ -1451,10 +1413,9 @@ I.forceClick({css: 'nav a.login'});
|
|
|
1451
1413
|
|
|
1452
1414
|
#### Parameters
|
|
1453
1415
|
|
|
1454
|
-
- `locator` **([string][
|
|
1455
|
-
- `context` **([string][
|
|
1456
|
-
|
|
1457
|
-
Returns **[Promise][4]<any>** {{ react }}
|
|
1416
|
+
- `locator` **([string][4] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1417
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1418
|
+
[!] returns a _promise_ which is synchronized internally by recorder{{ react }} (optional, default `null`)
|
|
1458
1419
|
|
|
1459
1420
|
### doubleClick
|
|
1460
1421
|
|
|
@@ -1470,10 +1431,9 @@ I.doubleClick('.btn.edit');
|
|
|
1470
1431
|
|
|
1471
1432
|
#### Parameters
|
|
1472
1433
|
|
|
1473
|
-
- `locator` **([string][
|
|
1474
|
-
- `context` **([string][
|
|
1475
|
-
|
|
1476
|
-
Returns **[Promise][4]<any>** {{ react }}
|
|
1434
|
+
- `locator` **([string][4] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1435
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1436
|
+
[!] returns a _promise_ which is synchronized internally by recorder{{ react }} (optional, default `null`)
|
|
1477
1437
|
|
|
1478
1438
|
### rightClick
|
|
1479
1439
|
|
|
@@ -1490,10 +1450,9 @@ I.rightClick('Click me', '.context');
|
|
|
1490
1450
|
|
|
1491
1451
|
#### Parameters
|
|
1492
1452
|
|
|
1493
|
-
- `locator` **([string][
|
|
1494
|
-
- `context` **([string][
|
|
1495
|
-
|
|
1496
|
-
Returns **[Promise][4]<any>** {{ react }}
|
|
1453
|
+
- `locator` **([string][4] \| [object][8])** clickable element located by CSS|XPath|strict locator.
|
|
1454
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1455
|
+
[!] returns a _promise_ which is synchronized internally by recorder{{ react }} (optional, default `null`)
|
|
1497
1456
|
|
|
1498
1457
|
### forceRightClick
|
|
1499
1458
|
|
|
@@ -1514,10 +1473,9 @@ I.forceRightClick('Menu');
|
|
|
1514
1473
|
|
|
1515
1474
|
#### Parameters
|
|
1516
1475
|
|
|
1517
|
-
- `locator` **([string][
|
|
1518
|
-
- `context` **([string][
|
|
1519
|
-
|
|
1520
|
-
Returns **[Promise][4]<any>** {{ react }}
|
|
1476
|
+
- `locator` **([string][4] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1477
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1478
|
+
[!] returns a _promise_ which is synchronized internally by recorder{{ react }} (optional, default `null`)
|
|
1521
1479
|
|
|
1522
1480
|
### clearField
|
|
1523
1481
|
|
|
@@ -1532,9 +1490,8 @@ I.clearField('#email');
|
|
|
1532
1490
|
#### Parameters
|
|
1533
1491
|
|
|
1534
1492
|
- `field`
|
|
1535
|
-
- `editable` **([string][
|
|
1536
|
-
|
|
1537
|
-
Returns **[Promise][4]<any>**
|
|
1493
|
+
- `editable` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1494
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1538
1495
|
|
|
1539
1496
|
### attachFile
|
|
1540
1497
|
|
|
@@ -1549,10 +1506,10 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
1549
1506
|
|
|
1550
1507
|
#### Parameters
|
|
1551
1508
|
|
|
1552
|
-
- `locator` **([string][
|
|
1553
|
-
- `pathToFile` **[string][
|
|
1554
|
-
|
|
1555
|
-
|
|
1509
|
+
- `locator` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1510
|
+
- `pathToFile` **[string][4]** local file path relative to codecept.json config file.
|
|
1511
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1512
|
+
Appium: not tested
|
|
1556
1513
|
|
|
1557
1514
|
### uncheckOption
|
|
1558
1515
|
|
|
@@ -1569,10 +1526,10 @@ I.uncheckOption('agree', '//form');
|
|
|
1569
1526
|
|
|
1570
1527
|
#### Parameters
|
|
1571
1528
|
|
|
1572
|
-
- `field` **([string][
|
|
1573
|
-
- `context` **([string][
|
|
1574
|
-
|
|
1575
|
-
|
|
1529
|
+
- `field` **([string][4] \| [object][8])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1530
|
+
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1531
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1532
|
+
Appium: not tested (optional, default `null`)
|
|
1576
1533
|
|
|
1577
1534
|
### grabHTMLFromAll
|
|
1578
1535
|
|
|
@@ -1586,9 +1543,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1586
1543
|
#### Parameters
|
|
1587
1544
|
|
|
1588
1545
|
- `locator`
|
|
1589
|
-
- `element` **([string][
|
|
1546
|
+
- `element` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1590
1547
|
|
|
1591
|
-
Returns **[Promise][
|
|
1548
|
+
Returns **[Promise][5]<[Array][6]<[string][4]>>** HTML code for an element
|
|
1592
1549
|
|
|
1593
1550
|
### grabHTMLFrom
|
|
1594
1551
|
|
|
@@ -1603,9 +1560,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1603
1560
|
#### Parameters
|
|
1604
1561
|
|
|
1605
1562
|
- `locator`
|
|
1606
|
-
- `element` **([string][
|
|
1563
|
+
- `element` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1607
1564
|
|
|
1608
|
-
Returns **[Promise][
|
|
1565
|
+
Returns **[Promise][5]<[string][4]>** HTML code for an element
|
|
1609
1566
|
|
|
1610
1567
|
### seeTextEquals
|
|
1611
1568
|
|
|
@@ -1617,10 +1574,9 @@ I.seeTextEquals('text', 'h1');
|
|
|
1617
1574
|
|
|
1618
1575
|
#### Parameters
|
|
1619
1576
|
|
|
1620
|
-
- `text` **[string][
|
|
1621
|
-
- `context` **([string][
|
|
1622
|
-
|
|
1623
|
-
Returns **[Promise][4]<any>**
|
|
1577
|
+
- `text` **[string][4]** element value to check.
|
|
1578
|
+
- `context` **([string][4] \| [object][8])?** element located by CSS|XPath|strict locator.
|
|
1579
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1624
1580
|
|
|
1625
1581
|
### seeElementInDOM
|
|
1626
1582
|
|
|
@@ -1633,9 +1589,8 @@ I.seeElementInDOM('#modal');
|
|
|
1633
1589
|
|
|
1634
1590
|
#### Parameters
|
|
1635
1591
|
|
|
1636
|
-
- `locator` **([string][
|
|
1637
|
-
|
|
1638
|
-
Returns **[Promise][4]<any>**
|
|
1592
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1593
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1639
1594
|
|
|
1640
1595
|
### dontSeeElementInDOM
|
|
1641
1596
|
|
|
@@ -1647,9 +1602,8 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
1647
1602
|
|
|
1648
1603
|
#### Parameters
|
|
1649
1604
|
|
|
1650
|
-
- `locator` **([string][
|
|
1651
|
-
|
|
1652
|
-
Returns **[Promise][4]<any>**
|
|
1605
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|Strict locator.
|
|
1606
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1653
1607
|
|
|
1654
1608
|
### seeInSource
|
|
1655
1609
|
|
|
@@ -1661,9 +1615,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1661
1615
|
|
|
1662
1616
|
#### Parameters
|
|
1663
1617
|
|
|
1664
|
-
- `text` **[string][
|
|
1665
|
-
|
|
1666
|
-
Returns **[Promise][4]<any>**
|
|
1618
|
+
- `text` **[string][4]** value to check.
|
|
1619
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1667
1620
|
|
|
1668
1621
|
### grabSource
|
|
1669
1622
|
|
|
@@ -1674,7 +1627,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1674
1627
|
let pageSource = await I.grabSource();
|
|
1675
1628
|
```
|
|
1676
1629
|
|
|
1677
|
-
Returns **[Promise][
|
|
1630
|
+
Returns **[Promise][5]<[string][4]>** source code
|
|
1678
1631
|
|
|
1679
1632
|
### grabBrowserLogs
|
|
1680
1633
|
|
|
@@ -1686,7 +1639,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
1686
1639
|
console.log(JSON.stringify(logs))
|
|
1687
1640
|
```
|
|
1688
1641
|
|
|
1689
|
-
Returns **([Promise][
|
|
1642
|
+
Returns **([Promise][5]<[Array][6]<[object][8]>> | [undefined][19])** all browser logs
|
|
1690
1643
|
|
|
1691
1644
|
### dontSeeInSource
|
|
1692
1645
|
|
|
@@ -1699,9 +1652,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
1699
1652
|
#### Parameters
|
|
1700
1653
|
|
|
1701
1654
|
- `text`
|
|
1702
|
-
- `value` **[string][
|
|
1703
|
-
|
|
1704
|
-
Returns **[Promise][4]<any>**
|
|
1655
|
+
- `value` **[string][4]** to check.
|
|
1656
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1705
1657
|
|
|
1706
1658
|
### seeNumberOfElements
|
|
1707
1659
|
|
|
@@ -1714,10 +1666,10 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1714
1666
|
|
|
1715
1667
|
#### Parameters
|
|
1716
1668
|
|
|
1717
|
-
- `locator` **([string][
|
|
1669
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1718
1670
|
- `num` **[number][10]** number of elements.
|
|
1719
|
-
|
|
1720
|
-
|
|
1671
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1672
|
+
{{ react }}
|
|
1721
1673
|
|
|
1722
1674
|
### seeNumberOfVisibleElements
|
|
1723
1675
|
|
|
@@ -1730,10 +1682,10 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1730
1682
|
|
|
1731
1683
|
#### Parameters
|
|
1732
1684
|
|
|
1733
|
-
- `locator` **([string][
|
|
1685
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1734
1686
|
- `num` **[number][10]** number of elements.
|
|
1735
|
-
|
|
1736
|
-
|
|
1687
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1688
|
+
{{ react }}
|
|
1737
1689
|
|
|
1738
1690
|
### seeAttributesOnElements
|
|
1739
1691
|
|
|
@@ -1745,10 +1697,9 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1745
1697
|
|
|
1746
1698
|
#### Parameters
|
|
1747
1699
|
|
|
1748
|
-
- `locator` **([string][
|
|
1700
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1749
1701
|
- `attributes` **[object][8]** attributes and their values to check.
|
|
1750
|
-
|
|
1751
|
-
Returns **[Promise][4]<any>**
|
|
1702
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1752
1703
|
|
|
1753
1704
|
### scrollTo
|
|
1754
1705
|
|
|
@@ -1762,11 +1713,10 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1762
1713
|
|
|
1763
1714
|
#### Parameters
|
|
1764
1715
|
|
|
1765
|
-
- `locator` **([string][
|
|
1716
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1766
1717
|
- `offsetX` **[number][10]** (optional, `0` by default) X-axis offset. (optional, default `0`)
|
|
1767
|
-
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset.
|
|
1768
|
-
|
|
1769
|
-
Returns **[Promise][4]<any>**
|
|
1718
|
+
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset.
|
|
1719
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `0`)
|
|
1770
1720
|
|
|
1771
1721
|
### moveCursorTo
|
|
1772
1722
|
|
|
@@ -1780,13 +1730,12 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1780
1730
|
|
|
1781
1731
|
#### Parameters
|
|
1782
1732
|
|
|
1783
|
-
- `locator` **([string][
|
|
1733
|
+
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1784
1734
|
- `xOffset`
|
|
1785
1735
|
- `yOffset`
|
|
1786
1736
|
- `offsetX` **[number][10]** (optional, `0` by default) X-axis offset. (optional, default `0`)
|
|
1787
|
-
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset.
|
|
1788
|
-
|
|
1789
|
-
Returns **[Promise][4]<any>**
|
|
1737
|
+
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset.
|
|
1738
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `0`)
|
|
1790
1739
|
|
|
1791
1740
|
### saveElementScreenshot
|
|
1792
1741
|
|
|
@@ -1799,10 +1748,9 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1799
1748
|
|
|
1800
1749
|
#### Parameters
|
|
1801
1750
|
|
|
1802
|
-
- `locator` **([string][
|
|
1803
|
-
- `fileName` **[string][
|
|
1804
|
-
|
|
1805
|
-
Returns **[Promise][4]<any>**
|
|
1751
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1752
|
+
- `fileName` **[string][4]** file name to save.
|
|
1753
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1806
1754
|
|
|
1807
1755
|
### type
|
|
1808
1756
|
|
|
@@ -1824,10 +1772,9 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1824
1772
|
#### Parameters
|
|
1825
1773
|
|
|
1826
1774
|
- `keys`
|
|
1827
|
-
- `delay` **[number][10]?** (optional) delay in ms between key presses
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
Returns **[Promise][4]<any>**
|
|
1775
|
+
- `delay` **[number][10]?** (optional) delay in ms between key presses
|
|
1776
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1777
|
+
- `key` **([string][4] \| [Array][6]<[string][4]>)** or array of keys to type.
|
|
1831
1778
|
|
|
1832
1779
|
### dragAndDrop
|
|
1833
1780
|
|
|
@@ -1839,10 +1786,10 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
1839
1786
|
|
|
1840
1787
|
#### Parameters
|
|
1841
1788
|
|
|
1842
|
-
- `srcElement` **([string][
|
|
1843
|
-
- `destElement` **([string][
|
|
1844
|
-
|
|
1845
|
-
|
|
1789
|
+
- `srcElement` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1790
|
+
- `destElement` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1791
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1792
|
+
Appium: not tested
|
|
1846
1793
|
|
|
1847
1794
|
### dragSlider
|
|
1848
1795
|
|
|
@@ -1856,10 +1803,9 @@ I.dragSlider('#slider', -70);
|
|
|
1856
1803
|
|
|
1857
1804
|
#### Parameters
|
|
1858
1805
|
|
|
1859
|
-
- `locator` **([string][
|
|
1860
|
-
- `offsetX` **[number][10]** position to drag.
|
|
1861
|
-
|
|
1862
|
-
Returns **[Promise][4]<any>**
|
|
1806
|
+
- `locator` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1807
|
+
- `offsetX` **[number][10]** position to drag.
|
|
1808
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `0`)
|
|
1863
1809
|
|
|
1864
1810
|
### grabAllWindowHandles
|
|
1865
1811
|
|
|
@@ -1870,7 +1816,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
1870
1816
|
const windows = await I.grabAllWindowHandles();
|
|
1871
1817
|
```
|
|
1872
1818
|
|
|
1873
|
-
Returns **[Promise][
|
|
1819
|
+
Returns **[Promise][5]<[Array][6]<[string][4]>>**
|
|
1874
1820
|
|
|
1875
1821
|
### grabCurrentWindowHandle
|
|
1876
1822
|
|
|
@@ -1881,7 +1827,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1881
1827
|
const window = await I.grabCurrentWindowHandle();
|
|
1882
1828
|
```
|
|
1883
1829
|
|
|
1884
|
-
Returns **[Promise][
|
|
1830
|
+
Returns **[Promise][5]<[string][4]>**
|
|
1885
1831
|
|
|
1886
1832
|
### switchToWindow
|
|
1887
1833
|
|
|
@@ -1899,7 +1845,7 @@ await I.switchToWindow( window );
|
|
|
1899
1845
|
|
|
1900
1846
|
#### Parameters
|
|
1901
1847
|
|
|
1902
|
-
- `window` **[string][
|
|
1848
|
+
- `window` **[string][4]** name of window handle.
|
|
1903
1849
|
|
|
1904
1850
|
### closeOtherTabs
|
|
1905
1851
|
|
|
@@ -1909,7 +1855,7 @@ Close all tabs except for the current one.
|
|
|
1909
1855
|
I.closeOtherTabs();
|
|
1910
1856
|
```
|
|
1911
1857
|
|
|
1912
|
-
|
|
1858
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1913
1859
|
|
|
1914
1860
|
### switchTo
|
|
1915
1861
|
|
|
@@ -1922,9 +1868,8 @@ I.switchTo(); // switch back to main page
|
|
|
1922
1868
|
|
|
1923
1869
|
#### Parameters
|
|
1924
1870
|
|
|
1925
|
-
- `locator` **([string][
|
|
1926
|
-
|
|
1927
|
-
Returns **[Promise][4]<any>**
|
|
1871
|
+
- `locator` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1872
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1928
1873
|
|
|
1929
1874
|
### grabNumberOfOpenTabs
|
|
1930
1875
|
|
|
@@ -1935,7 +1880,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1935
1880
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1936
1881
|
```
|
|
1937
1882
|
|
|
1938
|
-
Returns **[Promise][
|
|
1883
|
+
Returns **[Promise][5]<[number][10]>** number of open tabs
|
|
1939
1884
|
|
|
1940
1885
|
### scrollPageToTop
|
|
1941
1886
|
|
|
@@ -1945,7 +1890,7 @@ Scroll page to the top.
|
|
|
1945
1890
|
I.scrollPageToTop();
|
|
1946
1891
|
```
|
|
1947
1892
|
|
|
1948
|
-
|
|
1893
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1949
1894
|
|
|
1950
1895
|
### scrollPageToBottom
|
|
1951
1896
|
|
|
@@ -1955,7 +1900,7 @@ Scroll page to the bottom.
|
|
|
1955
1900
|
I.scrollPageToBottom();
|
|
1956
1901
|
```
|
|
1957
1902
|
|
|
1958
|
-
|
|
1903
|
+
[!] returns a _promise_ which is synchronized internally by recorder
|
|
1959
1904
|
|
|
1960
1905
|
### grabPageScrollPosition
|
|
1961
1906
|
|
|
@@ -1966,7 +1911,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1966
1911
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1967
1912
|
```
|
|
1968
1913
|
|
|
1969
|
-
Returns **[Promise][
|
|
1914
|
+
Returns **[Promise][5]<PageScrollPosition>** scroll position
|
|
1970
1915
|
|
|
1971
1916
|
### setGeoLocation
|
|
1972
1917
|
|
|
@@ -1981,9 +1926,8 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1981
1926
|
|
|
1982
1927
|
- `latitude` **[number][10]** to set.
|
|
1983
1928
|
- `longitude` **[number][10]** to set
|
|
1984
|
-
- `altitude` **[number][10]?** (optional, null by default) to set
|
|
1985
|
-
|
|
1986
|
-
Returns **[Promise][4]<any>**
|
|
1929
|
+
- `altitude` **[number][10]?** (optional, null by default) to set
|
|
1930
|
+
[!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1987
1931
|
|
|
1988
1932
|
### grabGeoLocation
|
|
1989
1933
|
|
|
@@ -1994,7 +1938,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1994
1938
|
let geoLocation = await I.grabGeoLocation();
|
|
1995
1939
|
```
|
|
1996
1940
|
|
|
1997
|
-
Returns **[Promise][
|
|
1941
|
+
Returns **[Promise][5]<{latitude: [number][10], longitude: [number][10], altitude: [number][10]}>**
|
|
1998
1942
|
|
|
1999
1943
|
### grabElementBoundingRect
|
|
2000
1944
|
|
|
@@ -2018,11 +1962,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
2018
1962
|
|
|
2019
1963
|
#### Parameters
|
|
2020
1964
|
|
|
2021
|
-
- `locator` **([string][
|
|
1965
|
+
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
2022
1966
|
- `prop`
|
|
2023
|
-
- `elementSize` **[string][
|
|
1967
|
+
- `elementSize` **[string][4]?** x, y, width or height of the given element.
|
|
2024
1968
|
|
|
2025
|
-
Returns **([Promise][
|
|
1969
|
+
Returns **([Promise][5]<DOMRect> | [Promise][5]<[number][10]>)** Element bounding rectangle
|
|
2026
1970
|
|
|
2027
1971
|
[1]: http://codecept.io/helpers/WebDriver/
|
|
2028
1972
|
|
|
@@ -2030,9 +1974,9 @@ Returns **([Promise][4]<DOMRect> | [Promise][4]<[number][10]>)** Element b
|
|
|
2030
1974
|
|
|
2031
1975
|
[3]: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
|
|
2032
1976
|
|
|
2033
|
-
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1977
|
+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2034
1978
|
|
|
2035
|
-
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1979
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
2036
1980
|
|
|
2037
1981
|
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
2038
1982
|
|