codeceptjs 3.2.2 → 3.2.3
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 +7 -0
- package/docs/advanced.md +5 -1
- package/docs/build/Appium.js +62 -0
- package/docs/build/FileSystem.js +11 -1
- package/docs/build/Playwright.js +12 -7
- package/docs/changelog.md +7 -0
- package/docs/configuration.md +8 -8
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +9 -9
- package/docs/helpers/Appium.md +239 -197
- package/docs/helpers/FileSystem.md +11 -1
- package/docs/helpers/Playwright.md +210 -207
- package/docs/installation.md +1 -1
- package/docs/mobile.md +11 -11
- package/docs/nightmare.md +3 -3
- package/docs/playwright.md +4 -4
- package/docs/plugins.md +11 -7
- package/docs/puppeteer.md +5 -5
- package/docs/reports.md +1 -1
- package/docs/testcafe.md +1 -1
- package/docs/translation.md +1 -1
- package/docs/visual.md +2 -2
- package/docs/vue.md +1 -1
- package/docs/webdriver.md +2 -2
- package/lib/cli.js +25 -20
- package/lib/command/workers/runTests.js +25 -7
- package/lib/helper/Appium.js +62 -0
- package/lib/helper/FileSystem.js +11 -1
- package/lib/helper/Playwright.js +12 -7
- package/lib/plugin/autoLogin.js +1 -1
- package/lib/plugin/tryTo.js +6 -0
- package/package.json +1 -1
- package/typings/index.d.ts +2 -0
- package/typings/types.d.ts +83 -100
package/docs/helpers/Appium.md
CHANGED
|
@@ -150,6 +150,8 @@ I.runOnAndroid((caps) => {
|
|
|
150
150
|
- `caps` **any**
|
|
151
151
|
- `fn` **any**
|
|
152
152
|
|
|
153
|
+
Returns **[Promise][4]<any>**
|
|
154
|
+
|
|
153
155
|
### runOnAndroid
|
|
154
156
|
|
|
155
157
|
Execute code only on Android
|
|
@@ -186,6 +188,8 @@ I.runOnAndroid((caps) => {
|
|
|
186
188
|
- `caps` **any**
|
|
187
189
|
- `fn` **any**
|
|
188
190
|
|
|
191
|
+
Returns **[Promise][4]<any>**
|
|
192
|
+
|
|
189
193
|
### runInWeb
|
|
190
194
|
|
|
191
195
|
Execute code only in Web mode.
|
|
@@ -201,6 +205,8 @@ I.runInWeb(() => {
|
|
|
201
205
|
|
|
202
206
|
- `fn` **any**
|
|
203
207
|
|
|
208
|
+
Returns **[Promise][4]<any>**
|
|
209
|
+
|
|
204
210
|
### seeAppIsInstalled
|
|
205
211
|
|
|
206
212
|
Check if an app is installed.
|
|
@@ -211,7 +217,9 @@ I.seeAppIsInstalled("com.example.android.apis");
|
|
|
211
217
|
|
|
212
218
|
#### Parameters
|
|
213
219
|
|
|
214
|
-
- `bundleId` **[string][
|
|
220
|
+
- `bundleId` **[string][5]** String ID of bundled app
|
|
221
|
+
|
|
222
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
215
223
|
|
|
216
224
|
### seeAppIsNotInstalled
|
|
217
225
|
|
|
@@ -223,7 +231,9 @@ I.seeAppIsNotInstalled("com.example.android.apis");
|
|
|
223
231
|
|
|
224
232
|
#### Parameters
|
|
225
233
|
|
|
226
|
-
- `bundleId` **[string][
|
|
234
|
+
- `bundleId` **[string][5]** String ID of bundled app
|
|
235
|
+
|
|
236
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
227
237
|
|
|
228
238
|
### installApp
|
|
229
239
|
|
|
@@ -235,7 +245,9 @@ I.installApp('/path/to/file.apk');
|
|
|
235
245
|
|
|
236
246
|
#### Parameters
|
|
237
247
|
|
|
238
|
-
- `path` **[string][
|
|
248
|
+
- `path` **[string][5]** path to apk file
|
|
249
|
+
|
|
250
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
239
251
|
|
|
240
252
|
### removeApp
|
|
241
253
|
|
|
@@ -249,8 +261,8 @@ Appium: support only Android
|
|
|
249
261
|
|
|
250
262
|
#### Parameters
|
|
251
263
|
|
|
252
|
-
- `appId` **[string][
|
|
253
|
-
- `bundleId` **[string][
|
|
264
|
+
- `appId` **[string][5]**
|
|
265
|
+
- `bundleId` **[string][5]?** ID of bundle
|
|
254
266
|
|
|
255
267
|
### seeCurrentActivityIs
|
|
256
268
|
|
|
@@ -262,7 +274,9 @@ I.seeCurrentActivityIs(".HomeScreenActivity")
|
|
|
262
274
|
|
|
263
275
|
#### Parameters
|
|
264
276
|
|
|
265
|
-
- `currentActivity` **[string][
|
|
277
|
+
- `currentActivity` **[string][5]**
|
|
278
|
+
|
|
279
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
266
280
|
|
|
267
281
|
### seeDeviceIsLocked
|
|
268
282
|
|
|
@@ -272,7 +286,7 @@ Check whether the device is locked.
|
|
|
272
286
|
I.seeDeviceIsLocked();
|
|
273
287
|
```
|
|
274
288
|
|
|
275
|
-
Appium: support only Android
|
|
289
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
276
290
|
|
|
277
291
|
### seeDeviceIsUnlocked
|
|
278
292
|
|
|
@@ -282,7 +296,7 @@ Check whether the device is not locked.
|
|
|
282
296
|
I.seeDeviceIsUnlocked();
|
|
283
297
|
```
|
|
284
298
|
|
|
285
|
-
Appium: support only Android
|
|
299
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
286
300
|
|
|
287
301
|
### seeOrientationIs
|
|
288
302
|
|
|
@@ -297,6 +311,8 @@ I.seeOrientationIs('LANDSCAPE')
|
|
|
297
311
|
|
|
298
312
|
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS
|
|
299
313
|
|
|
314
|
+
Returns **[Promise][4]<void>**
|
|
315
|
+
|
|
300
316
|
### setOrientation
|
|
301
317
|
|
|
302
318
|
Set a device orientation. Will fail, if app will not set orientation
|
|
@@ -308,7 +324,9 @@ I.setOrientation('LANDSCAPE')
|
|
|
308
324
|
|
|
309
325
|
#### Parameters
|
|
310
326
|
|
|
311
|
-
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or
|
|
327
|
+
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAIT
|
|
328
|
+
|
|
329
|
+
Returns **[Promise][4]<any>** Appium: support Android and iOS
|
|
312
330
|
|
|
313
331
|
### grabAllContexts
|
|
314
332
|
|
|
@@ -316,7 +334,7 @@ Get list of all available contexts
|
|
|
316
334
|
|
|
317
335
|
let contexts = await I.grabAllContexts();
|
|
318
336
|
|
|
319
|
-
Appium: support Android and iOS
|
|
337
|
+
Returns **[Promise][4]<[Array][6]<[string][5]>>** Appium: support Android and iOS
|
|
320
338
|
|
|
321
339
|
### grabContext
|
|
322
340
|
|
|
@@ -326,7 +344,7 @@ Retrieve current context
|
|
|
326
344
|
let context = await I.grabContext();
|
|
327
345
|
```
|
|
328
346
|
|
|
329
|
-
Appium: support Android and iOS
|
|
347
|
+
Returns **[Promise][4]<([string][5] | null)>** Appium: support Android and iOS
|
|
330
348
|
|
|
331
349
|
### grabCurrentActivity
|
|
332
350
|
|
|
@@ -336,7 +354,7 @@ Get current device activity.
|
|
|
336
354
|
let activity = await I.grabCurrentActivity();
|
|
337
355
|
```
|
|
338
356
|
|
|
339
|
-
Appium: support only Android
|
|
357
|
+
Returns **[Promise][4]<[string][5]>** Appium: support only Android
|
|
340
358
|
|
|
341
359
|
### grabNetworkConnection
|
|
342
360
|
|
|
@@ -348,7 +366,7 @@ properties to the response object to allow easier assertions.
|
|
|
348
366
|
let con = await I.grabNetworkConnection();
|
|
349
367
|
```
|
|
350
368
|
|
|
351
|
-
Appium: support only Android
|
|
369
|
+
Returns **[Promise][4]<{}>** Appium: support only Android
|
|
352
370
|
|
|
353
371
|
### grabOrientation
|
|
354
372
|
|
|
@@ -358,7 +376,7 @@ Get current orientation.
|
|
|
358
376
|
let orientation = await I.grabOrientation();
|
|
359
377
|
```
|
|
360
378
|
|
|
361
|
-
Appium: support Android and iOS
|
|
379
|
+
Returns **[Promise][4]<[string][5]>** Appium: support Android and iOS
|
|
362
380
|
|
|
363
381
|
### grabSettings
|
|
364
382
|
|
|
@@ -368,7 +386,7 @@ Get all the currently specified settings.
|
|
|
368
386
|
let settings = await I.grabSettings();
|
|
369
387
|
```
|
|
370
388
|
|
|
371
|
-
Appium: support Android and iOS
|
|
389
|
+
Returns **[Promise][4]<[string][5]>** Appium: support Android and iOS
|
|
372
390
|
|
|
373
391
|
### \_switchToContext
|
|
374
392
|
|
|
@@ -393,7 +411,9 @@ I.switchToWeb('WEBVIEW_io.selendroid.testapp');
|
|
|
393
411
|
|
|
394
412
|
#### Parameters
|
|
395
413
|
|
|
396
|
-
- `context` **[string][
|
|
414
|
+
- `context` **[string][5]?**
|
|
415
|
+
|
|
416
|
+
Returns **[Promise][4]<void>**
|
|
397
417
|
|
|
398
418
|
### switchToNative
|
|
399
419
|
|
|
@@ -411,6 +431,8 @@ I.switchToNative('SOME_OTHER_CONTEXT');
|
|
|
411
431
|
|
|
412
432
|
- `context` **any** (optional, default `null`)
|
|
413
433
|
|
|
434
|
+
Returns **[Promise][4]<void>**
|
|
435
|
+
|
|
414
436
|
### startActivity
|
|
415
437
|
|
|
416
438
|
Start an arbitrary Android activity during a session.
|
|
@@ -419,13 +441,13 @@ Start an arbitrary Android activity during a session.
|
|
|
419
441
|
I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
|
|
420
442
|
```
|
|
421
443
|
|
|
422
|
-
Appium: support only Android
|
|
423
|
-
|
|
424
444
|
#### Parameters
|
|
425
445
|
|
|
426
446
|
- `appPackage`
|
|
427
447
|
- `appActivity`
|
|
428
448
|
|
|
449
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
450
|
+
|
|
429
451
|
### setNetworkConnection
|
|
430
452
|
|
|
431
453
|
Set network connection mode.
|
|
@@ -442,14 +464,14 @@ I.setNetworkConnection(4) // airplane mode off, wifi off, data on
|
|
|
442
464
|
I.setNetworkConnection(6) // airplane mode off, wifi on, data on
|
|
443
465
|
```
|
|
444
466
|
|
|
445
|
-
See corresponding [webdriverio reference][
|
|
446
|
-
|
|
447
|
-
Appium: support only Android
|
|
467
|
+
See corresponding [webdriverio reference][7].
|
|
448
468
|
|
|
449
469
|
#### Parameters
|
|
450
470
|
|
|
451
471
|
- `value`
|
|
452
472
|
|
|
473
|
+
Returns **[Promise][4]<{}>** Appium: support only Android
|
|
474
|
+
|
|
453
475
|
### setSettings
|
|
454
476
|
|
|
455
477
|
Update the current setting on the device
|
|
@@ -460,7 +482,9 @@ I.setSettings({cyberdelia: 'open'});
|
|
|
460
482
|
|
|
461
483
|
#### Parameters
|
|
462
484
|
|
|
463
|
-
- `settings` **[object][
|
|
485
|
+
- `settings` **[object][8]** object
|
|
486
|
+
|
|
487
|
+
Returns **[Promise][4]<any>** Appium: support Android and iOS
|
|
464
488
|
|
|
465
489
|
### hideDeviceKeyboard
|
|
466
490
|
|
|
@@ -480,12 +504,12 @@ Appium: support Android and iOS
|
|
|
480
504
|
#### Parameters
|
|
481
505
|
|
|
482
506
|
- `strategy` **(`"tapOutside"` \| `"pressKey"`)?** Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
|
|
483
|
-
- `key` **[string][
|
|
507
|
+
- `key` **[string][5]?** Optional key
|
|
484
508
|
|
|
485
509
|
### sendDeviceKeyEvent
|
|
486
510
|
|
|
487
511
|
Send a key event to the device.
|
|
488
|
-
List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][
|
|
512
|
+
List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][9]
|
|
489
513
|
|
|
490
514
|
```js
|
|
491
515
|
I.sendDeviceKeyEvent(3);
|
|
@@ -493,7 +517,9 @@ I.sendDeviceKeyEvent(3);
|
|
|
493
517
|
|
|
494
518
|
#### Parameters
|
|
495
519
|
|
|
496
|
-
- `keyValue` **[number][
|
|
520
|
+
- `keyValue` **[number][10]** Device specific key value
|
|
521
|
+
|
|
522
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
497
523
|
|
|
498
524
|
### openNotifications
|
|
499
525
|
|
|
@@ -503,7 +529,7 @@ Open the notifications panel on the device.
|
|
|
503
529
|
I.openNotifications();
|
|
504
530
|
```
|
|
505
531
|
|
|
506
|
-
Appium: support only Android
|
|
532
|
+
Returns **[Promise][4]<void>** Appium: support only Android
|
|
507
533
|
|
|
508
534
|
### makeTouchAction
|
|
509
535
|
|
|
@@ -511,19 +537,19 @@ The Touch Action API provides the basis of all gestures that can be
|
|
|
511
537
|
automated in Appium. At its core is the ability to chain together ad hoc
|
|
512
538
|
individual actions, which will then be applied to an element in the
|
|
513
539
|
application on the device.
|
|
514
|
-
[See complete documentation][
|
|
540
|
+
[See complete documentation][11]
|
|
515
541
|
|
|
516
542
|
```js
|
|
517
543
|
I.makeTouchAction("~buttonStartWebviewCD", 'tap');
|
|
518
544
|
```
|
|
519
545
|
|
|
520
|
-
Appium: support Android and iOS
|
|
521
|
-
|
|
522
546
|
#### Parameters
|
|
523
547
|
|
|
524
548
|
- `locator`
|
|
525
549
|
- `action`
|
|
526
550
|
|
|
551
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
552
|
+
|
|
527
553
|
### tap
|
|
528
554
|
|
|
529
555
|
Taps on element.
|
|
@@ -538,6 +564,8 @@ Shortcut for `makeTouchAction`
|
|
|
538
564
|
|
|
539
565
|
- `locator` **any**
|
|
540
566
|
|
|
567
|
+
Returns **[Promise][4]<void>**
|
|
568
|
+
|
|
541
569
|
### swipe
|
|
542
570
|
|
|
543
571
|
Perform a swipe on the screen or an element.
|
|
@@ -547,14 +575,16 @@ let locator = "#io.selendroid.testapp:id/LinearLayout1";
|
|
|
547
575
|
I.swipe(locator, 800, 1200, 1000);
|
|
548
576
|
```
|
|
549
577
|
|
|
550
|
-
[See complete reference][
|
|
578
|
+
[See complete reference][12]
|
|
551
579
|
|
|
552
580
|
#### Parameters
|
|
553
581
|
|
|
554
|
-
- `locator` **([string][
|
|
555
|
-
- `xoffset` **[number][
|
|
556
|
-
- `yoffset` **[number][
|
|
557
|
-
- `speed` **[number][
|
|
582
|
+
- `locator` **([string][5] \| [object][8])**
|
|
583
|
+
- `xoffset` **[number][10]**
|
|
584
|
+
- `yoffset` **[number][10]**
|
|
585
|
+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
586
|
+
|
|
587
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
558
588
|
|
|
559
589
|
### performSwipe
|
|
560
590
|
|
|
@@ -566,8 +596,8 @@ I.performswipe(100,200);
|
|
|
566
596
|
|
|
567
597
|
#### Parameters
|
|
568
598
|
|
|
569
|
-
- `from` **[number][
|
|
570
|
-
- `to` **[number][
|
|
599
|
+
- `from` **[number][10]**
|
|
600
|
+
- `to` **[number][10]** Appium: support Android and iOS
|
|
571
601
|
|
|
572
602
|
### swipeDown
|
|
573
603
|
|
|
@@ -582,9 +612,11 @@ I.swipeDown(locator, 1200, 1000); // set offset and speed
|
|
|
582
612
|
|
|
583
613
|
#### Parameters
|
|
584
614
|
|
|
585
|
-
- `locator` **([string][
|
|
586
|
-
- `yoffset` **[number][
|
|
587
|
-
- `speed` **[number][
|
|
615
|
+
- `locator` **([string][5] \| [object][8])**
|
|
616
|
+
- `yoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
617
|
+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
618
|
+
|
|
619
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
588
620
|
|
|
589
621
|
### swipeLeft
|
|
590
622
|
|
|
@@ -599,9 +631,11 @@ I.swipeLeft(locator, 1200, 1000); // set offset and speed
|
|
|
599
631
|
|
|
600
632
|
#### Parameters
|
|
601
633
|
|
|
602
|
-
- `locator` **([string][
|
|
603
|
-
- `xoffset` **[number][
|
|
604
|
-
- `speed` **[number][
|
|
634
|
+
- `locator` **([string][5] \| [object][8])**
|
|
635
|
+
- `xoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
636
|
+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
637
|
+
|
|
638
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
605
639
|
|
|
606
640
|
### swipeRight
|
|
607
641
|
|
|
@@ -616,9 +650,11 @@ I.swipeRight(locator, 1200, 1000); // set offset and speed
|
|
|
616
650
|
|
|
617
651
|
#### Parameters
|
|
618
652
|
|
|
619
|
-
- `locator` **([string][
|
|
620
|
-
- `xoffset` **[number][
|
|
621
|
-
- `speed` **[number][
|
|
653
|
+
- `locator` **([string][5] \| [object][8])**
|
|
654
|
+
- `xoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
655
|
+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
656
|
+
|
|
657
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
622
658
|
|
|
623
659
|
### swipeUp
|
|
624
660
|
|
|
@@ -633,9 +669,11 @@ I.swipeUp(locator, 1200, 1000); // set offset and speed
|
|
|
633
669
|
|
|
634
670
|
#### Parameters
|
|
635
671
|
|
|
636
|
-
- `locator` **([string][
|
|
637
|
-
- `yoffset` **[number][
|
|
638
|
-
- `speed` **[number][
|
|
672
|
+
- `locator` **([string][5] \| [object][8])**
|
|
673
|
+
- `yoffset` **[number][10]?** (optional) (optional, default `1000`)
|
|
674
|
+
- `speed` **[number][10]** (optional), 1000 by default (optional, default `1000`)
|
|
675
|
+
|
|
676
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
639
677
|
|
|
640
678
|
### swipeTo
|
|
641
679
|
|
|
@@ -653,12 +691,14 @@ I.swipeTo(
|
|
|
653
691
|
|
|
654
692
|
#### Parameters
|
|
655
693
|
|
|
656
|
-
- `searchableLocator` **[string][
|
|
657
|
-
- `scrollLocator` **[string][
|
|
658
|
-
- `direction` **[string][
|
|
659
|
-
- `timeout` **[number][
|
|
660
|
-
- `offset` **[number][
|
|
661
|
-
- `speed` **[number][
|
|
694
|
+
- `searchableLocator` **[string][5]**
|
|
695
|
+
- `scrollLocator` **[string][5]**
|
|
696
|
+
- `direction` **[string][5]**
|
|
697
|
+
- `timeout` **[number][10]**
|
|
698
|
+
- `offset` **[number][10]**
|
|
699
|
+
- `speed` **[number][10]**
|
|
700
|
+
|
|
701
|
+
Returns **[Promise][4]<void>** Appium: support Android and iOS
|
|
662
702
|
|
|
663
703
|
### touchPerform
|
|
664
704
|
|
|
@@ -689,7 +729,7 @@ Appium: support Android and iOS
|
|
|
689
729
|
|
|
690
730
|
#### Parameters
|
|
691
731
|
|
|
692
|
-
- `actions` **[Array][
|
|
732
|
+
- `actions` **[Array][6]** Array of touch actions
|
|
693
733
|
|
|
694
734
|
### pullFile
|
|
695
735
|
|
|
@@ -701,12 +741,12 @@ I.pullFile('/storage/emulated/0/DCIM/logo.png', 'my/path');
|
|
|
701
741
|
I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);
|
|
702
742
|
```
|
|
703
743
|
|
|
704
|
-
Appium: support Android and iOS
|
|
705
|
-
|
|
706
744
|
#### Parameters
|
|
707
745
|
|
|
708
|
-
- `path`
|
|
709
|
-
- `dest`
|
|
746
|
+
- `path` **[string][5]**
|
|
747
|
+
- `dest` **[string][5]**
|
|
748
|
+
|
|
749
|
+
Returns **[Promise][4]<[string][5]>** Appium: support Android and iOS
|
|
710
750
|
|
|
711
751
|
### shakeDevice
|
|
712
752
|
|
|
@@ -716,7 +756,7 @@ Perform a shake action on the device.
|
|
|
716
756
|
I.shakeDevice();
|
|
717
757
|
```
|
|
718
758
|
|
|
719
|
-
Appium: support only iOS
|
|
759
|
+
Returns **[Promise][4]<void>** Appium: support only iOS
|
|
720
760
|
|
|
721
761
|
### rotate
|
|
722
762
|
|
|
@@ -726,9 +766,7 @@ Perform a rotation gesture centered on the specified element.
|
|
|
726
766
|
I.rotate(120, 120)
|
|
727
767
|
```
|
|
728
768
|
|
|
729
|
-
See corresponding [webdriverio reference][
|
|
730
|
-
|
|
731
|
-
Appium: support only iOS
|
|
769
|
+
See corresponding [webdriverio reference][13].
|
|
732
770
|
|
|
733
771
|
#### Parameters
|
|
734
772
|
|
|
@@ -739,19 +777,21 @@ Appium: support only iOS
|
|
|
739
777
|
- `rotation`
|
|
740
778
|
- `touchCount`
|
|
741
779
|
|
|
780
|
+
Returns **[Promise][4]<void>** Appium: support only iOS
|
|
781
|
+
|
|
742
782
|
### setImmediateValue
|
|
743
783
|
|
|
744
784
|
Set immediate value in app.
|
|
745
785
|
|
|
746
|
-
See corresponding [webdriverio reference][
|
|
747
|
-
|
|
748
|
-
Appium: support only iOS
|
|
786
|
+
See corresponding [webdriverio reference][14].
|
|
749
787
|
|
|
750
788
|
#### Parameters
|
|
751
789
|
|
|
752
790
|
- `id`
|
|
753
791
|
- `value`
|
|
754
792
|
|
|
793
|
+
Returns **[Promise][4]<void>** Appium: support only iOS
|
|
794
|
+
|
|
755
795
|
### simulateTouchId
|
|
756
796
|
|
|
757
797
|
Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint.
|
|
@@ -762,13 +802,13 @@ I.touchId(true); // simulates valid fingerprint
|
|
|
762
802
|
I.touchId(false); // simulates invalid fingerprint
|
|
763
803
|
```
|
|
764
804
|
|
|
765
|
-
Appium: support only iOS
|
|
766
|
-
TODO: not tested
|
|
767
|
-
|
|
768
805
|
#### Parameters
|
|
769
806
|
|
|
770
807
|
- `match`
|
|
771
808
|
|
|
809
|
+
Returns **[Promise][4]<void>** Appium: support only iOS
|
|
810
|
+
TODO: not tested
|
|
811
|
+
|
|
772
812
|
### closeApp
|
|
773
813
|
|
|
774
814
|
Close the given application.
|
|
@@ -777,7 +817,7 @@ Close the given application.
|
|
|
777
817
|
I.closeApp();
|
|
778
818
|
```
|
|
779
819
|
|
|
780
|
-
Appium: support only iOS
|
|
820
|
+
Returns **[Promise][4]<void>** Appium: support only iOS
|
|
781
821
|
|
|
782
822
|
### appendField
|
|
783
823
|
|
|
@@ -790,8 +830,8 @@ I.appendField('#myTextField', 'appended');
|
|
|
790
830
|
|
|
791
831
|
#### Parameters
|
|
792
832
|
|
|
793
|
-
- `field` **([string][
|
|
794
|
-
- `value` **[string][
|
|
833
|
+
- `field` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator
|
|
834
|
+
- `value` **[string][5]** text value to append.
|
|
795
835
|
|
|
796
836
|
### checkOption
|
|
797
837
|
|
|
@@ -808,8 +848,8 @@ I.checkOption('agree', '//form');
|
|
|
808
848
|
|
|
809
849
|
#### Parameters
|
|
810
850
|
|
|
811
|
-
- `field` **([string][
|
|
812
|
-
- `context` **([string][
|
|
851
|
+
- `field` **([string][5] \| [object][8])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
852
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element located by CSS | XPath | strict locator. (optional, default `null`)
|
|
813
853
|
|
|
814
854
|
### click
|
|
815
855
|
|
|
@@ -837,8 +877,8 @@ I.click({css: 'nav a.login'});
|
|
|
837
877
|
|
|
838
878
|
#### Parameters
|
|
839
879
|
|
|
840
|
-
- `locator` **([string][
|
|
841
|
-
- `context` **([string][
|
|
880
|
+
- `locator` **([string][5] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
881
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator. (optional, default `null`)
|
|
842
882
|
|
|
843
883
|
### dontSeeCheckboxIsChecked
|
|
844
884
|
|
|
@@ -852,7 +892,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
852
892
|
|
|
853
893
|
#### Parameters
|
|
854
894
|
|
|
855
|
-
- `field` **([string][
|
|
895
|
+
- `field` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
856
896
|
|
|
857
897
|
### dontSeeElement
|
|
858
898
|
|
|
@@ -864,7 +904,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
864
904
|
|
|
865
905
|
#### Parameters
|
|
866
906
|
|
|
867
|
-
- `locator` **([string][
|
|
907
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|Strict locator.
|
|
868
908
|
|
|
869
909
|
### dontSeeInField
|
|
870
910
|
|
|
@@ -878,8 +918,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
878
918
|
|
|
879
919
|
#### Parameters
|
|
880
920
|
|
|
881
|
-
- `field` **([string][
|
|
882
|
-
- `value` **[string][
|
|
921
|
+
- `field` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
922
|
+
- `value` **[string][5]** value to check.
|
|
883
923
|
|
|
884
924
|
### dontSee
|
|
885
925
|
|
|
@@ -893,8 +933,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
893
933
|
|
|
894
934
|
#### Parameters
|
|
895
935
|
|
|
896
|
-
- `text` **[string][
|
|
897
|
-
- `context` **([string][
|
|
936
|
+
- `text` **[string][5]** which is not present.
|
|
937
|
+
- `context` **([string][5] \| [object][8])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search. (optional, default `null`)
|
|
898
938
|
|
|
899
939
|
### fillField
|
|
900
940
|
|
|
@@ -914,8 +954,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
914
954
|
|
|
915
955
|
#### Parameters
|
|
916
956
|
|
|
917
|
-
- `field` **([string][
|
|
918
|
-
- `value` **([string][
|
|
957
|
+
- `field` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
958
|
+
- `value` **([string][5] \| [object][8])** text value to fill.
|
|
919
959
|
|
|
920
960
|
### grabTextFromAll
|
|
921
961
|
|
|
@@ -928,9 +968,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
928
968
|
|
|
929
969
|
#### Parameters
|
|
930
970
|
|
|
931
|
-
- `locator` **([string][
|
|
971
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
932
972
|
|
|
933
|
-
Returns **[Promise][
|
|
973
|
+
Returns **[Promise][4]<[Array][6]<[string][5]>>** attribute value
|
|
934
974
|
|
|
935
975
|
### grabTextFrom
|
|
936
976
|
|
|
@@ -945,9 +985,9 @@ If multiple elements found returns first element.
|
|
|
945
985
|
|
|
946
986
|
#### Parameters
|
|
947
987
|
|
|
948
|
-
- `locator` **([string][
|
|
988
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
949
989
|
|
|
950
|
-
Returns **[Promise][
|
|
990
|
+
Returns **[Promise][4]<[string][5]>** attribute value
|
|
951
991
|
|
|
952
992
|
### grabNumberOfVisibleElements
|
|
953
993
|
|
|
@@ -960,9 +1000,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
960
1000
|
|
|
961
1001
|
#### Parameters
|
|
962
1002
|
|
|
963
|
-
- `locator` **([string][
|
|
1003
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
964
1004
|
|
|
965
|
-
Returns **[Promise][
|
|
1005
|
+
Returns **[Promise][4]<[number][10]>** number of visible elements
|
|
966
1006
|
|
|
967
1007
|
### grabAttributeFrom
|
|
968
1008
|
|
|
@@ -978,10 +1018,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
978
1018
|
|
|
979
1019
|
#### Parameters
|
|
980
1020
|
|
|
981
|
-
- `locator` **([string][
|
|
982
|
-
- `attr` **[string][
|
|
1021
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1022
|
+
- `attr` **[string][5]** attribute name.
|
|
983
1023
|
|
|
984
|
-
Returns **[Promise][
|
|
1024
|
+
Returns **[Promise][4]<[string][5]>** attribute value
|
|
985
1025
|
|
|
986
1026
|
### grabAttributeFromAll
|
|
987
1027
|
|
|
@@ -995,10 +1035,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
995
1035
|
|
|
996
1036
|
#### Parameters
|
|
997
1037
|
|
|
998
|
-
- `locator` **([string][
|
|
999
|
-
- `attr` **[string][
|
|
1038
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1039
|
+
- `attr` **[string][5]** attribute name.
|
|
1000
1040
|
|
|
1001
|
-
Returns **[Promise][
|
|
1041
|
+
Returns **[Promise][4]<[Array][6]<[string][5]>>** attribute value
|
|
1002
1042
|
|
|
1003
1043
|
### grabValueFromAll
|
|
1004
1044
|
|
|
@@ -1011,9 +1051,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1011
1051
|
|
|
1012
1052
|
#### Parameters
|
|
1013
1053
|
|
|
1014
|
-
- `locator` **([string][
|
|
1054
|
+
- `locator` **([string][5] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1015
1055
|
|
|
1016
|
-
Returns **[Promise][
|
|
1056
|
+
Returns **[Promise][4]<[Array][6]<[string][5]>>** attribute value
|
|
1017
1057
|
|
|
1018
1058
|
### grabValueFrom
|
|
1019
1059
|
|
|
@@ -1027,9 +1067,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1027
1067
|
|
|
1028
1068
|
#### Parameters
|
|
1029
1069
|
|
|
1030
|
-
- `locator` **([string][
|
|
1070
|
+
- `locator` **([string][5] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1031
1071
|
|
|
1032
|
-
Returns **[Promise][
|
|
1072
|
+
Returns **[Promise][4]<[string][5]>** attribute value
|
|
1033
1073
|
|
|
1034
1074
|
### saveScreenshot
|
|
1035
1075
|
|
|
@@ -1042,7 +1082,9 @@ I.saveScreenshot('debug.png');
|
|
|
1042
1082
|
|
|
1043
1083
|
#### Parameters
|
|
1044
1084
|
|
|
1045
|
-
- `fileName` **[string][
|
|
1085
|
+
- `fileName` **[string][5]** file name to save.
|
|
1086
|
+
|
|
1087
|
+
Returns **[Promise][4]<void>**
|
|
1046
1088
|
|
|
1047
1089
|
### scrollIntoView
|
|
1048
1090
|
|
|
@@ -1056,7 +1098,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1056
1098
|
|
|
1057
1099
|
#### Parameters
|
|
1058
1100
|
|
|
1059
|
-
- `locator` **([string][
|
|
1101
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1060
1102
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][15].Supported only for web testing
|
|
1061
1103
|
|
|
1062
1104
|
### seeCheckboxIsChecked
|
|
@@ -1071,7 +1113,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1071
1113
|
|
|
1072
1114
|
#### Parameters
|
|
1073
1115
|
|
|
1074
|
-
- `field` **([string][
|
|
1116
|
+
- `field` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1075
1117
|
|
|
1076
1118
|
### seeElement
|
|
1077
1119
|
|
|
@@ -1084,7 +1126,7 @@ I.seeElement('#modal');
|
|
|
1084
1126
|
|
|
1085
1127
|
#### Parameters
|
|
1086
1128
|
|
|
1087
|
-
- `locator` **([string][
|
|
1129
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1088
1130
|
|
|
1089
1131
|
### seeInField
|
|
1090
1132
|
|
|
@@ -1100,8 +1142,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1100
1142
|
|
|
1101
1143
|
#### Parameters
|
|
1102
1144
|
|
|
1103
|
-
- `field` **([string][
|
|
1104
|
-
- `value` **[string][
|
|
1145
|
+
- `field` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1146
|
+
- `value` **[string][5]** value to check.
|
|
1105
1147
|
|
|
1106
1148
|
### see
|
|
1107
1149
|
|
|
@@ -1116,8 +1158,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1116
1158
|
|
|
1117
1159
|
#### Parameters
|
|
1118
1160
|
|
|
1119
|
-
- `text` **[string][
|
|
1120
|
-
- `context` **([string][
|
|
1161
|
+
- `text` **[string][5]** expected on page.
|
|
1162
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text. (optional, default `null`)
|
|
1121
1163
|
|
|
1122
1164
|
### selectOption
|
|
1123
1165
|
|
|
@@ -1142,8 +1184,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1142
1184
|
|
|
1143
1185
|
#### Parameters
|
|
1144
1186
|
|
|
1145
|
-
- `select` **([string][
|
|
1146
|
-
- `option` **([string][
|
|
1187
|
+
- `select` **([string][5] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1188
|
+
- `option` **([string][5] \| [Array][6]<any>)** visible text or value of option.Supported only for web testing
|
|
1147
1189
|
|
|
1148
1190
|
### waitForElement
|
|
1149
1191
|
|
|
@@ -1157,8 +1199,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1157
1199
|
|
|
1158
1200
|
#### Parameters
|
|
1159
1201
|
|
|
1160
|
-
- `locator` **([string][
|
|
1161
|
-
- `sec` **[number][
|
|
1202
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1203
|
+
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait (optional, default `null`)
|
|
1162
1204
|
|
|
1163
1205
|
### waitForVisible
|
|
1164
1206
|
|
|
@@ -1171,8 +1213,8 @@ I.waitForVisible('#popup');
|
|
|
1171
1213
|
|
|
1172
1214
|
#### Parameters
|
|
1173
1215
|
|
|
1174
|
-
- `locator` **([string][
|
|
1175
|
-
- `sec` **[number][
|
|
1216
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1217
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
|
|
1176
1218
|
|
|
1177
1219
|
### waitForInvisible
|
|
1178
1220
|
|
|
@@ -1185,8 +1227,8 @@ I.waitForInvisible('#popup');
|
|
|
1185
1227
|
|
|
1186
1228
|
#### Parameters
|
|
1187
1229
|
|
|
1188
|
-
- `locator` **([string][
|
|
1189
|
-
- `sec` **[number][
|
|
1230
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1231
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
|
|
1190
1232
|
|
|
1191
1233
|
### waitForText
|
|
1192
1234
|
|
|
@@ -1201,9 +1243,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1201
1243
|
|
|
1202
1244
|
#### Parameters
|
|
1203
1245
|
|
|
1204
|
-
- `text` **[string][
|
|
1205
|
-
- `sec` **[number][
|
|
1206
|
-
- `context` **([string][
|
|
1246
|
+
- `text` **[string][5]** to wait for.
|
|
1247
|
+
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
|
|
1248
|
+
- `context` **([string][5] \| [object][8])?** (optional) element located by CSS|XPath|strict locator. (optional, default `null`)
|
|
1207
1249
|
|
|
1208
1250
|
### useWebDriverTo
|
|
1209
1251
|
|
|
@@ -1223,7 +1265,7 @@ I.useWebDriverTo('open multiple windows', async ({ browser }) {
|
|
|
1223
1265
|
|
|
1224
1266
|
#### Parameters
|
|
1225
1267
|
|
|
1226
|
-
- `description` **[string][
|
|
1268
|
+
- `description` **[string][5]** used to show in logs.
|
|
1227
1269
|
- `fn` **[function][17]** async functuion that executed with WebDriver helper as argument
|
|
1228
1270
|
|
|
1229
1271
|
### \_isShadowLocator
|
|
@@ -1232,7 +1274,7 @@ Check if locator is type of "Shadow"
|
|
|
1232
1274
|
|
|
1233
1275
|
#### Parameters
|
|
1234
1276
|
|
|
1235
|
-
- `locator` **[object][
|
|
1277
|
+
- `locator` **[object][8]**
|
|
1236
1278
|
|
|
1237
1279
|
### \_locateShadow
|
|
1238
1280
|
|
|
@@ -1240,7 +1282,7 @@ Locate Element within the Shadow Dom
|
|
|
1240
1282
|
|
|
1241
1283
|
#### Parameters
|
|
1242
1284
|
|
|
1243
|
-
- `locator` **[object][
|
|
1285
|
+
- `locator` **[object][8]**
|
|
1244
1286
|
|
|
1245
1287
|
### \_smartWait
|
|
1246
1288
|
|
|
@@ -1248,7 +1290,7 @@ Smart Wait to locate an element
|
|
|
1248
1290
|
|
|
1249
1291
|
#### Parameters
|
|
1250
1292
|
|
|
1251
|
-
- `locator` **[object][
|
|
1293
|
+
- `locator` **[object][8]**
|
|
1252
1294
|
|
|
1253
1295
|
### \_locate
|
|
1254
1296
|
|
|
@@ -1261,7 +1303,7 @@ this.helpers['WebDriver']._locate({name: 'password'}).then //...
|
|
|
1261
1303
|
|
|
1262
1304
|
#### Parameters
|
|
1263
1305
|
|
|
1264
|
-
- `locator` **([string][
|
|
1306
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1265
1307
|
- `smartWait` (optional, default `false`)
|
|
1266
1308
|
|
|
1267
1309
|
### \_locateCheckable
|
|
@@ -1274,7 +1316,7 @@ this.helpers['WebDriver']._locateCheckable('I agree with terms and conditions').
|
|
|
1274
1316
|
|
|
1275
1317
|
#### Parameters
|
|
1276
1318
|
|
|
1277
|
-
- `locator` **([string][
|
|
1319
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1278
1320
|
|
|
1279
1321
|
### \_locateClickable
|
|
1280
1322
|
|
|
@@ -1287,7 +1329,7 @@ const els = await this.helpers.WebDriver._locateClickable('Next page', '.pages')
|
|
|
1287
1329
|
|
|
1288
1330
|
#### Parameters
|
|
1289
1331
|
|
|
1290
|
-
- `locator` **([string][
|
|
1332
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1291
1333
|
- `context`
|
|
1292
1334
|
|
|
1293
1335
|
### \_locateFields
|
|
@@ -1300,7 +1342,7 @@ this.helpers['WebDriver']._locateFields('Your email').then // ...
|
|
|
1300
1342
|
|
|
1301
1343
|
#### Parameters
|
|
1302
1344
|
|
|
1303
|
-
- `locator` **([string][
|
|
1345
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1304
1346
|
|
|
1305
1347
|
### defineTimeout
|
|
1306
1348
|
|
|
@@ -1330,7 +1372,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
1330
1372
|
|
|
1331
1373
|
#### Parameters
|
|
1332
1374
|
|
|
1333
|
-
- `url` **[string][
|
|
1375
|
+
- `url` **[string][5]** url path or global url.
|
|
1334
1376
|
|
|
1335
1377
|
### forceClick
|
|
1336
1378
|
|
|
@@ -1361,8 +1403,8 @@ I.forceClick({css: 'nav a.login'});
|
|
|
1361
1403
|
|
|
1362
1404
|
#### Parameters
|
|
1363
1405
|
|
|
1364
|
-
- `locator` **([string][
|
|
1365
|
-
- `context` **([string][
|
|
1406
|
+
- `locator` **([string][5] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1407
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.{{ react }} (optional, default `null`)
|
|
1366
1408
|
|
|
1367
1409
|
### doubleClick
|
|
1368
1410
|
|
|
@@ -1378,8 +1420,8 @@ I.doubleClick('.btn.edit');
|
|
|
1378
1420
|
|
|
1379
1421
|
#### Parameters
|
|
1380
1422
|
|
|
1381
|
-
- `locator` **([string][
|
|
1382
|
-
- `context` **([string][
|
|
1423
|
+
- `locator` **([string][5] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1424
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.{{ react }} (optional, default `null`)
|
|
1383
1425
|
|
|
1384
1426
|
### rightClick
|
|
1385
1427
|
|
|
@@ -1396,8 +1438,8 @@ I.rightClick('Click me', '.context');
|
|
|
1396
1438
|
|
|
1397
1439
|
#### Parameters
|
|
1398
1440
|
|
|
1399
|
-
- `locator` **([string][
|
|
1400
|
-
- `context` **([string][
|
|
1441
|
+
- `locator` **([string][5] \| [object][8])** clickable element located by CSS|XPath|strict locator.
|
|
1442
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element located by CSS|XPath|strict locator.{{ react }} (optional, default `null`)
|
|
1401
1443
|
|
|
1402
1444
|
### forceRightClick
|
|
1403
1445
|
|
|
@@ -1418,8 +1460,8 @@ I.forceRightClick('Menu');
|
|
|
1418
1460
|
|
|
1419
1461
|
#### Parameters
|
|
1420
1462
|
|
|
1421
|
-
- `locator` **([string][
|
|
1422
|
-
- `context` **([string][
|
|
1463
|
+
- `locator` **([string][5] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1464
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.{{ react }} (optional, default `null`)
|
|
1423
1465
|
|
|
1424
1466
|
### clearField
|
|
1425
1467
|
|
|
@@ -1434,7 +1476,7 @@ I.clearField('#email');
|
|
|
1434
1476
|
#### Parameters
|
|
1435
1477
|
|
|
1436
1478
|
- `field`
|
|
1437
|
-
- `editable` **([string][
|
|
1479
|
+
- `editable` **([string][5] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1438
1480
|
|
|
1439
1481
|
### attachFile
|
|
1440
1482
|
|
|
@@ -1449,8 +1491,8 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
1449
1491
|
|
|
1450
1492
|
#### Parameters
|
|
1451
1493
|
|
|
1452
|
-
- `locator` **([string][
|
|
1453
|
-
- `pathToFile` **[string][
|
|
1494
|
+
- `locator` **([string][5] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1495
|
+
- `pathToFile` **[string][5]** local file path relative to codecept.json config file.
|
|
1454
1496
|
Appium: not tested
|
|
1455
1497
|
|
|
1456
1498
|
### uncheckOption
|
|
@@ -1468,8 +1510,8 @@ I.uncheckOption('agree', '//form');
|
|
|
1468
1510
|
|
|
1469
1511
|
#### Parameters
|
|
1470
1512
|
|
|
1471
|
-
- `field` **([string][
|
|
1472
|
-
- `context` **([string][
|
|
1513
|
+
- `field` **([string][5] \| [object][8])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1514
|
+
- `context` **([string][5]? | [object][8])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1473
1515
|
Appium: not tested (optional, default `null`)
|
|
1474
1516
|
|
|
1475
1517
|
### grabHTMLFromAll
|
|
@@ -1484,9 +1526,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1484
1526
|
#### Parameters
|
|
1485
1527
|
|
|
1486
1528
|
- `locator`
|
|
1487
|
-
- `element` **([string][
|
|
1529
|
+
- `element` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1488
1530
|
|
|
1489
|
-
Returns **[Promise][
|
|
1531
|
+
Returns **[Promise][4]<[Array][6]<[string][5]>>** HTML code for an element
|
|
1490
1532
|
|
|
1491
1533
|
### grabHTMLFrom
|
|
1492
1534
|
|
|
@@ -1501,9 +1543,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1501
1543
|
#### Parameters
|
|
1502
1544
|
|
|
1503
1545
|
- `locator`
|
|
1504
|
-
- `element` **([string][
|
|
1546
|
+
- `element` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1505
1547
|
|
|
1506
|
-
Returns **[Promise][
|
|
1548
|
+
Returns **[Promise][4]<[string][5]>** HTML code for an element
|
|
1507
1549
|
|
|
1508
1550
|
### seeTextEquals
|
|
1509
1551
|
|
|
@@ -1515,8 +1557,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1515
1557
|
|
|
1516
1558
|
#### Parameters
|
|
1517
1559
|
|
|
1518
|
-
- `text` **[string][
|
|
1519
|
-
- `context` **([string][
|
|
1560
|
+
- `text` **[string][5]** element value to check.
|
|
1561
|
+
- `context` **([string][5] \| [object][8])?** element located by CSS|XPath|strict locator. (optional, default `null`)
|
|
1520
1562
|
|
|
1521
1563
|
### seeElementInDOM
|
|
1522
1564
|
|
|
@@ -1529,7 +1571,7 @@ I.seeElementInDOM('#modal');
|
|
|
1529
1571
|
|
|
1530
1572
|
#### Parameters
|
|
1531
1573
|
|
|
1532
|
-
- `locator` **([string][
|
|
1574
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1533
1575
|
|
|
1534
1576
|
### dontSeeElementInDOM
|
|
1535
1577
|
|
|
@@ -1541,7 +1583,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
1541
1583
|
|
|
1542
1584
|
#### Parameters
|
|
1543
1585
|
|
|
1544
|
-
- `locator` **([string][
|
|
1586
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|Strict locator.
|
|
1545
1587
|
|
|
1546
1588
|
### seeInSource
|
|
1547
1589
|
|
|
@@ -1553,7 +1595,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1553
1595
|
|
|
1554
1596
|
#### Parameters
|
|
1555
1597
|
|
|
1556
|
-
- `text` **[string][
|
|
1598
|
+
- `text` **[string][5]** value to check.
|
|
1557
1599
|
|
|
1558
1600
|
### grabSource
|
|
1559
1601
|
|
|
@@ -1564,7 +1606,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1564
1606
|
let pageSource = await I.grabSource();
|
|
1565
1607
|
```
|
|
1566
1608
|
|
|
1567
|
-
Returns **[Promise][
|
|
1609
|
+
Returns **[Promise][4]<[string][5]>** source code
|
|
1568
1610
|
|
|
1569
1611
|
### grabBrowserLogs
|
|
1570
1612
|
|
|
@@ -1576,7 +1618,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
1576
1618
|
console.log(JSON.stringify(logs))
|
|
1577
1619
|
```
|
|
1578
1620
|
|
|
1579
|
-
Returns **([Promise][
|
|
1621
|
+
Returns **([Promise][4]<[Array][6]<[object][8]>> | [undefined][19])** all browser logs
|
|
1580
1622
|
|
|
1581
1623
|
### dontSeeInSource
|
|
1582
1624
|
|
|
@@ -1589,7 +1631,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
1589
1631
|
#### Parameters
|
|
1590
1632
|
|
|
1591
1633
|
- `text`
|
|
1592
|
-
- `value` **[string][
|
|
1634
|
+
- `value` **[string][5]** to check.
|
|
1593
1635
|
|
|
1594
1636
|
### seeNumberOfElements
|
|
1595
1637
|
|
|
@@ -1602,8 +1644,8 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1602
1644
|
|
|
1603
1645
|
#### Parameters
|
|
1604
1646
|
|
|
1605
|
-
- `locator` **([string][
|
|
1606
|
-
- `num` **[number][
|
|
1647
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1648
|
+
- `num` **[number][10]** number of elements.{{ react }}
|
|
1607
1649
|
|
|
1608
1650
|
### seeNumberOfVisibleElements
|
|
1609
1651
|
|
|
@@ -1616,8 +1658,8 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1616
1658
|
|
|
1617
1659
|
#### Parameters
|
|
1618
1660
|
|
|
1619
|
-
- `locator` **([string][
|
|
1620
|
-
- `num` **[number][
|
|
1661
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1662
|
+
- `num` **[number][10]** number of elements.{{ react }}
|
|
1621
1663
|
|
|
1622
1664
|
### seeAttributesOnElements
|
|
1623
1665
|
|
|
@@ -1629,8 +1671,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1629
1671
|
|
|
1630
1672
|
#### Parameters
|
|
1631
1673
|
|
|
1632
|
-
- `locator` **([string][
|
|
1633
|
-
- `attributes` **[object][
|
|
1674
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1675
|
+
- `attributes` **[object][8]** attributes and their values to check.
|
|
1634
1676
|
|
|
1635
1677
|
### scrollTo
|
|
1636
1678
|
|
|
@@ -1644,9 +1686,9 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1644
1686
|
|
|
1645
1687
|
#### Parameters
|
|
1646
1688
|
|
|
1647
|
-
- `locator` **([string][
|
|
1648
|
-
- `offsetX` **[number][
|
|
1649
|
-
- `offsetY` **[number][
|
|
1689
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1690
|
+
- `offsetX` **[number][10]** (optional, `0` by default) X-axis offset. (optional, default `0`)
|
|
1691
|
+
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset. (optional, default `0`)
|
|
1650
1692
|
|
|
1651
1693
|
### moveCursorTo
|
|
1652
1694
|
|
|
@@ -1660,11 +1702,11 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
1660
1702
|
|
|
1661
1703
|
#### Parameters
|
|
1662
1704
|
|
|
1663
|
-
- `locator` **([string][
|
|
1705
|
+
- `locator` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1664
1706
|
- `xOffset`
|
|
1665
1707
|
- `yOffset`
|
|
1666
|
-
- `offsetX` **[number][
|
|
1667
|
-
- `offsetY` **[number][
|
|
1708
|
+
- `offsetX` **[number][10]** (optional, `0` by default) X-axis offset. (optional, default `0`)
|
|
1709
|
+
- `offsetY` **[number][10]** (optional, `0` by default) Y-axis offset. (optional, default `0`)
|
|
1668
1710
|
|
|
1669
1711
|
### saveElementScreenshot
|
|
1670
1712
|
|
|
@@ -1677,8 +1719,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1677
1719
|
|
|
1678
1720
|
#### Parameters
|
|
1679
1721
|
|
|
1680
|
-
- `locator` **([string][
|
|
1681
|
-
- `fileName` **[string][
|
|
1722
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1723
|
+
- `fileName` **[string][5]** file name to save.
|
|
1682
1724
|
|
|
1683
1725
|
### type
|
|
1684
1726
|
|
|
@@ -1700,8 +1742,8 @@ I.type(['T', 'E', 'X', 'T']);
|
|
|
1700
1742
|
#### Parameters
|
|
1701
1743
|
|
|
1702
1744
|
- `keys`
|
|
1703
|
-
- `delay` **[number][
|
|
1704
|
-
- `key` **([string][
|
|
1745
|
+
- `delay` **[number][10]?** (optional) delay in ms between key presses (optional, default `null`)
|
|
1746
|
+
- `key` **([string][5] \| [Array][6]<[string][5]>)** or array of keys to type.
|
|
1705
1747
|
|
|
1706
1748
|
### dragAndDrop
|
|
1707
1749
|
|
|
@@ -1713,8 +1755,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
1713
1755
|
|
|
1714
1756
|
#### Parameters
|
|
1715
1757
|
|
|
1716
|
-
- `srcElement` **([string][
|
|
1717
|
-
- `destElement` **([string][
|
|
1758
|
+
- `srcElement` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1759
|
+
- `destElement` **([string][5] \| [object][8])** located by CSS|XPath|strict locator.Appium: not tested
|
|
1718
1760
|
|
|
1719
1761
|
### dragSlider
|
|
1720
1762
|
|
|
@@ -1728,8 +1770,8 @@ I.dragSlider('#slider', -70);
|
|
|
1728
1770
|
|
|
1729
1771
|
#### Parameters
|
|
1730
1772
|
|
|
1731
|
-
- `locator` **([string][
|
|
1732
|
-
- `offsetX` **[number][
|
|
1773
|
+
- `locator` **([string][5] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1774
|
+
- `offsetX` **[number][10]** position to drag. (optional, default `0`)
|
|
1733
1775
|
|
|
1734
1776
|
### grabAllWindowHandles
|
|
1735
1777
|
|
|
@@ -1740,7 +1782,7 @@ Useful for referencing a specific handle when calling `I.switchToWindow(handle)`
|
|
|
1740
1782
|
const windows = await I.grabAllWindowHandles();
|
|
1741
1783
|
```
|
|
1742
1784
|
|
|
1743
|
-
Returns **[Promise][
|
|
1785
|
+
Returns **[Promise][4]<[Array][6]<[string][5]>>**
|
|
1744
1786
|
|
|
1745
1787
|
### grabCurrentWindowHandle
|
|
1746
1788
|
|
|
@@ -1751,7 +1793,7 @@ Useful for referencing it when calling `I.switchToWindow(handle)`
|
|
|
1751
1793
|
const window = await I.grabCurrentWindowHandle();
|
|
1752
1794
|
```
|
|
1753
1795
|
|
|
1754
|
-
Returns **[Promise][
|
|
1796
|
+
Returns **[Promise][4]<[string][5]>**
|
|
1755
1797
|
|
|
1756
1798
|
### switchToWindow
|
|
1757
1799
|
|
|
@@ -1769,7 +1811,7 @@ await I.switchToWindow( window );
|
|
|
1769
1811
|
|
|
1770
1812
|
#### Parameters
|
|
1771
1813
|
|
|
1772
|
-
- `window` **[string][
|
|
1814
|
+
- `window` **[string][5]** name of window handle.
|
|
1773
1815
|
|
|
1774
1816
|
### closeOtherTabs
|
|
1775
1817
|
|
|
@@ -1790,7 +1832,7 @@ I.switchTo(); // switch back to main page
|
|
|
1790
1832
|
|
|
1791
1833
|
#### Parameters
|
|
1792
1834
|
|
|
1793
|
-
- `locator` **([string][
|
|
1835
|
+
- `locator` **([string][5]? | [object][8])** (optional, `null` by default) element located by CSS|XPath|strict locator. (optional, default `null`)
|
|
1794
1836
|
|
|
1795
1837
|
### grabNumberOfOpenTabs
|
|
1796
1838
|
|
|
@@ -1801,7 +1843,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1801
1843
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
1802
1844
|
```
|
|
1803
1845
|
|
|
1804
|
-
Returns **[Promise][
|
|
1846
|
+
Returns **[Promise][4]<[number][10]>** number of open tabs
|
|
1805
1847
|
|
|
1806
1848
|
### scrollPageToTop
|
|
1807
1849
|
|
|
@@ -1828,7 +1870,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
1828
1870
|
let { x, y } = await I.grabPageScrollPosition();
|
|
1829
1871
|
```
|
|
1830
1872
|
|
|
1831
|
-
Returns **[Promise][
|
|
1873
|
+
Returns **[Promise][4]<PageScrollPosition>** scroll position
|
|
1832
1874
|
|
|
1833
1875
|
### setGeoLocation
|
|
1834
1876
|
|
|
@@ -1841,9 +1883,9 @@ I.setGeoLocation(121.21, 11.56, 10);
|
|
|
1841
1883
|
|
|
1842
1884
|
#### Parameters
|
|
1843
1885
|
|
|
1844
|
-
- `latitude` **[number][
|
|
1845
|
-
- `longitude` **[number][
|
|
1846
|
-
- `altitude` **[number][
|
|
1886
|
+
- `latitude` **[number][10]** to set.
|
|
1887
|
+
- `longitude` **[number][10]** to set
|
|
1888
|
+
- `altitude` **[number][10]?** (optional, null by default) to set (optional, default `null`)
|
|
1847
1889
|
|
|
1848
1890
|
### grabGeoLocation
|
|
1849
1891
|
|
|
@@ -1854,7 +1896,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1854
1896
|
let geoLocation = await I.grabGeoLocation();
|
|
1855
1897
|
```
|
|
1856
1898
|
|
|
1857
|
-
Returns **[Promise][
|
|
1899
|
+
Returns **[Promise][4]<{latitude: [number][10], longitude: [number][10], altitude: [number][10]}>**
|
|
1858
1900
|
|
|
1859
1901
|
### grabElementBoundingRect
|
|
1860
1902
|
|
|
@@ -1878,11 +1920,11 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1878
1920
|
|
|
1879
1921
|
#### Parameters
|
|
1880
1922
|
|
|
1881
|
-
- `locator` **([string][
|
|
1923
|
+
- `locator` **([string][5] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1882
1924
|
- `prop`
|
|
1883
|
-
- `elementSize` **[string][
|
|
1925
|
+
- `elementSize` **[string][5]?** x, y, width or height of the given element.
|
|
1884
1926
|
|
|
1885
|
-
Returns **([Promise][
|
|
1927
|
+
Returns **([Promise][4]<DOMRect> | [Promise][4]<[number][10]>)** Element bounding rectangle
|
|
1886
1928
|
|
|
1887
1929
|
[1]: http://codecept.io/helpers/WebDriver/
|
|
1888
1930
|
|
|
@@ -1890,27 +1932,27 @@ Returns **([Promise][14]<DOMRect> | [Promise][14]<[number][8]>)** Element
|
|
|
1890
1932
|
|
|
1891
1933
|
[3]: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
|
|
1892
1934
|
|
|
1893
|
-
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1935
|
+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1894
1936
|
|
|
1895
|
-
[5]:
|
|
1937
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1896
1938
|
|
|
1897
|
-
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1939
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1898
1940
|
|
|
1899
|
-
[7]:
|
|
1941
|
+
[7]: http://webdriver.io/api/mobile/setNetworkConnection.html
|
|
1900
1942
|
|
|
1901
|
-
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1943
|
+
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1902
1944
|
|
|
1903
|
-
[9]:
|
|
1945
|
+
[9]: https://developer.android.com/reference/android/view/KeyEvent.html
|
|
1904
1946
|
|
|
1905
|
-
[10]:
|
|
1947
|
+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1906
1948
|
|
|
1907
|
-
[11]:
|
|
1949
|
+
[11]: http://webdriver.io/api/mobile/touchAction.html
|
|
1908
1950
|
|
|
1909
|
-
[12]: http://webdriver.io/api/mobile/
|
|
1951
|
+
[12]: http://webdriver.io/api/mobile/swipe.html
|
|
1910
1952
|
|
|
1911
|
-
[13]: http://webdriver.io/api/mobile/
|
|
1953
|
+
[13]: http://webdriver.io/api/mobile/rotate.html
|
|
1912
1954
|
|
|
1913
|
-
[14]:
|
|
1955
|
+
[14]: http://webdriver.io/api/mobile/setImmediateValue.html
|
|
1914
1956
|
|
|
1915
1957
|
[15]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
|
|
1916
1958
|
|