codeceptjs 3.5.5 → 3.5.7-beta.1
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 +63 -0
- package/docs/bdd.md +11 -7
- package/docs/build/ApiDataFactory.js +2 -1
- package/docs/build/Appium.js +25 -23
- package/docs/build/Expect.js +422 -0
- package/docs/build/FileSystem.js +1 -1
- package/docs/build/Nightmare.js +53 -56
- package/docs/build/Playwright.js +209 -135
- package/docs/build/Protractor.js +66 -69
- package/docs/build/Puppeteer.js +83 -83
- package/docs/build/TestCafe.js +56 -55
- package/docs/build/WebDriver.js +85 -86
- package/docs/changelog.md +63 -0
- package/docs/commands.md +12 -0
- package/docs/helpers/Appium.md +50 -32
- package/docs/helpers/Expect.md +275 -0
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/Nightmare.md +141 -94
- package/docs/helpers/Playwright.md +281 -212
- package/docs/helpers/Protractor.md +229 -169
- package/docs/helpers/Puppeteer.md +257 -186
- package/docs/helpers/TestCafe.md +201 -149
- package/docs/helpers/WebDriver.md +253 -179
- package/docs/mobile.md +17 -21
- package/docs/plugins.md +35 -1
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/blur.mustache +1 -0
- 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 +0 -2
- package/docs/webapi/executeScript.mustache +0 -2
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/focus.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/grabCookie.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/ai.js +12 -3
- package/lib/cli.js +3 -1
- package/lib/codecept.js +3 -0
- package/lib/command/dryRun.js +2 -1
- package/lib/command/info.js +24 -0
- package/lib/command/run-workers.js +3 -2
- package/lib/command/run.js +3 -2
- package/lib/data/context.js +14 -6
- package/lib/helper/ApiDataFactory.js +2 -1
- package/lib/helper/Appium.js +7 -5
- package/lib/helper/Expect.js +422 -0
- package/lib/helper/FileSystem.js +1 -1
- package/lib/helper/Playwright.js +134 -64
- package/lib/helper/Puppeteer.js +6 -6
- package/lib/helper/WebDriver.js +4 -4
- package/lib/helper/scripts/highlightElement.js +1 -1
- package/lib/html.js +3 -3
- package/lib/interfaces/gherkin.js +21 -2
- package/lib/output.js +1 -1
- package/lib/pause.js +6 -5
- package/lib/plugin/autoLogin.js +35 -8
- package/lib/plugin/heal.js +40 -7
- package/lib/plugin/retryTo.js +0 -2
- package/lib/plugin/tryTo.js +0 -3
- package/lib/recorder.js +12 -5
- package/lib/session.js +1 -1
- package/package.json +24 -17
- package/translations/de-DE.js +5 -0
- package/translations/fr-FR.js +14 -1
- package/translations/it-IT.js +1 -0
- package/translations/ja-JP.js +5 -0
- package/translations/pl-PL.js +5 -0
- package/translations/pt-BR.js +1 -0
- package/translations/ru-RU.js +1 -0
- package/translations/zh-CN.js +5 -0
- package/translations/zh-TW.js +5 -0
- package/typings/promiseBasedTypes.d.ts +905 -863
- package/typings/types.d.ts +909 -850
|
@@ -193,7 +193,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
193
193
|
|
|
194
194
|
- `url` **[string][9]** url path or global url.
|
|
195
195
|
|
|
196
|
-
Returns **void
|
|
196
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
197
197
|
|
|
198
198
|
### amOutsideAngularApp
|
|
199
199
|
|
|
@@ -213,9 +213,10 @@ I.appendField('password', secret('123456'));
|
|
|
213
213
|
|
|
214
214
|
#### Parameters
|
|
215
215
|
|
|
216
|
-
- `field` **([string][9] | [object][
|
|
216
|
+
- `field` **([string][9] | [object][11])** located by label|name|CSS|XPath|strict locator
|
|
217
217
|
- `value` **[string][9]** text value to append.
|
|
218
|
-
|
|
218
|
+
|
|
219
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
219
220
|
|
|
220
221
|
### attachFile
|
|
221
222
|
|
|
@@ -230,9 +231,10 @@ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
|
|
|
230
231
|
|
|
231
232
|
#### Parameters
|
|
232
233
|
|
|
233
|
-
- `locator` **([string][9] | [object][
|
|
234
|
+
- `locator` **([string][9] | [object][11])** field located by label|name|CSS|XPath|strict locator.
|
|
234
235
|
- `pathToFile` **[string][9]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
235
|
-
|
|
236
|
+
|
|
237
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
236
238
|
|
|
237
239
|
### cancelPopup
|
|
238
240
|
|
|
@@ -253,9 +255,10 @@ I.checkOption('agree', '//form');
|
|
|
253
255
|
|
|
254
256
|
#### Parameters
|
|
255
257
|
|
|
256
|
-
- `field` **([string][9] | [object][
|
|
257
|
-
- `context` **([string][9]? | [object][
|
|
258
|
-
|
|
258
|
+
- `field` **([string][9] | [object][11])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
259
|
+
- `context` **([string][9]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
260
|
+
|
|
261
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
259
262
|
|
|
260
263
|
### clearCookie
|
|
261
264
|
|
|
@@ -269,8 +272,9 @@ I.clearCookie('test');
|
|
|
269
272
|
|
|
270
273
|
#### Parameters
|
|
271
274
|
|
|
272
|
-
- `cookie` **[string][9]?** (optional, `null` by default) cookie name
|
|
273
|
-
|
|
275
|
+
- `cookie` **[string][9]?** (optional, `null` by default) cookie name
|
|
276
|
+
|
|
277
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
274
278
|
|
|
275
279
|
### clearField
|
|
276
280
|
|
|
@@ -285,8 +289,9 @@ I.clearField('#email');
|
|
|
285
289
|
#### Parameters
|
|
286
290
|
|
|
287
291
|
- `field`
|
|
288
|
-
- `editable` **([string][9] | [object][
|
|
289
|
-
|
|
292
|
+
- `editable` **([string][9] | [object][11])** field located by label|name|CSS|XPath|strict locator.
|
|
293
|
+
|
|
294
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder.
|
|
290
295
|
|
|
291
296
|
### click
|
|
292
297
|
|
|
@@ -314,9 +319,10 @@ I.click({css: 'nav a.login'});
|
|
|
314
319
|
|
|
315
320
|
#### Parameters
|
|
316
321
|
|
|
317
|
-
- `locator` **([string][9] | [object][
|
|
318
|
-
- `context` **([string][9]? | [object][
|
|
319
|
-
|
|
322
|
+
- `locator` **([string][9] | [object][11])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
323
|
+
- `context` **([string][9]? | [object][11] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
324
|
+
|
|
325
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
320
326
|
|
|
321
327
|
### closeCurrentTab
|
|
322
328
|
|
|
@@ -347,8 +353,9 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
347
353
|
#### Parameters
|
|
348
354
|
|
|
349
355
|
- `text` **[string][9]** which is not present.
|
|
350
|
-
- `context` **([string][9] | [object][
|
|
351
|
-
|
|
356
|
+
- `context` **([string][9] | [object][11])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
357
|
+
|
|
358
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
352
359
|
|
|
353
360
|
### dontSeeCheckboxIsChecked
|
|
354
361
|
|
|
@@ -362,8 +369,9 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
362
369
|
|
|
363
370
|
#### Parameters
|
|
364
371
|
|
|
365
|
-
- `field` **([string][9] | [object][
|
|
366
|
-
|
|
372
|
+
- `field` **([string][9] | [object][11])** located by label|name|CSS|XPath|strict locator.
|
|
373
|
+
|
|
374
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
367
375
|
|
|
368
376
|
### dontSeeCookie
|
|
369
377
|
|
|
@@ -376,7 +384,8 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
376
384
|
#### Parameters
|
|
377
385
|
|
|
378
386
|
- `name` **[string][9]** cookie name.
|
|
379
|
-
|
|
387
|
+
|
|
388
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
380
389
|
|
|
381
390
|
### dontSeeCurrentUrlEquals
|
|
382
391
|
|
|
@@ -391,7 +400,8 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
391
400
|
#### Parameters
|
|
392
401
|
|
|
393
402
|
- `url` **[string][9]** value to check.
|
|
394
|
-
|
|
403
|
+
|
|
404
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
395
405
|
|
|
396
406
|
### dontSeeElement
|
|
397
407
|
|
|
@@ -403,8 +413,9 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
403
413
|
|
|
404
414
|
#### Parameters
|
|
405
415
|
|
|
406
|
-
- `locator` **([string][9] | [object][
|
|
407
|
-
|
|
416
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|Strict locator.
|
|
417
|
+
|
|
418
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
408
419
|
|
|
409
420
|
### dontSeeElementInDOM
|
|
410
421
|
|
|
@@ -416,8 +427,9 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
416
427
|
|
|
417
428
|
#### Parameters
|
|
418
429
|
|
|
419
|
-
- `locator` **([string][9] | [object][
|
|
420
|
-
|
|
430
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|Strict locator.
|
|
431
|
+
|
|
432
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
421
433
|
|
|
422
434
|
### dontSeeInCurrentUrl
|
|
423
435
|
|
|
@@ -426,7 +438,8 @@ Checks that current url does not contain a provided fragment.
|
|
|
426
438
|
#### Parameters
|
|
427
439
|
|
|
428
440
|
- `url` **[string][9]** value to check.
|
|
429
|
-
|
|
441
|
+
|
|
442
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
430
443
|
|
|
431
444
|
### dontSeeInField
|
|
432
445
|
|
|
@@ -440,9 +453,10 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
440
453
|
|
|
441
454
|
#### Parameters
|
|
442
455
|
|
|
443
|
-
- `field` **([string][9] | [object][
|
|
444
|
-
- `value` **([string][9] | [object][
|
|
445
|
-
|
|
456
|
+
- `field` **([string][9] | [object][11])** located by label|name|CSS|XPath|strict locator.
|
|
457
|
+
- `value` **([string][9] | [object][11])** value to check.
|
|
458
|
+
|
|
459
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
446
460
|
|
|
447
461
|
### dontSeeInSource
|
|
448
462
|
|
|
@@ -456,7 +470,8 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
456
470
|
|
|
457
471
|
- `text`
|
|
458
472
|
- `value` **[string][9]** to check.
|
|
459
|
-
|
|
473
|
+
|
|
474
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
460
475
|
|
|
461
476
|
### dontSeeInTitle
|
|
462
477
|
|
|
@@ -469,7 +484,8 @@ I.dontSeeInTitle('Error');
|
|
|
469
484
|
#### Parameters
|
|
470
485
|
|
|
471
486
|
- `text` **[string][9]** value to check.
|
|
472
|
-
|
|
487
|
+
|
|
488
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
473
489
|
|
|
474
490
|
### doubleClick
|
|
475
491
|
|
|
@@ -485,9 +501,10 @@ I.doubleClick('.btn.edit');
|
|
|
485
501
|
|
|
486
502
|
#### Parameters
|
|
487
503
|
|
|
488
|
-
- `locator` **([string][9] | [object][
|
|
489
|
-
- `context` **([string][9]? | [object][
|
|
490
|
-
|
|
504
|
+
- `locator` **([string][9] | [object][11])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
505
|
+
- `context` **([string][9]? | [object][11])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
506
|
+
|
|
507
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
491
508
|
|
|
492
509
|
### dragAndDrop
|
|
493
510
|
|
|
@@ -499,16 +516,17 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
499
516
|
|
|
500
517
|
#### Parameters
|
|
501
518
|
|
|
502
|
-
- `srcElement` **([string][9] | [object][
|
|
503
|
-
- `destElement` **([string][9] | [object][
|
|
504
|
-
|
|
519
|
+
- `srcElement` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
520
|
+
- `destElement` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
521
|
+
|
|
522
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
505
523
|
|
|
506
524
|
### executeAsyncScript
|
|
507
525
|
|
|
508
526
|
Executes async script on page.
|
|
509
527
|
Provided function should execute a passed callback (as first argument) to signal it is finished.
|
|
510
528
|
|
|
511
|
-
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][
|
|
529
|
+
Example: In Vue.js to make components completely rendered we are waiting for [nextTick][12].
|
|
512
530
|
|
|
513
531
|
```js
|
|
514
532
|
I.executeAsyncScript(function(done) {
|
|
@@ -528,10 +546,10 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
528
546
|
|
|
529
547
|
#### Parameters
|
|
530
548
|
|
|
531
|
-
- `fn` **([string][9] | [function][
|
|
549
|
+
- `fn` **([string][9] | [function][13])** function to be executed in browser context.
|
|
532
550
|
- `args` **...any** to be passed to function.
|
|
533
551
|
|
|
534
|
-
Returns **[Promise][
|
|
552
|
+
Returns **[Promise][10]<any>** script return value
|
|
535
553
|
|
|
536
554
|
### executeScript
|
|
537
555
|
|
|
@@ -561,10 +579,10 @@ let date = await I.executeScript(function(el) {
|
|
|
561
579
|
|
|
562
580
|
#### Parameters
|
|
563
581
|
|
|
564
|
-
- `fn` **([string][9] | [function][
|
|
582
|
+
- `fn` **([string][9] | [function][13])** function to be executed in browser context.
|
|
565
583
|
- `args` **...any** to be passed to function.
|
|
566
584
|
|
|
567
|
-
Returns **[Promise][
|
|
585
|
+
Returns **[Promise][10]<any>** script return value
|
|
568
586
|
|
|
569
587
|
### fillField
|
|
570
588
|
|
|
@@ -584,9 +602,10 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
584
602
|
|
|
585
603
|
#### Parameters
|
|
586
604
|
|
|
587
|
-
- `field` **([string][9] | [object][
|
|
588
|
-
- `value` **([string][9] | [object][
|
|
589
|
-
|
|
605
|
+
- `field` **([string][9] | [object][11])** located by label|name|CSS|XPath|strict locator.
|
|
606
|
+
- `value` **([string][9] | [object][11])** text value to fill.
|
|
607
|
+
|
|
608
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
590
609
|
|
|
591
610
|
### grabAttributeFrom
|
|
592
611
|
|
|
@@ -600,10 +619,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
600
619
|
|
|
601
620
|
#### Parameters
|
|
602
621
|
|
|
603
|
-
- `locator` **([string][9] | [object][
|
|
622
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
604
623
|
- `attr` **[string][9]** attribute name.
|
|
605
624
|
|
|
606
|
-
Returns **[Promise][
|
|
625
|
+
Returns **[Promise][10]<[string][9]>** attribute value
|
|
607
626
|
|
|
608
627
|
### grabAttributeFromAll
|
|
609
628
|
|
|
@@ -616,10 +635,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
616
635
|
|
|
617
636
|
#### Parameters
|
|
618
637
|
|
|
619
|
-
- `locator` **([string][9] | [object][
|
|
638
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
620
639
|
- `attr` **[string][9]** attribute name.
|
|
621
640
|
|
|
622
|
-
Returns **[Promise][
|
|
641
|
+
Returns **[Promise][10]<[Array][14]<[string][9]>>** attribute value
|
|
623
642
|
|
|
624
643
|
### grabBrowserLogs
|
|
625
644
|
|
|
@@ -631,7 +650,7 @@ let logs = await I.grabBrowserLogs();
|
|
|
631
650
|
console.log(JSON.stringify(logs))
|
|
632
651
|
```
|
|
633
652
|
|
|
634
|
-
Returns **([Promise][
|
|
653
|
+
Returns **([Promise][10]<[Array][14]<[object][11]>> | [undefined][15])** all browser logs
|
|
635
654
|
|
|
636
655
|
### grabCookie
|
|
637
656
|
|
|
@@ -648,7 +667,7 @@ assert(cookie.value, '123456');
|
|
|
648
667
|
|
|
649
668
|
- `name` **[string][9]?** cookie name.
|
|
650
669
|
|
|
651
|
-
Returns **
|
|
670
|
+
Returns **any** attribute valueReturns cookie in JSON [format][16].
|
|
652
671
|
|
|
653
672
|
### grabCssPropertyFrom
|
|
654
673
|
|
|
@@ -662,10 +681,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
662
681
|
|
|
663
682
|
#### Parameters
|
|
664
683
|
|
|
665
|
-
- `locator` **([string][9] | [object][
|
|
684
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
666
685
|
- `cssProperty` **[string][9]** CSS property name.
|
|
667
686
|
|
|
668
|
-
Returns **[Promise][
|
|
687
|
+
Returns **[Promise][10]<[string][9]>** CSS value
|
|
669
688
|
|
|
670
689
|
### grabCssPropertyFromAll
|
|
671
690
|
|
|
@@ -678,10 +697,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
678
697
|
|
|
679
698
|
#### Parameters
|
|
680
699
|
|
|
681
|
-
- `locator` **([string][9] | [object][
|
|
700
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
682
701
|
- `cssProperty` **[string][9]** CSS property name.
|
|
683
702
|
|
|
684
|
-
Returns **[Promise][
|
|
703
|
+
Returns **[Promise][10]<[Array][14]<[string][9]>>** CSS value
|
|
685
704
|
|
|
686
705
|
### grabCurrentUrl
|
|
687
706
|
|
|
@@ -693,7 +712,7 @@ let url = await I.grabCurrentUrl();
|
|
|
693
712
|
console.log(`Current URL is [${url}]`);
|
|
694
713
|
```
|
|
695
714
|
|
|
696
|
-
Returns **[Promise][
|
|
715
|
+
Returns **[Promise][10]<[string][9]>** current URL
|
|
697
716
|
|
|
698
717
|
### grabHTMLFrom
|
|
699
718
|
|
|
@@ -708,9 +727,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
708
727
|
#### Parameters
|
|
709
728
|
|
|
710
729
|
- `locator`
|
|
711
|
-
- `element` **([string][9] | [object][
|
|
730
|
+
- `element` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
712
731
|
|
|
713
|
-
Returns **[Promise][
|
|
732
|
+
Returns **[Promise][10]<[string][9]>** HTML code for an element
|
|
714
733
|
|
|
715
734
|
### grabHTMLFromAll
|
|
716
735
|
|
|
@@ -724,9 +743,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
724
743
|
#### Parameters
|
|
725
744
|
|
|
726
745
|
- `locator`
|
|
727
|
-
- `element` **([string][9] | [object][
|
|
746
|
+
- `element` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
728
747
|
|
|
729
|
-
Returns **[Promise][
|
|
748
|
+
Returns **[Promise][10]<[Array][14]<[string][9]>>** HTML code for an element
|
|
730
749
|
|
|
731
750
|
### grabNumberOfOpenTabs
|
|
732
751
|
|
|
@@ -737,7 +756,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
737
756
|
let tabs = await I.grabNumberOfOpenTabs();
|
|
738
757
|
```
|
|
739
758
|
|
|
740
|
-
Returns **[Promise][
|
|
759
|
+
Returns **[Promise][10]<[number][7]>** number of open tabs
|
|
741
760
|
|
|
742
761
|
### grabNumberOfVisibleElements
|
|
743
762
|
|
|
@@ -750,9 +769,9 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
750
769
|
|
|
751
770
|
#### Parameters
|
|
752
771
|
|
|
753
|
-
- `locator` **([string][9] | [object][
|
|
772
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
754
773
|
|
|
755
|
-
Returns **[Promise][
|
|
774
|
+
Returns **[Promise][10]<[number][7]>** number of visible elements
|
|
756
775
|
|
|
757
776
|
### grabPageScrollPosition
|
|
758
777
|
|
|
@@ -763,7 +782,7 @@ Resumes test execution, so **should be used inside an async function with `await
|
|
|
763
782
|
let { x, y } = await I.grabPageScrollPosition();
|
|
764
783
|
```
|
|
765
784
|
|
|
766
|
-
Returns **[Promise][
|
|
785
|
+
Returns **[Promise][10]<PageScrollPosition>** scroll position
|
|
767
786
|
|
|
768
787
|
### grabPopupText
|
|
769
788
|
|
|
@@ -782,7 +801,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
782
801
|
let pageSource = await I.grabSource();
|
|
783
802
|
```
|
|
784
803
|
|
|
785
|
-
Returns **[Promise][
|
|
804
|
+
Returns **[Promise][10]<[string][9]>** source code
|
|
786
805
|
|
|
787
806
|
### grabTextFrom
|
|
788
807
|
|
|
@@ -797,9 +816,9 @@ If multiple elements found returns first element.
|
|
|
797
816
|
|
|
798
817
|
#### Parameters
|
|
799
818
|
|
|
800
|
-
- `locator` **([string][9] | [object][
|
|
819
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
801
820
|
|
|
802
|
-
Returns **[Promise][
|
|
821
|
+
Returns **[Promise][10]<[string][9]>** attribute value
|
|
803
822
|
|
|
804
823
|
### grabTextFromAll
|
|
805
824
|
|
|
@@ -812,9 +831,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
812
831
|
|
|
813
832
|
#### Parameters
|
|
814
833
|
|
|
815
|
-
- `locator` **([string][9] | [object][
|
|
834
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
816
835
|
|
|
817
|
-
Returns **[Promise][
|
|
836
|
+
Returns **[Promise][10]<[Array][14]<[string][9]>>** attribute value
|
|
818
837
|
|
|
819
838
|
### grabTitle
|
|
820
839
|
|
|
@@ -825,7 +844,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
825
844
|
let title = await I.grabTitle();
|
|
826
845
|
```
|
|
827
846
|
|
|
828
|
-
Returns **[Promise][
|
|
847
|
+
Returns **[Promise][10]<[string][9]>** title
|
|
829
848
|
|
|
830
849
|
### grabValueFrom
|
|
831
850
|
|
|
@@ -839,9 +858,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
839
858
|
|
|
840
859
|
#### Parameters
|
|
841
860
|
|
|
842
|
-
- `locator` **([string][9] | [object][
|
|
861
|
+
- `locator` **([string][9] | [object][11])** field located by label|name|CSS|XPath|strict locator.
|
|
843
862
|
|
|
844
|
-
Returns **[Promise][
|
|
863
|
+
Returns **[Promise][10]<[string][9]>** attribute value
|
|
845
864
|
|
|
846
865
|
### grabValueFromAll
|
|
847
866
|
|
|
@@ -854,9 +873,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
854
873
|
|
|
855
874
|
#### Parameters
|
|
856
875
|
|
|
857
|
-
- `locator` **([string][9] | [object][
|
|
876
|
+
- `locator` **([string][9] | [object][11])** field located by label|name|CSS|XPath|strict locator.
|
|
858
877
|
|
|
859
|
-
Returns **[Promise][
|
|
878
|
+
Returns **[Promise][10]<[Array][14]<[string][9]>>** attribute value
|
|
860
879
|
|
|
861
880
|
### haveModule
|
|
862
881
|
|
|
@@ -885,10 +904,11 @@ I.moveCursorTo('#submit', 5,5);
|
|
|
885
904
|
|
|
886
905
|
#### Parameters
|
|
887
906
|
|
|
888
|
-
- `locator` **([string][9] | [object][
|
|
907
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
889
908
|
- `offsetX` **[number][7]** (optional, `0` by default) X-axis offset.
|
|
890
|
-
- `offsetY` **[number][7]** (optional, `0` by default) Y-axis offset.
|
|
891
|
-
|
|
909
|
+
- `offsetY` **[number][7]** (optional, `0` by default) Y-axis offset.
|
|
910
|
+
|
|
911
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
892
912
|
|
|
893
913
|
### moveTo
|
|
894
914
|
|
|
@@ -921,7 +941,8 @@ I.pressKey(['Control','a']);
|
|
|
921
941
|
#### Parameters
|
|
922
942
|
|
|
923
943
|
- `key` **([string][9] | [Array][14]<[string][9]>)** key or array of keys to press.
|
|
924
|
-
|
|
944
|
+
|
|
945
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
925
946
|
|
|
926
947
|
|
|
927
948
|
[Valid key names](https://w3c.github.io/webdriver/#keyboard-actions) are:
|
|
@@ -968,7 +989,7 @@ Reload the current page.
|
|
|
968
989
|
I.refreshPage();
|
|
969
990
|
```
|
|
970
991
|
|
|
971
|
-
|
|
992
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
972
993
|
|
|
973
994
|
### resetModule
|
|
974
995
|
|
|
@@ -992,7 +1013,8 @@ First parameter can be set to `maximize`.
|
|
|
992
1013
|
|
|
993
1014
|
- `width` **[number][7]** width in pixels or `maximize`.
|
|
994
1015
|
- `height` **[number][7]** height in pixels.
|
|
995
|
-
|
|
1016
|
+
|
|
1017
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
996
1018
|
|
|
997
1019
|
### rightClick
|
|
998
1020
|
|
|
@@ -1009,9 +1031,10 @@ I.rightClick('Click me', '.context');
|
|
|
1009
1031
|
|
|
1010
1032
|
#### Parameters
|
|
1011
1033
|
|
|
1012
|
-
- `locator` **([string][9] | [object][
|
|
1013
|
-
- `context` **([string][9]? | [object][
|
|
1014
|
-
|
|
1034
|
+
- `locator` **([string][9] | [object][11])** clickable element located by CSS|XPath|strict locator.
|
|
1035
|
+
- `context` **([string][9]? | [object][11])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1036
|
+
|
|
1037
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1015
1038
|
|
|
1016
1039
|
### saveElementScreenshot
|
|
1017
1040
|
|
|
@@ -1024,9 +1047,10 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1024
1047
|
|
|
1025
1048
|
#### Parameters
|
|
1026
1049
|
|
|
1027
|
-
- `locator` **([string][9] | [object][
|
|
1050
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1028
1051
|
- `fileName` **[string][9]** file name to save.
|
|
1029
|
-
|
|
1052
|
+
|
|
1053
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1030
1054
|
|
|
1031
1055
|
### saveScreenshot
|
|
1032
1056
|
|
|
@@ -1042,8 +1066,9 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1042
1066
|
#### Parameters
|
|
1043
1067
|
|
|
1044
1068
|
- `fileName` **[string][9]** file name to save.
|
|
1045
|
-
- `fullPage` **[boolean][18]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1046
|
-
|
|
1069
|
+
- `fullPage` **[boolean][18]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1070
|
+
|
|
1071
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1047
1072
|
|
|
1048
1073
|
### scrollPageToBottom
|
|
1049
1074
|
|
|
@@ -1053,7 +1078,7 @@ Scroll page to the bottom.
|
|
|
1053
1078
|
I.scrollPageToBottom();
|
|
1054
1079
|
```
|
|
1055
1080
|
|
|
1056
|
-
|
|
1081
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1057
1082
|
|
|
1058
1083
|
### scrollPageToTop
|
|
1059
1084
|
|
|
@@ -1063,7 +1088,7 @@ Scroll page to the top.
|
|
|
1063
1088
|
I.scrollPageToTop();
|
|
1064
1089
|
```
|
|
1065
1090
|
|
|
1066
|
-
|
|
1091
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1067
1092
|
|
|
1068
1093
|
### scrollTo
|
|
1069
1094
|
|
|
@@ -1077,10 +1102,11 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1077
1102
|
|
|
1078
1103
|
#### Parameters
|
|
1079
1104
|
|
|
1080
|
-
- `locator` **([string][9] | [object][
|
|
1105
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
1081
1106
|
- `offsetX` **[number][7]** (optional, `0` by default) X-axis offset.
|
|
1082
|
-
- `offsetY` **[number][7]** (optional, `0` by default) Y-axis offset.
|
|
1083
|
-
|
|
1107
|
+
- `offsetY` **[number][7]** (optional, `0` by default) Y-axis offset.
|
|
1108
|
+
|
|
1109
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1084
1110
|
|
|
1085
1111
|
### see
|
|
1086
1112
|
|
|
@@ -1096,8 +1122,9 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1096
1122
|
#### Parameters
|
|
1097
1123
|
|
|
1098
1124
|
- `text` **[string][9]** expected on page.
|
|
1099
|
-
- `context` **([string][9]? | [object][
|
|
1100
|
-
|
|
1125
|
+
- `context` **([string][9]? | [object][11])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1126
|
+
|
|
1127
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1101
1128
|
|
|
1102
1129
|
### seeAttributesOnElements
|
|
1103
1130
|
|
|
@@ -1109,9 +1136,10 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1109
1136
|
|
|
1110
1137
|
#### Parameters
|
|
1111
1138
|
|
|
1112
|
-
- `locator` **([string][9] | [object][
|
|
1113
|
-
- `attributes` **[object][
|
|
1114
|
-
|
|
1139
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
1140
|
+
- `attributes` **[object][11]** attributes and their values to check.
|
|
1141
|
+
|
|
1142
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1115
1143
|
|
|
1116
1144
|
### seeCheckboxIsChecked
|
|
1117
1145
|
|
|
@@ -1125,8 +1153,9 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1125
1153
|
|
|
1126
1154
|
#### Parameters
|
|
1127
1155
|
|
|
1128
|
-
- `field` **([string][9] | [object][
|
|
1129
|
-
|
|
1156
|
+
- `field` **([string][9] | [object][11])** located by label|name|CSS|XPath|strict locator.
|
|
1157
|
+
|
|
1158
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1130
1159
|
|
|
1131
1160
|
### seeCookie
|
|
1132
1161
|
|
|
@@ -1139,7 +1168,8 @@ I.seeCookie('Auth');
|
|
|
1139
1168
|
#### Parameters
|
|
1140
1169
|
|
|
1141
1170
|
- `name` **[string][9]** cookie name.
|
|
1142
|
-
|
|
1171
|
+
|
|
1172
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1143
1173
|
|
|
1144
1174
|
### seeCssPropertiesOnElements
|
|
1145
1175
|
|
|
@@ -1151,9 +1181,10 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1151
1181
|
|
|
1152
1182
|
#### Parameters
|
|
1153
1183
|
|
|
1154
|
-
- `locator` **([string][9] | [object][
|
|
1155
|
-
- `cssProperties` **[object][
|
|
1156
|
-
|
|
1184
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
1185
|
+
- `cssProperties` **[object][11]** object with CSS properties and their values to check.
|
|
1186
|
+
|
|
1187
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1157
1188
|
|
|
1158
1189
|
### seeCurrentUrlEquals
|
|
1159
1190
|
|
|
@@ -1169,7 +1200,8 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1169
1200
|
#### Parameters
|
|
1170
1201
|
|
|
1171
1202
|
- `url` **[string][9]** value to check.
|
|
1172
|
-
|
|
1203
|
+
|
|
1204
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1173
1205
|
|
|
1174
1206
|
### seeElement
|
|
1175
1207
|
|
|
@@ -1182,8 +1214,9 @@ I.seeElement('#modal');
|
|
|
1182
1214
|
|
|
1183
1215
|
#### Parameters
|
|
1184
1216
|
|
|
1185
|
-
- `locator` **([string][9] | [object][
|
|
1186
|
-
|
|
1217
|
+
- `locator` **([string][9] | [object][11])** located by CSS|XPath|strict locator.
|
|
1218
|
+
|
|
1219
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1187
1220
|
|
|
1188
1221
|
### seeElementInDOM
|
|
1189
1222
|
|
|
@@ -1196,8 +1229,9 @@ I.seeElementInDOM('#modal');
|
|
|
1196
1229
|
|
|
1197
1230
|
#### Parameters
|
|
1198
1231
|
|
|
1199
|
-
- `locator` **([string][9] | [object][
|
|
1200
|
-
|
|
1232
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1233
|
+
|
|
1234
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1201
1235
|
|
|
1202
1236
|
### seeInCurrentUrl
|
|
1203
1237
|
|
|
@@ -1210,7 +1244,8 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1210
1244
|
#### Parameters
|
|
1211
1245
|
|
|
1212
1246
|
- `url` **[string][9]** a fragment to check
|
|
1213
|
-
|
|
1247
|
+
|
|
1248
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1214
1249
|
|
|
1215
1250
|
### seeInField
|
|
1216
1251
|
|
|
@@ -1226,9 +1261,10 @@ I.seeInField('#searchform input','Search');
|
|
|
1226
1261
|
|
|
1227
1262
|
#### Parameters
|
|
1228
1263
|
|
|
1229
|
-
- `field` **([string][9] | [object][
|
|
1230
|
-
- `value` **([string][9] | [object][
|
|
1231
|
-
|
|
1264
|
+
- `field` **([string][9] | [object][11])** located by label|name|CSS|XPath|strict locator.
|
|
1265
|
+
- `value` **([string][9] | [object][11])** value to check.
|
|
1266
|
+
|
|
1267
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1232
1268
|
|
|
1233
1269
|
### seeInPopup
|
|
1234
1270
|
|
|
@@ -1242,7 +1278,8 @@ I.seeInPopup('Popup text');
|
|
|
1242
1278
|
#### Parameters
|
|
1243
1279
|
|
|
1244
1280
|
- `text` **[string][9]** value to check.
|
|
1245
|
-
|
|
1281
|
+
|
|
1282
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1246
1283
|
|
|
1247
1284
|
### seeInSource
|
|
1248
1285
|
|
|
@@ -1255,7 +1292,8 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1255
1292
|
#### Parameters
|
|
1256
1293
|
|
|
1257
1294
|
- `text` **[string][9]** value to check.
|
|
1258
|
-
|
|
1295
|
+
|
|
1296
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1259
1297
|
|
|
1260
1298
|
### seeInTitle
|
|
1261
1299
|
|
|
@@ -1268,7 +1306,8 @@ I.seeInTitle('Home Page');
|
|
|
1268
1306
|
#### Parameters
|
|
1269
1307
|
|
|
1270
1308
|
- `text` **[string][9]** text value to check.
|
|
1271
|
-
|
|
1309
|
+
|
|
1310
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1272
1311
|
|
|
1273
1312
|
### seeNumberOfElements
|
|
1274
1313
|
|
|
@@ -1281,9 +1320,10 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1281
1320
|
|
|
1282
1321
|
#### Parameters
|
|
1283
1322
|
|
|
1284
|
-
- `locator` **([string][9] | [object][
|
|
1323
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1285
1324
|
- `num` **[number][7]** number of elements.
|
|
1286
|
-
|
|
1325
|
+
|
|
1326
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1287
1327
|
|
|
1288
1328
|
### seeNumberOfVisibleElements
|
|
1289
1329
|
|
|
@@ -1296,9 +1336,10 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1296
1336
|
|
|
1297
1337
|
#### Parameters
|
|
1298
1338
|
|
|
1299
|
-
- `locator` **([string][9] | [object][
|
|
1339
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1300
1340
|
- `num` **[number][7]** number of elements.
|
|
1301
|
-
|
|
1341
|
+
|
|
1342
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1302
1343
|
|
|
1303
1344
|
### seeTextEquals
|
|
1304
1345
|
|
|
@@ -1311,8 +1352,9 @@ I.seeTextEquals('text', 'h1');
|
|
|
1311
1352
|
#### Parameters
|
|
1312
1353
|
|
|
1313
1354
|
- `text` **[string][9]** element value to check.
|
|
1314
|
-
- `context` **([string][9] | [object][
|
|
1315
|
-
|
|
1355
|
+
- `context` **([string][9] | [object][11])?** element located by CSS|XPath|strict locator.
|
|
1356
|
+
|
|
1357
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1316
1358
|
|
|
1317
1359
|
### seeTitleEquals
|
|
1318
1360
|
|
|
@@ -1325,7 +1367,8 @@ I.seeTitleEquals('Test title.');
|
|
|
1325
1367
|
#### Parameters
|
|
1326
1368
|
|
|
1327
1369
|
- `text` **[string][9]** value to check.
|
|
1328
|
-
|
|
1370
|
+
|
|
1371
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1329
1372
|
|
|
1330
1373
|
### selectOption
|
|
1331
1374
|
|
|
@@ -1350,9 +1393,10 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1350
1393
|
|
|
1351
1394
|
#### Parameters
|
|
1352
1395
|
|
|
1353
|
-
- `select` **([string][9] | [object][
|
|
1396
|
+
- `select` **([string][9] | [object][11])** field located by label|name|CSS|XPath|strict locator.
|
|
1354
1397
|
- `option` **([string][9] | [Array][14]<any>)** visible text or value of option.
|
|
1355
|
-
|
|
1398
|
+
|
|
1399
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1356
1400
|
|
|
1357
1401
|
### setCookie
|
|
1358
1402
|
|
|
@@ -1373,7 +1417,8 @@ I.setCookie([
|
|
|
1373
1417
|
#### Parameters
|
|
1374
1418
|
|
|
1375
1419
|
- `cookie` **(Cookie | [Array][14]<Cookie>)** a cookie object or array of cookie objects.
|
|
1376
|
-
|
|
1420
|
+
|
|
1421
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1377
1422
|
|
|
1378
1423
|
### switchTo
|
|
1379
1424
|
|
|
@@ -1386,8 +1431,9 @@ I.switchTo(); // switch back to main page
|
|
|
1386
1431
|
|
|
1387
1432
|
#### Parameters
|
|
1388
1433
|
|
|
1389
|
-
- `locator` **([string][9]? | [object][
|
|
1390
|
-
|
|
1434
|
+
- `locator` **([string][9]? | [object][11])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1435
|
+
|
|
1436
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1391
1437
|
|
|
1392
1438
|
### switchToNextTab
|
|
1393
1439
|
|
|
@@ -1430,9 +1476,10 @@ I.uncheckOption('agree', '//form');
|
|
|
1430
1476
|
|
|
1431
1477
|
#### Parameters
|
|
1432
1478
|
|
|
1433
|
-
- `field` **([string][9] | [object][
|
|
1434
|
-
- `context` **([string][9]? | [object][
|
|
1435
|
-
|
|
1479
|
+
- `field` **([string][9] | [object][11])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
1480
|
+
- `context` **([string][9]? | [object][11])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1481
|
+
|
|
1482
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1436
1483
|
|
|
1437
1484
|
### useProtractorTo
|
|
1438
1485
|
|
|
@@ -1452,7 +1499,7 @@ I.useProtractorTo('change url via in-page navigation', async ({ browser }) {
|
|
|
1452
1499
|
#### Parameters
|
|
1453
1500
|
|
|
1454
1501
|
- `description` **[string][9]** used to show in logs.
|
|
1455
|
-
- `fn` **[function][
|
|
1502
|
+
- `fn` **[function][13]** async functuion that executed with Protractor helper as argument
|
|
1456
1503
|
|
|
1457
1504
|
### wait
|
|
1458
1505
|
|
|
@@ -1465,7 +1512,8 @@ I.wait(2); // wait 2 secs
|
|
|
1465
1512
|
#### Parameters
|
|
1466
1513
|
|
|
1467
1514
|
- `sec` **[number][7]** number of second to wait.
|
|
1468
|
-
|
|
1515
|
+
|
|
1516
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1469
1517
|
|
|
1470
1518
|
### waitForClickable
|
|
1471
1519
|
|
|
@@ -1491,9 +1539,10 @@ I.waitForDetached('#popup');
|
|
|
1491
1539
|
|
|
1492
1540
|
#### Parameters
|
|
1493
1541
|
|
|
1494
|
-
- `locator` **([string][9] | [object][
|
|
1495
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1496
|
-
|
|
1542
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1543
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1544
|
+
|
|
1545
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1497
1546
|
|
|
1498
1547
|
### waitForElement
|
|
1499
1548
|
|
|
@@ -1507,9 +1556,10 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1507
1556
|
|
|
1508
1557
|
#### Parameters
|
|
1509
1558
|
|
|
1510
|
-
- `locator` **([string][9] | [object][
|
|
1511
|
-
- `sec` **[number][7]?** (optional, `1` by default) time in seconds to wait
|
|
1512
|
-
|
|
1559
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1560
|
+
- `sec` **[number][7]?** (optional, `1` by default) time in seconds to wait
|
|
1561
|
+
|
|
1562
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1513
1563
|
|
|
1514
1564
|
### waitForEnabled
|
|
1515
1565
|
|
|
@@ -1518,9 +1568,10 @@ Element can be located by CSS or XPath.
|
|
|
1518
1568
|
|
|
1519
1569
|
#### Parameters
|
|
1520
1570
|
|
|
1521
|
-
- `locator` **([string][9] | [object][
|
|
1522
|
-
- `sec` **[number][7]** (optional) time in seconds to wait, 1 by default.
|
|
1523
|
-
|
|
1571
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1572
|
+
- `sec` **[number][7]** (optional) time in seconds to wait, 1 by default.
|
|
1573
|
+
|
|
1574
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1524
1575
|
|
|
1525
1576
|
### waitForFunction
|
|
1526
1577
|
|
|
@@ -1539,10 +1590,11 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
1539
1590
|
|
|
1540
1591
|
#### Parameters
|
|
1541
1592
|
|
|
1542
|
-
- `fn` **([string][9] | [function][
|
|
1593
|
+
- `fn` **([string][9] | [function][13])** to be executed in browser context.
|
|
1543
1594
|
- `argsOrSec` **([Array][14]<any> | [number][7])?** (optional, `1` by default) arguments for function or seconds.
|
|
1544
|
-
- `sec` **[number][7]?** (optional, `1` by default) time in seconds to wait
|
|
1545
|
-
|
|
1595
|
+
- `sec` **[number][7]?** (optional, `1` by default) time in seconds to wait
|
|
1596
|
+
|
|
1597
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1546
1598
|
|
|
1547
1599
|
### waitForInvisible
|
|
1548
1600
|
|
|
@@ -1555,9 +1607,10 @@ I.waitForInvisible('#popup');
|
|
|
1555
1607
|
|
|
1556
1608
|
#### Parameters
|
|
1557
1609
|
|
|
1558
|
-
- `locator` **([string][9] | [object][
|
|
1559
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1560
|
-
|
|
1610
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1611
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1612
|
+
|
|
1613
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1561
1614
|
|
|
1562
1615
|
### waitForText
|
|
1563
1616
|
|
|
@@ -1574,8 +1627,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1574
1627
|
|
|
1575
1628
|
- `text` **[string][9]** to wait for.
|
|
1576
1629
|
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1577
|
-
- `context` **([string][9] | [object][
|
|
1578
|
-
|
|
1630
|
+
- `context` **([string][9] | [object][11])?** (optional) element located by CSS|XPath|strict locator.
|
|
1631
|
+
|
|
1632
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1579
1633
|
|
|
1580
1634
|
### waitForValue
|
|
1581
1635
|
|
|
@@ -1587,10 +1641,11 @@ I.waitForValue('//input', "GoodValue");
|
|
|
1587
1641
|
|
|
1588
1642
|
#### Parameters
|
|
1589
1643
|
|
|
1590
|
-
- `field` **([string][9] | [object][
|
|
1644
|
+
- `field` **([string][9] | [object][11])** input field.
|
|
1591
1645
|
- `value` **[string][9]** expected value.
|
|
1592
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1593
|
-
|
|
1646
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1647
|
+
|
|
1648
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1594
1649
|
|
|
1595
1650
|
### waitForVisible
|
|
1596
1651
|
|
|
@@ -1603,9 +1658,10 @@ I.waitForVisible('#popup');
|
|
|
1603
1658
|
|
|
1604
1659
|
#### Parameters
|
|
1605
1660
|
|
|
1606
|
-
- `locator` **([string][9] | [object][
|
|
1607
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1608
|
-
|
|
1661
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1662
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1663
|
+
|
|
1664
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1609
1665
|
|
|
1610
1666
|
### waitInUrl
|
|
1611
1667
|
|
|
@@ -1618,8 +1674,9 @@ I.waitInUrl('/info', 2);
|
|
|
1618
1674
|
#### Parameters
|
|
1619
1675
|
|
|
1620
1676
|
- `urlPart` **[string][9]** value to check.
|
|
1621
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1622
|
-
|
|
1677
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1678
|
+
|
|
1679
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1623
1680
|
|
|
1624
1681
|
### waitNumberOfVisibleElements
|
|
1625
1682
|
|
|
@@ -1631,10 +1688,11 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
1631
1688
|
|
|
1632
1689
|
#### Parameters
|
|
1633
1690
|
|
|
1634
|
-
- `locator` **([string][9] | [object][
|
|
1691
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1635
1692
|
- `num` **[number][7]** number of elements.
|
|
1636
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1637
|
-
|
|
1693
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1694
|
+
|
|
1695
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1638
1696
|
|
|
1639
1697
|
### waitToHide
|
|
1640
1698
|
|
|
@@ -1647,9 +1705,10 @@ I.waitToHide('#popup');
|
|
|
1647
1705
|
|
|
1648
1706
|
#### Parameters
|
|
1649
1707
|
|
|
1650
|
-
- `locator` **([string][9] | [object][
|
|
1651
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1652
|
-
|
|
1708
|
+
- `locator` **([string][9] | [object][11])** element located by CSS|XPath|strict locator.
|
|
1709
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1710
|
+
|
|
1711
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1653
1712
|
|
|
1654
1713
|
### waitUrlEquals
|
|
1655
1714
|
|
|
@@ -1663,8 +1722,9 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
1663
1722
|
#### Parameters
|
|
1664
1723
|
|
|
1665
1724
|
- `urlPart` **[string][9]** value to check.
|
|
1666
|
-
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1667
|
-
|
|
1725
|
+
- `sec` **[number][7]** (optional, `1` by default) time in seconds to wait
|
|
1726
|
+
|
|
1727
|
+
Returns **[Promise][10]<void>** automatically synchronized promise through #recorder
|
|
1668
1728
|
|
|
1669
1729
|
## locator
|
|
1670
1730
|
|
|
@@ -1688,13 +1748,13 @@ just press button if no selector is given
|
|
|
1688
1748
|
|
|
1689
1749
|
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1690
1750
|
|
|
1691
|
-
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
1751
|
+
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1692
1752
|
|
|
1693
|
-
[11]: https://
|
|
1753
|
+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1694
1754
|
|
|
1695
|
-
[12]: https://
|
|
1755
|
+
[12]: https://vuejs.org/v2/api/#Vue-nextTick
|
|
1696
1756
|
|
|
1697
|
-
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
1757
|
+
[13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1698
1758
|
|
|
1699
1759
|
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1700
1760
|
|