codeceptjs 3.4.1 → 3.5.0
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 +65 -0
- package/README.md +9 -7
- package/bin/codecept.js +1 -1
- package/docs/ai.md +246 -0
- package/docs/build/Appium.js +47 -7
- package/docs/build/JSONResponse.js +4 -4
- package/docs/build/Nightmare.js +3 -1
- package/docs/build/OpenAI.js +122 -0
- package/docs/build/Playwright.js +193 -45
- package/docs/build/Protractor.js +3 -1
- package/docs/build/Puppeteer.js +45 -12
- package/docs/build/REST.js +15 -5
- package/docs/build/TestCafe.js +3 -1
- package/docs/build/WebDriver.js +30 -5
- package/docs/changelog.md +65 -0
- package/docs/helpers/Appium.md +152 -147
- package/docs/helpers/JSONResponse.md +4 -4
- package/docs/helpers/Nightmare.md +2 -0
- package/docs/helpers/OpenAI.md +70 -0
- package/docs/helpers/Playwright.md +194 -152
- package/docs/helpers/Puppeteer.md +6 -0
- package/docs/helpers/REST.md +6 -5
- package/docs/helpers/TestCafe.md +2 -0
- package/docs/helpers/WebDriver.md +10 -4
- package/docs/mobile.md +49 -2
- package/docs/parallel.md +56 -0
- package/docs/plugins.md +87 -33
- package/docs/secrets.md +6 -0
- package/docs/tutorial.md +2 -2
- package/docs/webapi/appendField.mustache +2 -0
- package/docs/webapi/type.mustache +3 -0
- package/lib/ai.js +171 -0
- package/lib/cli.js +1 -1
- package/lib/codecept.js +4 -0
- package/lib/command/dryRun.js +9 -1
- package/lib/command/generate.js +46 -3
- package/lib/command/init.js +13 -1
- package/lib/command/interactive.js +15 -1
- package/lib/command/run-workers.js +2 -1
- package/lib/container.js +13 -3
- package/lib/helper/Appium.js +45 -7
- package/lib/helper/JSONResponse.js +4 -4
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/OpenAI.js +122 -0
- package/lib/helper/Playwright.js +190 -38
- package/lib/helper/Protractor.js +1 -1
- package/lib/helper/Puppeteer.js +40 -12
- package/lib/helper/REST.js +15 -5
- package/lib/helper/TestCafe.js +1 -1
- package/lib/helper/WebDriver.js +25 -5
- package/lib/helper/scripts/highlightElement.js +20 -0
- package/lib/html.js +258 -0
- package/lib/listener/retry.js +2 -1
- package/lib/pause.js +73 -17
- package/lib/plugin/debugErrors.js +67 -0
- package/lib/plugin/fakerTransform.js +4 -6
- package/lib/plugin/heal.js +179 -0
- package/lib/plugin/screenshotOnFail.js +11 -2
- package/lib/recorder.js +4 -4
- package/lib/secret.js +5 -4
- package/lib/step.js +6 -1
- package/lib/ui.js +4 -3
- package/lib/utils.js +4 -0
- package/lib/workers.js +57 -9
- package/package.json +25 -13
- package/translations/ja-JP.js +9 -9
- package/typings/index.d.ts +43 -9
- package/typings/promiseBasedTypes.d.ts +124 -24
- package/typings/types.d.ts +138 -30
package/docs/helpers/Appium.md
CHANGED
|
@@ -25,6 +25,7 @@ Launch the daemon: `appium`
|
|
|
25
25
|
|
|
26
26
|
This helper should be configured in codecept.conf.ts or codecept.conf.js
|
|
27
27
|
|
|
28
|
+
- `appiumV2`: set this to true if you want to run tests with Appiumv2. See more how to setup [here][3]
|
|
28
29
|
- `app`: Application path. Local path or remote URL to an .ipa or .apk file, or a .zip containing one of these. Alias to desiredCapabilities.appPackage
|
|
29
30
|
- `host`: (default: 'localhost') Appium host
|
|
30
31
|
- `port`: (default: '4723') Appium port
|
|
@@ -98,11 +99,11 @@ helpers: {
|
|
|
98
99
|
}
|
|
99
100
|
```
|
|
100
101
|
|
|
101
|
-
Additional configuration params can be used from [https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md][
|
|
102
|
+
Additional configuration params can be used from [https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md][4]
|
|
102
103
|
|
|
103
104
|
## Access From Helpers
|
|
104
105
|
|
|
105
|
-
Receive
|
|
106
|
+
Receive Appium client from a custom helper by accessing `browser` property:
|
|
106
107
|
|
|
107
108
|
```js
|
|
108
109
|
let browser = this.helpers['Appium'].browser
|
|
@@ -211,9 +212,9 @@ I.checkIfAppIsInstalled("com.example.android.apis");
|
|
|
211
212
|
|
|
212
213
|
#### Parameters
|
|
213
214
|
|
|
214
|
-
- `bundleId` **[string][
|
|
215
|
+
- `bundleId` **[string][5]** String ID of bundled app
|
|
215
216
|
|
|
216
|
-
Returns **[Promise][
|
|
217
|
+
Returns **[Promise][6]<[boolean][7]>** Appium: support only Android
|
|
217
218
|
|
|
218
219
|
### seeAppIsInstalled
|
|
219
220
|
|
|
@@ -225,9 +226,9 @@ I.seeAppIsInstalled("com.example.android.apis");
|
|
|
225
226
|
|
|
226
227
|
#### Parameters
|
|
227
228
|
|
|
228
|
-
- `bundleId` **[string][
|
|
229
|
+
- `bundleId` **[string][5]** String ID of bundled app
|
|
229
230
|
|
|
230
|
-
Returns **[Promise][
|
|
231
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
231
232
|
|
|
232
233
|
### seeAppIsNotInstalled
|
|
233
234
|
|
|
@@ -239,9 +240,9 @@ I.seeAppIsNotInstalled("com.example.android.apis");
|
|
|
239
240
|
|
|
240
241
|
#### Parameters
|
|
241
242
|
|
|
242
|
-
- `bundleId` **[string][
|
|
243
|
+
- `bundleId` **[string][5]** String ID of bundled app
|
|
243
244
|
|
|
244
|
-
Returns **[Promise][
|
|
245
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
245
246
|
|
|
246
247
|
### installApp
|
|
247
248
|
|
|
@@ -253,9 +254,9 @@ I.installApp('/path/to/file.apk');
|
|
|
253
254
|
|
|
254
255
|
#### Parameters
|
|
255
256
|
|
|
256
|
-
- `path` **[string][
|
|
257
|
+
- `path` **[string][5]** path to apk file
|
|
257
258
|
|
|
258
|
-
Returns **[Promise][
|
|
259
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
259
260
|
|
|
260
261
|
### removeApp
|
|
261
262
|
|
|
@@ -269,8 +270,8 @@ Appium: support only Android
|
|
|
269
270
|
|
|
270
271
|
#### Parameters
|
|
271
272
|
|
|
272
|
-
- `appId` **[string][
|
|
273
|
-
- `bundleId` **[string][
|
|
273
|
+
- `appId` **[string][5]**
|
|
274
|
+
- `bundleId` **[string][5]?** ID of bundle
|
|
274
275
|
|
|
275
276
|
### resetApp
|
|
276
277
|
|
|
@@ -290,9 +291,9 @@ I.seeCurrentActivityIs(".HomeScreenActivity")
|
|
|
290
291
|
|
|
291
292
|
#### Parameters
|
|
292
293
|
|
|
293
|
-
- `currentActivity` **[string][
|
|
294
|
+
- `currentActivity` **[string][5]**
|
|
294
295
|
|
|
295
|
-
Returns **[Promise][
|
|
296
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
296
297
|
|
|
297
298
|
### seeDeviceIsLocked
|
|
298
299
|
|
|
@@ -302,7 +303,7 @@ Check whether the device is locked.
|
|
|
302
303
|
I.seeDeviceIsLocked();
|
|
303
304
|
```
|
|
304
305
|
|
|
305
|
-
Returns **[Promise][
|
|
306
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
306
307
|
|
|
307
308
|
### seeDeviceIsUnlocked
|
|
308
309
|
|
|
@@ -312,7 +313,7 @@ Check whether the device is not locked.
|
|
|
312
313
|
I.seeDeviceIsUnlocked();
|
|
313
314
|
```
|
|
314
315
|
|
|
315
|
-
Returns **[Promise][
|
|
316
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
316
317
|
|
|
317
318
|
### seeOrientationIs
|
|
318
319
|
|
|
@@ -327,7 +328,7 @@ I.seeOrientationIs('LANDSCAPE')
|
|
|
327
328
|
|
|
328
329
|
- `orientation` **(`"LANDSCAPE"` \| `"PORTRAIT"`)** LANDSCAPE or PORTRAITAppium: support Android and iOS
|
|
329
330
|
|
|
330
|
-
Returns **[Promise][
|
|
331
|
+
Returns **[Promise][6]<void>**
|
|
331
332
|
|
|
332
333
|
### setOrientation
|
|
333
334
|
|
|
@@ -348,7 +349,7 @@ Get list of all available contexts
|
|
|
348
349
|
|
|
349
350
|
let contexts = await I.grabAllContexts();
|
|
350
351
|
|
|
351
|
-
Returns **[Promise][
|
|
352
|
+
Returns **[Promise][6]<[Array][8]<[string][5]>>** Appium: support Android and iOS
|
|
352
353
|
|
|
353
354
|
### grabContext
|
|
354
355
|
|
|
@@ -358,7 +359,7 @@ Retrieve current context
|
|
|
358
359
|
let context = await I.grabContext();
|
|
359
360
|
```
|
|
360
361
|
|
|
361
|
-
Returns **[Promise][
|
|
362
|
+
Returns **[Promise][6]<([string][5] | null)>** Appium: support Android and iOS
|
|
362
363
|
|
|
363
364
|
### grabCurrentActivity
|
|
364
365
|
|
|
@@ -368,7 +369,7 @@ Get current device activity.
|
|
|
368
369
|
let activity = await I.grabCurrentActivity();
|
|
369
370
|
```
|
|
370
371
|
|
|
371
|
-
Returns **[Promise][
|
|
372
|
+
Returns **[Promise][6]<[string][5]>** Appium: support only Android
|
|
372
373
|
|
|
373
374
|
### grabNetworkConnection
|
|
374
375
|
|
|
@@ -380,7 +381,7 @@ properties to the response object to allow easier assertions.
|
|
|
380
381
|
let con = await I.grabNetworkConnection();
|
|
381
382
|
```
|
|
382
383
|
|
|
383
|
-
Returns **[Promise][
|
|
384
|
+
Returns **[Promise][6]<{}>** Appium: support only Android
|
|
384
385
|
|
|
385
386
|
### grabOrientation
|
|
386
387
|
|
|
@@ -390,7 +391,7 @@ Get current orientation.
|
|
|
390
391
|
let orientation = await I.grabOrientation();
|
|
391
392
|
```
|
|
392
393
|
|
|
393
|
-
Returns **[Promise][
|
|
394
|
+
Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS
|
|
394
395
|
|
|
395
396
|
### grabSettings
|
|
396
397
|
|
|
@@ -400,7 +401,7 @@ Get all the currently specified settings.
|
|
|
400
401
|
let settings = await I.grabSettings();
|
|
401
402
|
```
|
|
402
403
|
|
|
403
|
-
Returns **[Promise][
|
|
404
|
+
Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS
|
|
404
405
|
|
|
405
406
|
### \_switchToContext
|
|
406
407
|
|
|
@@ -425,9 +426,9 @@ I.switchToWeb('WEBVIEW_io.selendroid.testapp');
|
|
|
425
426
|
|
|
426
427
|
#### Parameters
|
|
427
428
|
|
|
428
|
-
- `context` **[string][
|
|
429
|
+
- `context` **[string][5]?**
|
|
429
430
|
|
|
430
|
-
Returns **[Promise][
|
|
431
|
+
Returns **[Promise][6]<void>**
|
|
431
432
|
|
|
432
433
|
### switchToNative
|
|
433
434
|
|
|
@@ -445,7 +446,7 @@ I.switchToNative('SOME_OTHER_CONTEXT');
|
|
|
445
446
|
|
|
446
447
|
- `context` **any?** (optional, default `null`)
|
|
447
448
|
|
|
448
|
-
Returns **[Promise][
|
|
449
|
+
Returns **[Promise][6]<void>**
|
|
449
450
|
|
|
450
451
|
### startActivity
|
|
451
452
|
|
|
@@ -459,10 +460,10 @@ Appium: support only Android
|
|
|
459
460
|
|
|
460
461
|
#### Parameters
|
|
461
462
|
|
|
462
|
-
- `appPackage` **[string][
|
|
463
|
-
- `appActivity` **[string][
|
|
463
|
+
- `appPackage` **[string][5]**
|
|
464
|
+
- `appActivity` **[string][5]**
|
|
464
465
|
|
|
465
|
-
Returns **[Promise][
|
|
466
|
+
Returns **[Promise][6]<void>**
|
|
466
467
|
|
|
467
468
|
### setNetworkConnection
|
|
468
469
|
|
|
@@ -480,13 +481,13 @@ I.setNetworkConnection(4) // airplane mode off, wifi off, data on
|
|
|
480
481
|
I.setNetworkConnection(6) // airplane mode off, wifi on, data on
|
|
481
482
|
```
|
|
482
483
|
|
|
483
|
-
See corresponding [webdriverio reference][
|
|
484
|
+
See corresponding [webdriverio reference][9].
|
|
484
485
|
|
|
485
486
|
#### Parameters
|
|
486
487
|
|
|
487
488
|
- `value`
|
|
488
489
|
|
|
489
|
-
Returns **[Promise][
|
|
490
|
+
Returns **[Promise][6]<{}>** Appium: support only Android
|
|
490
491
|
|
|
491
492
|
### setSettings
|
|
492
493
|
|
|
@@ -498,7 +499,7 @@ I.setSettings({cyberdelia: 'open'});
|
|
|
498
499
|
|
|
499
500
|
#### Parameters
|
|
500
501
|
|
|
501
|
-
- `settings` **[object][
|
|
502
|
+
- `settings` **[object][10]** objectAppium: support Android and iOS
|
|
502
503
|
|
|
503
504
|
### hideDeviceKeyboard
|
|
504
505
|
|
|
@@ -518,12 +519,12 @@ Appium: support Android and iOS
|
|
|
518
519
|
#### Parameters
|
|
519
520
|
|
|
520
521
|
- `strategy` **(`"tapOutside"` \| `"pressKey"`)?** Desired strategy to close keyboard (‘tapOutside’ or ‘pressKey’)
|
|
521
|
-
- `key` **[string][
|
|
522
|
+
- `key` **[string][5]?** Optional key
|
|
522
523
|
|
|
523
524
|
### sendDeviceKeyEvent
|
|
524
525
|
|
|
525
526
|
Send a key event to the device.
|
|
526
|
-
List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][
|
|
527
|
+
List of keys: [https://developer.android.com/reference/android/view/KeyEvent.html][11]
|
|
527
528
|
|
|
528
529
|
```js
|
|
529
530
|
I.sendDeviceKeyEvent(3);
|
|
@@ -531,9 +532,9 @@ I.sendDeviceKeyEvent(3);
|
|
|
531
532
|
|
|
532
533
|
#### Parameters
|
|
533
534
|
|
|
534
|
-
- `keyValue` **[number][
|
|
535
|
+
- `keyValue` **[number][12]** Device specific key value
|
|
535
536
|
|
|
536
|
-
Returns **[Promise][
|
|
537
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
537
538
|
|
|
538
539
|
### openNotifications
|
|
539
540
|
|
|
@@ -543,7 +544,7 @@ Open the notifications panel on the device.
|
|
|
543
544
|
I.openNotifications();
|
|
544
545
|
```
|
|
545
546
|
|
|
546
|
-
Returns **[Promise][
|
|
547
|
+
Returns **[Promise][6]<void>** Appium: support only Android
|
|
547
548
|
|
|
548
549
|
### makeTouchAction
|
|
549
550
|
|
|
@@ -551,7 +552,7 @@ The Touch Action API provides the basis of all gestures that can be
|
|
|
551
552
|
automated in Appium. At its core is the ability to chain together ad hoc
|
|
552
553
|
individual actions, which will then be applied to an element in the
|
|
553
554
|
application on the device.
|
|
554
|
-
[See complete documentation][
|
|
555
|
+
[See complete documentation][13]
|
|
555
556
|
|
|
556
557
|
```js
|
|
557
558
|
I.makeTouchAction("~buttonStartWebviewCD", 'tap');
|
|
@@ -562,7 +563,7 @@ I.makeTouchAction("~buttonStartWebviewCD", 'tap');
|
|
|
562
563
|
- `locator`
|
|
563
564
|
- `action`
|
|
564
565
|
|
|
565
|
-
Returns **[Promise][
|
|
566
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
566
567
|
|
|
567
568
|
### tap
|
|
568
569
|
|
|
@@ -578,7 +579,7 @@ Shortcut for `makeTouchAction`
|
|
|
578
579
|
|
|
579
580
|
- `locator` **any**
|
|
580
581
|
|
|
581
|
-
Returns **[Promise][
|
|
582
|
+
Returns **[Promise][6]<void>**
|
|
582
583
|
|
|
583
584
|
### swipe
|
|
584
585
|
|
|
@@ -589,16 +590,16 @@ let locator = "#io.selendroid.testapp:id/LinearLayout1";
|
|
|
589
590
|
I.swipe(locator, 800, 1200, 1000);
|
|
590
591
|
```
|
|
591
592
|
|
|
592
|
-
[See complete reference][
|
|
593
|
+
[See complete reference][14]
|
|
593
594
|
|
|
594
595
|
#### Parameters
|
|
595
596
|
|
|
596
|
-
- `locator` **([string][
|
|
597
|
-
- `xoffset` **[number][
|
|
598
|
-
- `yoffset` **[number][
|
|
599
|
-
- `speed` **[number][
|
|
597
|
+
- `locator` **([string][5] \| [object][10])**
|
|
598
|
+
- `xoffset` **[number][12]**
|
|
599
|
+
- `yoffset` **[number][12]**
|
|
600
|
+
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
|
|
600
601
|
|
|
601
|
-
Returns **[Promise][
|
|
602
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
602
603
|
|
|
603
604
|
### performSwipe
|
|
604
605
|
|
|
@@ -610,8 +611,8 @@ I.performSwipe({ x: 300, y: 100 }, { x: 200, y: 100 });
|
|
|
610
611
|
|
|
611
612
|
#### Parameters
|
|
612
613
|
|
|
613
|
-
- `from` **[object][
|
|
614
|
-
- `to` **[object][
|
|
614
|
+
- `from` **[object][10]**
|
|
615
|
+
- `to` **[object][10]** Appium: support Android and iOS
|
|
615
616
|
|
|
616
617
|
### swipeDown
|
|
617
618
|
|
|
@@ -626,11 +627,11 @@ I.swipeDown(locator, 1200, 1000); // set offset and speed
|
|
|
626
627
|
|
|
627
628
|
#### Parameters
|
|
628
629
|
|
|
629
|
-
- `locator` **([string][
|
|
630
|
-
- `yoffset` **[number][
|
|
631
|
-
- `speed` **[number][
|
|
630
|
+
- `locator` **([string][5] \| [object][10])**
|
|
631
|
+
- `yoffset` **[number][12]?** (optional) (optional, default `1000`)
|
|
632
|
+
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
|
|
632
633
|
|
|
633
|
-
Returns **[Promise][
|
|
634
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
634
635
|
|
|
635
636
|
### swipeLeft
|
|
636
637
|
|
|
@@ -645,11 +646,11 @@ I.swipeLeft(locator, 1200, 1000); // set offset and speed
|
|
|
645
646
|
|
|
646
647
|
#### Parameters
|
|
647
648
|
|
|
648
|
-
- `locator` **([string][
|
|
649
|
-
- `xoffset` **[number][
|
|
650
|
-
- `speed` **[number][
|
|
649
|
+
- `locator` **([string][5] \| [object][10])**
|
|
650
|
+
- `xoffset` **[number][12]?** (optional) (optional, default `1000`)
|
|
651
|
+
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
|
|
651
652
|
|
|
652
|
-
Returns **[Promise][
|
|
653
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
653
654
|
|
|
654
655
|
### swipeRight
|
|
655
656
|
|
|
@@ -664,11 +665,11 @@ I.swipeRight(locator, 1200, 1000); // set offset and speed
|
|
|
664
665
|
|
|
665
666
|
#### Parameters
|
|
666
667
|
|
|
667
|
-
- `locator` **([string][
|
|
668
|
-
- `xoffset` **[number][
|
|
669
|
-
- `speed` **[number][
|
|
668
|
+
- `locator` **([string][5] \| [object][10])**
|
|
669
|
+
- `xoffset` **[number][12]?** (optional) (optional, default `1000`)
|
|
670
|
+
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
|
|
670
671
|
|
|
671
|
-
Returns **[Promise][
|
|
672
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
672
673
|
|
|
673
674
|
### swipeUp
|
|
674
675
|
|
|
@@ -683,11 +684,11 @@ I.swipeUp(locator, 1200, 1000); // set offset and speed
|
|
|
683
684
|
|
|
684
685
|
#### Parameters
|
|
685
686
|
|
|
686
|
-
- `locator` **([string][
|
|
687
|
-
- `yoffset` **[number][
|
|
688
|
-
- `speed` **[number][
|
|
687
|
+
- `locator` **([string][5] \| [object][10])**
|
|
688
|
+
- `yoffset` **[number][12]?** (optional) (optional, default `1000`)
|
|
689
|
+
- `speed` **[number][12]** (optional), 1000 by default (optional, default `1000`)
|
|
689
690
|
|
|
690
|
-
Returns **[Promise][
|
|
691
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
691
692
|
|
|
692
693
|
### swipeTo
|
|
693
694
|
|
|
@@ -705,14 +706,14 @@ I.swipeTo(
|
|
|
705
706
|
|
|
706
707
|
#### Parameters
|
|
707
708
|
|
|
708
|
-
- `searchableLocator` **[string][
|
|
709
|
-
- `scrollLocator` **[string][
|
|
710
|
-
- `direction` **[string][
|
|
711
|
-
- `timeout` **[number][
|
|
712
|
-
- `offset` **[number][
|
|
713
|
-
- `speed` **[number][
|
|
709
|
+
- `searchableLocator` **[string][5]**
|
|
710
|
+
- `scrollLocator` **[string][5]**
|
|
711
|
+
- `direction` **[string][5]**
|
|
712
|
+
- `timeout` **[number][12]**
|
|
713
|
+
- `offset` **[number][12]**
|
|
714
|
+
- `speed` **[number][12]**
|
|
714
715
|
|
|
715
|
-
Returns **[Promise][
|
|
716
|
+
Returns **[Promise][6]<void>** Appium: support Android and iOS
|
|
716
717
|
|
|
717
718
|
### touchPerform
|
|
718
719
|
|
|
@@ -743,7 +744,7 @@ Appium: support Android and iOS
|
|
|
743
744
|
|
|
744
745
|
#### Parameters
|
|
745
746
|
|
|
746
|
-
- `actions` **[Array][
|
|
747
|
+
- `actions` **[Array][8]** Array of touch actions
|
|
747
748
|
|
|
748
749
|
### pullFile
|
|
749
750
|
|
|
@@ -757,10 +758,10 @@ I.pullFile('/storage/emulated/0/DCIM/logo.png', output_dir);
|
|
|
757
758
|
|
|
758
759
|
#### Parameters
|
|
759
760
|
|
|
760
|
-
- `path` **[string][
|
|
761
|
-
- `dest` **[string][
|
|
761
|
+
- `path` **[string][5]**
|
|
762
|
+
- `dest` **[string][5]**
|
|
762
763
|
|
|
763
|
-
Returns **[Promise][
|
|
764
|
+
Returns **[Promise][6]<[string][5]>** Appium: support Android and iOS
|
|
764
765
|
|
|
765
766
|
### shakeDevice
|
|
766
767
|
|
|
@@ -770,7 +771,7 @@ Perform a shake action on the device.
|
|
|
770
771
|
I.shakeDevice();
|
|
771
772
|
```
|
|
772
773
|
|
|
773
|
-
Returns **[Promise][
|
|
774
|
+
Returns **[Promise][6]<void>** Appium: support only iOS
|
|
774
775
|
|
|
775
776
|
### rotate
|
|
776
777
|
|
|
@@ -780,7 +781,7 @@ Perform a rotation gesture centered on the specified element.
|
|
|
780
781
|
I.rotate(120, 120)
|
|
781
782
|
```
|
|
782
783
|
|
|
783
|
-
See corresponding [webdriverio reference][
|
|
784
|
+
See corresponding [webdriverio reference][15].
|
|
784
785
|
|
|
785
786
|
#### Parameters
|
|
786
787
|
|
|
@@ -791,20 +792,20 @@ See corresponding [webdriverio reference][14].
|
|
|
791
792
|
- `rotation`
|
|
792
793
|
- `touchCount`
|
|
793
794
|
|
|
794
|
-
Returns **[Promise][
|
|
795
|
+
Returns **[Promise][6]<void>** Appium: support only iOS
|
|
795
796
|
|
|
796
797
|
### setImmediateValue
|
|
797
798
|
|
|
798
799
|
Set immediate value in app.
|
|
799
800
|
|
|
800
|
-
See corresponding [webdriverio reference][
|
|
801
|
+
See corresponding [webdriverio reference][16].
|
|
801
802
|
|
|
802
803
|
#### Parameters
|
|
803
804
|
|
|
804
805
|
- `id`
|
|
805
806
|
- `value`
|
|
806
807
|
|
|
807
|
-
Returns **[Promise][
|
|
808
|
+
Returns **[Promise][6]<void>** Appium: support only iOS
|
|
808
809
|
|
|
809
810
|
### simulateTouchId
|
|
810
811
|
|
|
@@ -820,7 +821,7 @@ I.touchId(false); // simulates invalid fingerprint
|
|
|
820
821
|
|
|
821
822
|
- `match`
|
|
822
823
|
|
|
823
|
-
Returns **[Promise][
|
|
824
|
+
Returns **[Promise][6]<void>** Appium: support only iOS
|
|
824
825
|
TODO: not tested
|
|
825
826
|
|
|
826
827
|
### closeApp
|
|
@@ -831,7 +832,7 @@ Close the given application.
|
|
|
831
832
|
I.closeApp();
|
|
832
833
|
```
|
|
833
834
|
|
|
834
|
-
Returns **[Promise][
|
|
835
|
+
Returns **[Promise][6]<void>** Appium: support only iOS
|
|
835
836
|
|
|
836
837
|
### appendField
|
|
837
838
|
|
|
@@ -840,12 +841,14 @@ Field is located by name, label, CSS or XPath
|
|
|
840
841
|
|
|
841
842
|
```js
|
|
842
843
|
I.appendField('#myTextField', 'appended');
|
|
844
|
+
// typing secret
|
|
845
|
+
I.appendField('password', secret('123456'));
|
|
843
846
|
```
|
|
844
847
|
|
|
845
848
|
#### Parameters
|
|
846
849
|
|
|
847
|
-
- `field` **([string][
|
|
848
|
-
- `value` **[string][
|
|
850
|
+
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator
|
|
851
|
+
- `value` **[string][5]** text value to append.
|
|
849
852
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
850
853
|
|
|
851
854
|
### checkOption
|
|
@@ -863,8 +866,8 @@ I.checkOption('agree', '//form');
|
|
|
863
866
|
|
|
864
867
|
#### Parameters
|
|
865
868
|
|
|
866
|
-
- `field` **([string][
|
|
867
|
-
- `context` **([string][
|
|
869
|
+
- `field` **([string][5] \| [object][10])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
870
|
+
- `context` **([string][5]? | [object][10])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
868
871
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
869
872
|
|
|
870
873
|
### click
|
|
@@ -893,8 +896,8 @@ I.click({css: 'nav a.login'});
|
|
|
893
896
|
|
|
894
897
|
#### Parameters
|
|
895
898
|
|
|
896
|
-
- `locator` **([string][
|
|
897
|
-
- `context` **([string][
|
|
899
|
+
- `locator` **([string][5] \| [object][10])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
900
|
+
- `context` **([string][5]? | [object][10] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
898
901
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
899
902
|
|
|
900
903
|
### dontSeeCheckboxIsChecked
|
|
@@ -909,7 +912,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
909
912
|
|
|
910
913
|
#### Parameters
|
|
911
914
|
|
|
912
|
-
- `field` **([string][
|
|
915
|
+
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
913
916
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
914
917
|
|
|
915
918
|
### dontSeeElement
|
|
@@ -922,7 +925,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
922
925
|
|
|
923
926
|
#### Parameters
|
|
924
927
|
|
|
925
|
-
- `locator` **([string][
|
|
928
|
+
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|Strict locator.
|
|
926
929
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
927
930
|
|
|
928
931
|
### dontSeeInField
|
|
@@ -937,8 +940,8 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
937
940
|
|
|
938
941
|
#### Parameters
|
|
939
942
|
|
|
940
|
-
- `field` **([string][
|
|
941
|
-
- `value` **[string][
|
|
943
|
+
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
944
|
+
- `value` **[string][5]** value to check.
|
|
942
945
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
943
946
|
|
|
944
947
|
### dontSee
|
|
@@ -953,8 +956,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
953
956
|
|
|
954
957
|
#### Parameters
|
|
955
958
|
|
|
956
|
-
- `text` **[string][
|
|
957
|
-
- `context` **([string][
|
|
959
|
+
- `text` **[string][5]** which is not present.
|
|
960
|
+
- `context` **([string][5] \| [object][10])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
958
961
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
959
962
|
|
|
960
963
|
### fillField
|
|
@@ -975,8 +978,8 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
975
978
|
|
|
976
979
|
#### Parameters
|
|
977
980
|
|
|
978
|
-
- `field` **([string][
|
|
979
|
-
- `value` **([string][
|
|
981
|
+
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
982
|
+
- `value` **([string][5] \| [object][10])** text value to fill.
|
|
980
983
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
981
984
|
|
|
982
985
|
### grabTextFromAll
|
|
@@ -990,9 +993,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
990
993
|
|
|
991
994
|
#### Parameters
|
|
992
995
|
|
|
993
|
-
- `locator` **([string][
|
|
996
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
994
997
|
|
|
995
|
-
Returns **[Promise][
|
|
998
|
+
Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value
|
|
996
999
|
|
|
997
1000
|
### grabTextFrom
|
|
998
1001
|
|
|
@@ -1007,9 +1010,9 @@ If multiple elements found returns first element.
|
|
|
1007
1010
|
|
|
1008
1011
|
#### Parameters
|
|
1009
1012
|
|
|
1010
|
-
- `locator` **([string][
|
|
1013
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
1011
1014
|
|
|
1012
|
-
Returns **[Promise][
|
|
1015
|
+
Returns **[Promise][6]<[string][5]>** attribute value
|
|
1013
1016
|
|
|
1014
1017
|
### grabNumberOfVisibleElements
|
|
1015
1018
|
|
|
@@ -1022,9 +1025,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1022
1025
|
|
|
1023
1026
|
#### Parameters
|
|
1024
1027
|
|
|
1025
|
-
- `locator` **([string][
|
|
1028
|
+
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|strict locator.
|
|
1026
1029
|
|
|
1027
|
-
Returns **[Promise][
|
|
1030
|
+
Returns **[Promise][6]<[number][12]>** number of visible elements
|
|
1028
1031
|
|
|
1029
1032
|
### grabAttributeFrom
|
|
1030
1033
|
|
|
@@ -1040,10 +1043,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
1040
1043
|
|
|
1041
1044
|
#### Parameters
|
|
1042
1045
|
|
|
1043
|
-
- `locator` **([string][
|
|
1044
|
-
- `attr` **[string][
|
|
1046
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
1047
|
+
- `attr` **[string][5]** attribute name.
|
|
1045
1048
|
|
|
1046
|
-
Returns **[Promise][
|
|
1049
|
+
Returns **[Promise][6]<[string][5]>** attribute value
|
|
1047
1050
|
|
|
1048
1051
|
### grabAttributeFromAll
|
|
1049
1052
|
|
|
@@ -1057,10 +1060,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1057
1060
|
|
|
1058
1061
|
#### Parameters
|
|
1059
1062
|
|
|
1060
|
-
- `locator` **([string][
|
|
1061
|
-
- `attr` **[string][
|
|
1063
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
1064
|
+
- `attr` **[string][5]** attribute name.
|
|
1062
1065
|
|
|
1063
|
-
Returns **[Promise][
|
|
1066
|
+
Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value
|
|
1064
1067
|
|
|
1065
1068
|
### grabValueFromAll
|
|
1066
1069
|
|
|
@@ -1073,9 +1076,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1073
1076
|
|
|
1074
1077
|
#### Parameters
|
|
1075
1078
|
|
|
1076
|
-
- `locator` **([string][
|
|
1079
|
+
- `locator` **([string][5] \| [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
1077
1080
|
|
|
1078
|
-
Returns **[Promise][
|
|
1081
|
+
Returns **[Promise][6]<[Array][8]<[string][5]>>** attribute value
|
|
1079
1082
|
|
|
1080
1083
|
### grabValueFrom
|
|
1081
1084
|
|
|
@@ -1089,9 +1092,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1089
1092
|
|
|
1090
1093
|
#### Parameters
|
|
1091
1094
|
|
|
1092
|
-
- `locator` **([string][
|
|
1095
|
+
- `locator` **([string][5] \| [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
1093
1096
|
|
|
1094
|
-
Returns **[Promise][
|
|
1097
|
+
Returns **[Promise][6]<[string][5]>** attribute value
|
|
1095
1098
|
|
|
1096
1099
|
### saveScreenshot
|
|
1097
1100
|
|
|
@@ -1104,9 +1107,9 @@ I.saveScreenshot('debug.png');
|
|
|
1104
1107
|
|
|
1105
1108
|
#### Parameters
|
|
1106
1109
|
|
|
1107
|
-
- `fileName` **[string][
|
|
1110
|
+
- `fileName` **[string][5]** file name to save.
|
|
1108
1111
|
|
|
1109
|
-
Returns **[Promise][
|
|
1112
|
+
Returns **[Promise][6]<void>**
|
|
1110
1113
|
|
|
1111
1114
|
### scrollIntoView
|
|
1112
1115
|
|
|
@@ -1120,8 +1123,8 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1120
1123
|
|
|
1121
1124
|
#### Parameters
|
|
1122
1125
|
|
|
1123
|
-
- `locator` **([string][
|
|
1124
|
-
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][
|
|
1126
|
+
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|strict locator.
|
|
1127
|
+
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][17].
|
|
1125
1128
|
⚠️ returns a _promise_ which is synchronized internally by recorderSupported only for web testing
|
|
1126
1129
|
|
|
1127
1130
|
### seeCheckboxIsChecked
|
|
@@ -1136,7 +1139,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1136
1139
|
|
|
1137
1140
|
#### Parameters
|
|
1138
1141
|
|
|
1139
|
-
- `field` **([string][
|
|
1142
|
+
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
1140
1143
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1141
1144
|
|
|
1142
1145
|
### seeElement
|
|
@@ -1150,7 +1153,7 @@ I.seeElement('#modal');
|
|
|
1150
1153
|
|
|
1151
1154
|
#### Parameters
|
|
1152
1155
|
|
|
1153
|
-
- `locator` **([string][
|
|
1156
|
+
- `locator` **([string][5] \| [object][10])** located by CSS|XPath|strict locator.
|
|
1154
1157
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1155
1158
|
|
|
1156
1159
|
### seeInField
|
|
@@ -1167,8 +1170,8 @@ I.seeInField('#searchform input','Search');
|
|
|
1167
1170
|
|
|
1168
1171
|
#### Parameters
|
|
1169
1172
|
|
|
1170
|
-
- `field` **([string][
|
|
1171
|
-
- `value` **[string][
|
|
1173
|
+
- `field` **([string][5] \| [object][10])** located by label|name|CSS|XPath|strict locator.
|
|
1174
|
+
- `value` **[string][5]** value to check.
|
|
1172
1175
|
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1173
1176
|
|
|
1174
1177
|
### see
|
|
@@ -1184,8 +1187,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1184
1187
|
|
|
1185
1188
|
#### Parameters
|
|
1186
1189
|
|
|
1187
|
-
- `text` **[string][
|
|
1188
|
-
- `context` **([string][
|
|
1190
|
+
- `text` **[string][5]** expected on page.
|
|
1191
|
+
- `context` **([string][5]? | [object][10])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1189
1192
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1190
1193
|
|
|
1191
1194
|
### selectOption
|
|
@@ -1211,8 +1214,8 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1211
1214
|
|
|
1212
1215
|
#### Parameters
|
|
1213
1216
|
|
|
1214
|
-
- `select` **([string][
|
|
1215
|
-
- `option` **([string][
|
|
1217
|
+
- `select` **([string][5] \| [object][10])** field located by label|name|CSS|XPath|strict locator.
|
|
1218
|
+
- `option` **([string][5] \| [Array][8]<any>)** visible text or value of option.
|
|
1216
1219
|
⚠️ returns a _promise_ which is synchronized internally by recorderSupported only for web testing
|
|
1217
1220
|
|
|
1218
1221
|
### waitForElement
|
|
@@ -1227,8 +1230,8 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1227
1230
|
|
|
1228
1231
|
#### Parameters
|
|
1229
1232
|
|
|
1230
|
-
- `locator` **([string][
|
|
1231
|
-
- `sec` **[number][
|
|
1233
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
1234
|
+
- `sec` **[number][12]?** (optional, `1` by default) time in seconds to wait
|
|
1232
1235
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1233
1236
|
|
|
1234
1237
|
### waitForVisible
|
|
@@ -1242,8 +1245,8 @@ I.waitForVisible('#popup');
|
|
|
1242
1245
|
|
|
1243
1246
|
#### Parameters
|
|
1244
1247
|
|
|
1245
|
-
- `locator` **([string][
|
|
1246
|
-
- `sec` **[number][
|
|
1248
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
1249
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
1247
1250
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
|
|
1248
1251
|
|
|
1249
1252
|
### waitForInvisible
|
|
@@ -1257,8 +1260,8 @@ I.waitForInvisible('#popup');
|
|
|
1257
1260
|
|
|
1258
1261
|
#### Parameters
|
|
1259
1262
|
|
|
1260
|
-
- `locator` **([string][
|
|
1261
|
-
- `sec` **[number][
|
|
1263
|
+
- `locator` **([string][5] \| [object][10])** element located by CSS|XPath|strict locator.
|
|
1264
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait
|
|
1262
1265
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
|
|
1263
1266
|
|
|
1264
1267
|
### waitForText
|
|
@@ -1274,39 +1277,41 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1274
1277
|
|
|
1275
1278
|
#### Parameters
|
|
1276
1279
|
|
|
1277
|
-
- `text` **[string][
|
|
1278
|
-
- `sec` **[number][
|
|
1279
|
-
- `context` **([string][
|
|
1280
|
+
- `text` **[string][5]** to wait for.
|
|
1281
|
+
- `sec` **[number][12]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
|
|
1282
|
+
- `context` **([string][5] \| [object][10])?** (optional) element located by CSS|XPath|strict locator.
|
|
1280
1283
|
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1281
1284
|
|
|
1282
1285
|
[1]: http://codecept.io/helpers/WebDriver/
|
|
1283
1286
|
|
|
1284
1287
|
[2]: http://appium.io/
|
|
1285
1288
|
|
|
1286
|
-
[3]: https://
|
|
1289
|
+
[3]: https://codecept.io/mobile/#setting-up
|
|
1290
|
+
|
|
1291
|
+
[4]: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
|
|
1287
1292
|
|
|
1288
|
-
[
|
|
1293
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1289
1294
|
|
|
1290
|
-
[
|
|
1295
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1291
1296
|
|
|
1292
|
-
[
|
|
1297
|
+
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1293
1298
|
|
|
1294
|
-
[
|
|
1299
|
+
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1295
1300
|
|
|
1296
|
-
[
|
|
1301
|
+
[9]: http://webdriver.io/api/mobile/setNetworkConnection.html
|
|
1297
1302
|
|
|
1298
|
-
[
|
|
1303
|
+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1299
1304
|
|
|
1300
|
-
[
|
|
1305
|
+
[11]: https://developer.android.com/reference/android/view/KeyEvent.html
|
|
1301
1306
|
|
|
1302
|
-
[
|
|
1307
|
+
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1303
1308
|
|
|
1304
|
-
[
|
|
1309
|
+
[13]: http://webdriver.io/api/mobile/touchAction.html
|
|
1305
1310
|
|
|
1306
|
-
[
|
|
1311
|
+
[14]: http://webdriver.io/api/mobile/swipe.html
|
|
1307
1312
|
|
|
1308
|
-
[
|
|
1313
|
+
[15]: http://webdriver.io/api/mobile/rotate.html
|
|
1309
1314
|
|
|
1310
|
-
[
|
|
1315
|
+
[16]: http://webdriver.io/api/mobile/setImmediateValue.html
|
|
1311
1316
|
|
|
1312
|
-
[
|
|
1317
|
+
[17]: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
|