codeceptjs 4.2.0-beta.4 → 4.2.1-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/README.md +2 -0
- package/bin/codecept.js +11 -0
- package/docs/agents.md +26 -1
- package/docs/ai.md +57 -0
- package/docs/alternative-browsers.md +175 -148
- package/docs/assertions.md +74 -0
- package/docs/bootstrap.md +2 -0
- package/docs/commands.md +45 -0
- package/docs/configuration.md +37 -0
- package/docs/debugging.md +1 -1
- package/docs/helpers/ApiDataFactory.md +20 -20
- package/docs/helpers/Appium.md +1615 -670
- package/docs/helpers/Decision.md +146 -0
- package/docs/helpers/GraphQL.md +31 -31
- package/docs/helpers/GraphQLDataFactory.md +20 -20
- package/docs/helpers/Kitesurf.md +1808 -25
- package/docs/helpers/Lightpanda.md +139 -0
- package/docs/helpers/Obscura.md +1799 -74
- package/docs/helpers/Playwright.md +490 -428
- package/docs/helpers/Puppeteer.md +317 -255
- package/docs/helpers/REST.md +43 -43
- package/docs/helpers/WebDriver.md +237 -175
- package/docs/installation.md +16 -0
- package/docs/mcp.md +7 -1
- package/docs/parallel.md +35 -1
- package/docs/plugins/pause.md +2 -1
- package/docs/plugins/sitemap.md +48 -0
- package/docs/plugins.md +4 -0
- package/lib/ai.js +81 -2
- package/lib/codecept.js +32 -2
- package/lib/command/init.js +22 -0
- package/lib/command/initAgent.js +78 -0
- package/lib/command/run-multiple.js +3 -0
- package/lib/command/run-workers.js +10 -3
- package/lib/command/run.js +3 -2
- package/lib/command/utils.js +15 -0
- package/lib/command/workers/runTests.js +10 -10
- package/lib/container.js +4 -2
- package/lib/effects.js +19 -1
- package/lib/helper/Appium.js +23 -0
- package/lib/helper/CDPBrowser.js +387 -1338
- package/lib/helper/Decision.js +256 -0
- package/lib/helper/Kitesurf.js +3 -21
- package/lib/helper/Lightpanda.js +137 -0
- package/lib/helper/Obscura.js +21 -238
- package/lib/helper/Playwright.js +50 -4
- package/lib/helper/Puppeteer.js +62 -8
- package/lib/helper/WebDriver.js +45 -1
- package/lib/helper/extras/clipboard.js +31 -0
- package/lib/listener/result.js +4 -0
- package/lib/mocha/bdd.js +19 -1
- package/lib/plugin/junitReporter.js +4 -1
- package/lib/plugin/pause.js +4 -1
- package/lib/plugin/sitemap.js +228 -0
- package/lib/recorder.js +19 -18
- package/lib/result.js +16 -0
- package/lib/step/base.js +12 -0
- package/lib/utils.js +2 -10
- package/lib/webServer.js +193 -0
- package/lib/workers.js +118 -31
- package/package.json +4 -2
- package/typings/index.d.ts +60 -7
- package/typings/promiseBasedTypes.d.ts +985 -814
- package/typings/types.d.ts +1084 -815
- package/docs/helpers/CDPBrowser.md +0 -2138
|
@@ -33,12 +33,12 @@ Using `puppeteer-core` package, will prevent the download of browser binaries an
|
|
|
33
33
|
|
|
34
34
|
This helper should be configured in codecept.conf.js
|
|
35
35
|
|
|
36
|
-
Type: [object][
|
|
36
|
+
Type: [object][6]
|
|
37
37
|
|
|
38
38
|
### Properties
|
|
39
39
|
|
|
40
|
-
* `url` **[string][
|
|
41
|
-
* `basicAuth` **[object][
|
|
40
|
+
* `url` **[string][5]** base url of website to be tested
|
|
41
|
+
* `basicAuth` **[object][6]?** (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
|
|
42
42
|
* `show` **[boolean][24]?** show Google Chrome window for debug.
|
|
43
43
|
* `restart` **[boolean][24]?** restart browser between tests.
|
|
44
44
|
* `disableScreenshots` **[boolean][24]?** don't save screenshot on failure.
|
|
@@ -49,15 +49,15 @@ Type: [object][4]
|
|
|
49
49
|
* `keepBrowserState` **[boolean][24]?** keep browser state between tests when `restart` is set to false.
|
|
50
50
|
* `keepCookies` **[boolean][24]?** keep cookies between tests when `restart` is set to false.
|
|
51
51
|
* `waitForAction` **[number][11]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
|
|
52
|
-
* `waitForNavigation` **([string][
|
|
52
|
+
* `waitForNavigation` **([string][5] | [Array][17]<[string][5]>)?** when to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API][29]. Array values are accepted as well.
|
|
53
53
|
* `pressKeyDelay` **[number][11]?** delay between key presses in ms. Used when calling Puppeteers page.type(...) in fillField/appendField
|
|
54
54
|
* `getPageTimeout` **[number][11]?** config option to set maximum navigation time in milliseconds. If the timeout is set to 0, then timeout will be disabled.
|
|
55
55
|
* `waitForTimeout` **[number][11]?** default wait* timeout in ms.
|
|
56
|
-
* `windowSize` **[string][
|
|
57
|
-
* `userAgent` **[string][
|
|
56
|
+
* `windowSize` **[string][5]?** default window size. Set a dimension in format WIDTHxHEIGHT like `640x480`.
|
|
57
|
+
* `userAgent` **[string][5]?** user-agent string.
|
|
58
58
|
* `manualStart` **[boolean][24]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Puppeteer"]._startBrowser()`.
|
|
59
|
-
* `browser` **[string][
|
|
60
|
-
* `chrome` **[object][
|
|
59
|
+
* `browser` **[string][5]?** can be changed to `firefox` when using [puppeteer-firefox][2].
|
|
60
|
+
* `chrome` **[object][6]?** pass additional [Puppeteer run options][30].
|
|
61
61
|
* `highlightElement` **[boolean][24]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
|
|
62
62
|
|
|
63
63
|
## findElement
|
|
@@ -67,10 +67,10 @@ Note: Puppeteer Locator API doesn't have .first() method like Playwright
|
|
|
67
67
|
|
|
68
68
|
### Parameters
|
|
69
69
|
|
|
70
|
-
* `matcher` **[Object][
|
|
71
|
-
* `locator` **([Object][
|
|
70
|
+
* `matcher` **[Object][6]** Puppeteer context to search within
|
|
71
|
+
* `locator` **([Object][6] | [string][5])** Locator specification
|
|
72
72
|
|
|
73
|
-
Returns **[Promise][12]<[Object][
|
|
73
|
+
Returns **[Promise][12]<[Object][6]>** Single ElementHandle object
|
|
74
74
|
|
|
75
75
|
## findElements
|
|
76
76
|
|
|
@@ -79,8 +79,8 @@ Note: Unlike Playwright, Puppeteer's Locator API doesn't have .all() method for
|
|
|
79
79
|
|
|
80
80
|
### Parameters
|
|
81
81
|
|
|
82
|
-
* `matcher` **[Object][
|
|
83
|
-
* `locator` **([Object][
|
|
82
|
+
* `matcher` **[Object][6]** Puppeteer context to search within
|
|
83
|
+
* `locator` **([Object][6] | [string][5])** Locator specification
|
|
84
84
|
|
|
85
85
|
Returns **[Promise][12]<[Array][17]>** Array of ElementHandle objects
|
|
86
86
|
|
|
@@ -211,95 +211,11 @@ await page.url(); // Get the url of the current page
|
|
|
211
211
|
|
|
212
212
|
* `config`  
|
|
213
213
|
|
|
214
|
-
### _addPopupListener
|
|
215
|
-
|
|
216
|
-
Add the 'dialog' event listener to a page
|
|
217
|
-
|
|
218
|
-
#### Parameters
|
|
219
|
-
|
|
220
|
-
* `page`  
|
|
221
|
-
|
|
222
|
-
### _getPageUrl
|
|
223
|
-
|
|
224
|
-
Gets page URL including hash.
|
|
225
|
-
|
|
226
|
-
### _locate
|
|
227
|
-
|
|
228
|
-
Get elements by different locator types, including strict locator
|
|
229
|
-
Should be used in custom helpers:
|
|
230
|
-
|
|
231
|
-
```js
|
|
232
|
-
const elements = await this.helpers['Puppeteer']._locate({name: 'password'});
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
#### Parameters
|
|
236
|
-
|
|
237
|
-
* `locator`  
|
|
238
|
-
|
|
239
|
-
### _locateCheckable
|
|
240
|
-
|
|
241
|
-
Find a checkbox by providing human-readable text:
|
|
242
|
-
NOTE: Assumes the checkable element exists
|
|
243
|
-
|
|
244
|
-
```js
|
|
245
|
-
this.helpers['Puppeteer']._locateCheckable('I agree with terms and conditions').then // ...
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
#### Parameters
|
|
249
|
-
|
|
250
|
-
* `locator`  
|
|
251
|
-
* `providedContext`
|
|
252
|
-
|
|
253
|
-
### _locateClickable
|
|
254
|
-
|
|
255
|
-
Find a clickable element by providing human-readable text:
|
|
256
|
-
|
|
257
|
-
```js
|
|
258
|
-
this.helpers['Puppeteer']._locateClickable('Next page').then // ...
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
#### Parameters
|
|
262
|
-
|
|
263
|
-
* `locator`  
|
|
264
|
-
|
|
265
|
-
### _locateElement
|
|
266
|
-
|
|
267
|
-
Get single element by different locator types, including strict locator
|
|
268
|
-
Should be used in custom helpers:
|
|
269
|
-
|
|
270
|
-
```js
|
|
271
|
-
const element = await this.helpers['Puppeteer']._locateElement({name: 'password'});
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
#### Parameters
|
|
275
|
-
|
|
276
|
-
* `locator`  
|
|
277
|
-
|
|
278
|
-
### _locateFields
|
|
279
|
-
|
|
280
|
-
Find field elements by providing human-readable text:
|
|
281
|
-
|
|
282
|
-
```js
|
|
283
|
-
this.helpers['Puppeteer']._locateFields('Your email').then // ...
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
#### Parameters
|
|
287
|
-
|
|
288
|
-
* `locator`  
|
|
289
|
-
|
|
290
|
-
### _setPage
|
|
291
|
-
|
|
292
|
-
Set current page
|
|
293
|
-
|
|
294
|
-
#### Parameters
|
|
295
|
-
|
|
296
|
-
* `page` **[object][4]** page to set
|
|
297
|
-
|
|
298
214
|
### acceptPopup
|
|
299
215
|
|
|
300
216
|
Accepts the active JavaScript native popup window, as created by window.alert|window.confirm|window.prompt.
|
|
301
217
|
Don't confuse popups with modal windows, as created by [various
|
|
302
|
-
libraries][
|
|
218
|
+
libraries][4].
|
|
303
219
|
|
|
304
220
|
### amAcceptingPopups
|
|
305
221
|
|
|
@@ -336,7 +252,7 @@ I.amOnPage('/login'); // opens a login page
|
|
|
336
252
|
|
|
337
253
|
#### Parameters
|
|
338
254
|
|
|
339
|
-
* `url` **[string][
|
|
255
|
+
* `url` **[string][5]** url path or global url.
|
|
340
256
|
|
|
341
257
|
Returns **void** automatically synchronized promise through #recorder
|
|
342
258
|
|
|
@@ -357,9 +273,9 @@ I.appendField('name', 'John', '.form-container');
|
|
|
357
273
|
|
|
358
274
|
#### Parameters
|
|
359
275
|
|
|
360
|
-
* `field` **([string][
|
|
361
|
-
* `value` **[string][
|
|
362
|
-
* `context` **([string][
|
|
276
|
+
* `field` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator
|
|
277
|
+
* `value` **[string][5]** text value to append.
|
|
278
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
363
279
|
|
|
364
280
|
Returns **void** automatically synchronized promise through #recorder
|
|
365
281
|
|
|
@@ -389,9 +305,9 @@ I.attachFile('#dropzone', 'data/avatar.jpg');
|
|
|
389
305
|
|
|
390
306
|
#### Parameters
|
|
391
307
|
|
|
392
|
-
* `locator` **([string][
|
|
393
|
-
* `pathToFile` **[string][
|
|
394
|
-
* `context` **([string][
|
|
308
|
+
* `locator` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
309
|
+
* `pathToFile` **[string][5]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
|
|
310
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
395
311
|
|
|
396
312
|
Returns **void** automatically synchronized promise through #recorder
|
|
397
313
|
|
|
@@ -415,7 +331,7 @@ I.dontSee('#add-to-cart-btn');
|
|
|
415
331
|
|
|
416
332
|
#### Parameters
|
|
417
333
|
|
|
418
|
-
* `locator` **([string][
|
|
334
|
+
* `locator` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
419
335
|
* `options` **any?** Playwright only: [Additional options][9] for available options object as 2nd argument.
|
|
420
336
|
|
|
421
337
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -439,8 +355,19 @@ I.checkOption('agree', '//form');
|
|
|
439
355
|
|
|
440
356
|
#### Parameters
|
|
441
357
|
|
|
442
|
-
* `field` **([string][
|
|
443
|
-
* `context` **([string][
|
|
358
|
+
* `field` **([string][5] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
359
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
360
|
+
|
|
361
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
362
|
+
|
|
363
|
+
### clearClipboard
|
|
364
|
+
|
|
365
|
+
Clears the system clipboard.
|
|
366
|
+
|
|
367
|
+
```js
|
|
368
|
+
I.clearClipboard();
|
|
369
|
+
I.seeClipboardEquals('');
|
|
370
|
+
```
|
|
444
371
|
|
|
445
372
|
Returns **void** automatically synchronized promise through #recorder
|
|
446
373
|
|
|
@@ -457,7 +384,7 @@ I.clearCookie('test');
|
|
|
457
384
|
#### Parameters
|
|
458
385
|
|
|
459
386
|
* `name`  
|
|
460
|
-
* `cookie` **[string][
|
|
387
|
+
* `cookie` **[string][5]?** (optional, `null` by default) cookie name
|
|
461
388
|
|
|
462
389
|
### clearField
|
|
463
390
|
|
|
@@ -476,8 +403,8 @@ I.clearField('Email', '.form-container');
|
|
|
476
403
|
#### Parameters
|
|
477
404
|
|
|
478
405
|
* `field`  
|
|
479
|
-
* `context` **([string][
|
|
480
|
-
* `editable` **([string][
|
|
406
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
407
|
+
* `editable` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
481
408
|
|
|
482
409
|
Returns **void** automatically synchronized promise through #recorder.
|
|
483
410
|
|
|
@@ -515,8 +442,8 @@ I.click({role: 'button', name: 'Submit'});
|
|
|
515
442
|
|
|
516
443
|
#### Parameters
|
|
517
444
|
|
|
518
|
-
* `locator` **([string][
|
|
519
|
-
* `context` **([string][
|
|
445
|
+
* `locator` **([string][5] | [object][6])** (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
446
|
+
* `context` **([string][5]? | [object][6] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
520
447
|
|
|
521
448
|
Returns **void** automatically synchronized promise through #recorder
|
|
522
449
|
|
|
@@ -530,8 +457,8 @@ I.clickLink('Logout', '#nav');
|
|
|
530
457
|
|
|
531
458
|
#### Parameters
|
|
532
459
|
|
|
533
|
-
* `locator` **([string][
|
|
534
|
-
* `context` **([string][
|
|
460
|
+
* `locator` **([string][5] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator
|
|
461
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator
|
|
535
462
|
|
|
536
463
|
Returns **void** automatically synchronized promise through #recorder
|
|
537
464
|
|
|
@@ -551,7 +478,7 @@ I.clickXY('#someElement', 50, 30);
|
|
|
551
478
|
|
|
552
479
|
#### Parameters
|
|
553
480
|
|
|
554
|
-
* `locator` **([string][
|
|
481
|
+
* `locator` **([string][5] | [object][6] | [number][11])** Element to click on or X coordinate if no element.
|
|
555
482
|
* `x` **[number][11]?** X coordinate relative to element, or Y coordinate if locator is a number.
|
|
556
483
|
* `y` **[number][11]?** Y coordinate relative to element.
|
|
557
484
|
|
|
@@ -585,8 +512,8 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
585
512
|
|
|
586
513
|
#### Parameters
|
|
587
514
|
|
|
588
|
-
* `text` **[string][
|
|
589
|
-
* `context` **([string][
|
|
515
|
+
* `text` **[string][5]** which is not present.
|
|
516
|
+
* `context` **([string][5] | [object][6])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
590
517
|
|
|
591
518
|
Returns **void** automatically synchronized promise through #recorder
|
|
592
519
|
|
|
@@ -602,7 +529,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
602
529
|
|
|
603
530
|
#### Parameters
|
|
604
531
|
|
|
605
|
-
* `field` **([string][
|
|
532
|
+
* `field` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
606
533
|
|
|
607
534
|
Returns **void** automatically synchronized promise through #recorder
|
|
608
535
|
|
|
@@ -616,7 +543,7 @@ I.dontSeeCookie('auth'); // no auth cookie
|
|
|
616
543
|
|
|
617
544
|
#### Parameters
|
|
618
545
|
|
|
619
|
-
* `name` **[string][
|
|
546
|
+
* `name` **[string][5]** cookie name.
|
|
620
547
|
|
|
621
548
|
Returns **void** automatically synchronized promise through #recorder
|
|
622
549
|
|
|
@@ -632,7 +559,7 @@ I.dontSeeCurrentPathEquals('/'); // fails for '/', '/?user=ok', '/#top'
|
|
|
632
559
|
|
|
633
560
|
#### Parameters
|
|
634
561
|
|
|
635
|
-
* `path` **[string][
|
|
562
|
+
* `path` **[string][5]** value to check.
|
|
636
563
|
|
|
637
564
|
Returns **void** automatically synchronized promise through #recorder
|
|
638
565
|
|
|
@@ -648,7 +575,7 @@ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also
|
|
|
648
575
|
|
|
649
576
|
#### Parameters
|
|
650
577
|
|
|
651
|
-
* `url` **[string][
|
|
578
|
+
* `url` **[string][5]** value to check.
|
|
652
579
|
|
|
653
580
|
Returns **void** automatically synchronized promise through #recorder
|
|
654
581
|
|
|
@@ -665,8 +592,8 @@ I.dontSeeElement('.modal', '#container');
|
|
|
665
592
|
|
|
666
593
|
#### Parameters
|
|
667
594
|
|
|
668
|
-
* `locator` **([string][
|
|
669
|
-
* `context` **([string][
|
|
595
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|Strict locator.
|
|
596
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
670
597
|
|
|
671
598
|
Returns **void** automatically synchronized promise through #recorder
|
|
672
599
|
|
|
@@ -680,7 +607,7 @@ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or
|
|
|
680
607
|
|
|
681
608
|
#### Parameters
|
|
682
609
|
|
|
683
|
-
* `locator` **([string][
|
|
610
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|Strict locator.
|
|
684
611
|
|
|
685
612
|
Returns **void** automatically synchronized promise through #recorder
|
|
686
613
|
|
|
@@ -690,7 +617,7 @@ Checks that current url does not contain a provided fragment.
|
|
|
690
617
|
|
|
691
618
|
#### Parameters
|
|
692
619
|
|
|
693
|
-
* `url` **[string][
|
|
620
|
+
* `url` **[string][5]** value to check.
|
|
694
621
|
|
|
695
622
|
Returns **void** automatically synchronized promise through #recorder
|
|
696
623
|
|
|
@@ -710,9 +637,9 @@ I.dontSeeInField('Name', 'old_value', '.form-container');
|
|
|
710
637
|
|
|
711
638
|
#### Parameters
|
|
712
639
|
|
|
713
|
-
* `field` **([string][
|
|
714
|
-
* `value` **([string][
|
|
715
|
-
* `context` **([string][
|
|
640
|
+
* `field` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
641
|
+
* `value` **([string][5] | [object][6])** value to check.
|
|
642
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
716
643
|
|
|
717
644
|
Returns **void** automatically synchronized promise through #recorder
|
|
718
645
|
|
|
@@ -727,7 +654,7 @@ I.dontSeeInSource('<!--'); // no comments in source
|
|
|
727
654
|
#### Parameters
|
|
728
655
|
|
|
729
656
|
* `text`  
|
|
730
|
-
* `value` **[string][
|
|
657
|
+
* `value` **[string][5]** to check.
|
|
731
658
|
|
|
732
659
|
Returns **void** automatically synchronized promise through #recorder
|
|
733
660
|
|
|
@@ -741,7 +668,7 @@ I.dontSeeInTitle('Error');
|
|
|
741
668
|
|
|
742
669
|
#### Parameters
|
|
743
670
|
|
|
744
|
-
* `text` **[string][
|
|
671
|
+
* `text` **[string][5]** value to check.
|
|
745
672
|
|
|
746
673
|
Returns **void** automatically synchronized promise through #recorder
|
|
747
674
|
|
|
@@ -758,10 +685,10 @@ I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.exa
|
|
|
758
685
|
|
|
759
686
|
#### Parameters
|
|
760
687
|
|
|
761
|
-
* `opts` **[Object][
|
|
688
|
+
* `opts` **[Object][6]** options when checking the traffic network.
|
|
762
689
|
|
|
763
|
-
* `opts.name` **[string][
|
|
764
|
-
* `opts.url` **([string][
|
|
690
|
+
* `opts.name` **[string][5]** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
|
|
691
|
+
* `opts.url` **([string][5] | [RegExp][13])** Expected URL of request in network traffic. Can be a string or a regular expression.
|
|
765
692
|
|
|
766
693
|
Returns **void** automatically synchronized promise through #recorder
|
|
767
694
|
|
|
@@ -779,8 +706,8 @@ I.doubleClick('.btn.edit');
|
|
|
779
706
|
|
|
780
707
|
#### Parameters
|
|
781
708
|
|
|
782
|
-
* `locator` **([string][
|
|
783
|
-
* `context` **([string][
|
|
709
|
+
* `locator` **([string][5] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
710
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
784
711
|
|
|
785
712
|
Returns **void** automatically synchronized promise through #recorder
|
|
786
713
|
|
|
@@ -805,8 +732,8 @@ I.dragAndDrop('#dragHandle', '#container');
|
|
|
805
732
|
|
|
806
733
|
#### Parameters
|
|
807
734
|
|
|
808
|
-
* `srcElement` **([string][
|
|
809
|
-
* `destElement` **([string][
|
|
735
|
+
* `srcElement` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
736
|
+
* `destElement` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
810
737
|
|
|
811
738
|
Returns **void** automatically synchronized promise through #recorder
|
|
812
739
|
|
|
@@ -822,7 +749,7 @@ I.dragSlider('#slider', -70);
|
|
|
822
749
|
|
|
823
750
|
#### Parameters
|
|
824
751
|
|
|
825
|
-
* `locator` **([string][
|
|
752
|
+
* `locator` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
826
753
|
* `offsetX` **[number][11]** position to drag.
|
|
827
754
|
|
|
828
755
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -854,7 +781,7 @@ let val = await I.executeAsyncScript(function(url, done) {
|
|
|
854
781
|
#### Parameters
|
|
855
782
|
|
|
856
783
|
* `args` **...any** to be passed to function.
|
|
857
|
-
* `fn` **([string][
|
|
784
|
+
* `fn` **([string][5] | [function][15])** function to be executed in browser context.
|
|
858
785
|
|
|
859
786
|
Returns **[Promise][12]<any>** script return value
|
|
860
787
|
|
|
@@ -889,7 +816,7 @@ let date = await I.executeScript(function(el) {
|
|
|
889
816
|
#### Parameters
|
|
890
817
|
|
|
891
818
|
* `args` **...any** to be passed to function.
|
|
892
|
-
* `fn` **([string][
|
|
819
|
+
* `fn` **([string][5] | [function][15])** function to be executed in browser context.
|
|
893
820
|
|
|
894
821
|
Returns **[Promise][12]<any>** script return value
|
|
895
822
|
|
|
@@ -919,9 +846,9 @@ I.fillField('Name', 'John', '#section2');
|
|
|
919
846
|
|
|
920
847
|
#### Parameters
|
|
921
848
|
|
|
922
|
-
* `field` **([string][
|
|
923
|
-
* `value` **([string][
|
|
924
|
-
* `context` **([string][
|
|
849
|
+
* `field` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
850
|
+
* `value` **([string][5] | [object][6])** text value to fill.
|
|
851
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
925
852
|
|
|
926
853
|
Returns **void** automatically synchronized promise through #recorder
|
|
927
854
|
|
|
@@ -951,7 +878,7 @@ I.see('#add-to-cart-bnt');
|
|
|
951
878
|
|
|
952
879
|
#### Parameters
|
|
953
880
|
|
|
954
|
-
* `locator` **([string][
|
|
881
|
+
* `locator` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
955
882
|
* `options` **any?** Playwright only: [Additional options][16] for available options object as 2nd argument.
|
|
956
883
|
|
|
957
884
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -985,8 +912,8 @@ I.forceClick({css: 'nav a.login'});
|
|
|
985
912
|
|
|
986
913
|
#### Parameters
|
|
987
914
|
|
|
988
|
-
* `locator` **([string][
|
|
989
|
-
* `context` **([string][
|
|
915
|
+
* `locator` **([string][5] | [object][6])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
916
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
990
917
|
|
|
991
918
|
Returns **void** automatically synchronized promise through #recorder
|
|
992
919
|
|
|
@@ -1002,10 +929,10 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
|
1002
929
|
|
|
1003
930
|
#### Parameters
|
|
1004
931
|
|
|
1005
|
-
* `locator` **([string][
|
|
1006
|
-
* `attr` **[string][
|
|
932
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
933
|
+
* `attr` **[string][5]** attribute name.
|
|
1007
934
|
|
|
1008
|
-
Returns **[Promise][12]<[string][
|
|
935
|
+
Returns **[Promise][12]<[string][5]>** attribute value
|
|
1009
936
|
|
|
1010
937
|
### grabAttributeFromAll
|
|
1011
938
|
|
|
@@ -1018,10 +945,10 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
|
1018
945
|
|
|
1019
946
|
#### Parameters
|
|
1020
947
|
|
|
1021
|
-
* `locator` **([string][
|
|
1022
|
-
* `attr` **[string][
|
|
948
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
949
|
+
* `attr` **[string][5]** attribute name.
|
|
1023
950
|
|
|
1024
|
-
Returns **[Promise][12]<[Array][17]<[string][
|
|
951
|
+
Returns **[Promise][12]<[Array][17]<[string][5]>>** attribute value
|
|
1025
952
|
|
|
1026
953
|
### grabBrowserLogs
|
|
1027
954
|
|
|
@@ -1047,7 +974,7 @@ assert(cookie.value, '123456');
|
|
|
1047
974
|
|
|
1048
975
|
#### Parameters
|
|
1049
976
|
|
|
1050
|
-
* `name` **[string][
|
|
977
|
+
* `name` **[string][5]?** cookie name.
|
|
1051
978
|
|
|
1052
979
|
Returns **any** attribute valueReturns cookie in JSON format. If name not passed returns all cookies for this domain.
|
|
1053
980
|
|
|
@@ -1063,10 +990,10 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
|
|
|
1063
990
|
|
|
1064
991
|
#### Parameters
|
|
1065
992
|
|
|
1066
|
-
* `locator` **([string][
|
|
1067
|
-
* `cssProperty` **[string][
|
|
993
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
994
|
+
* `cssProperty` **[string][5]** CSS property name.
|
|
1068
995
|
|
|
1069
|
-
Returns **[Promise][12]<[string][
|
|
996
|
+
Returns **[Promise][12]<[string][5]>** CSS value
|
|
1070
997
|
|
|
1071
998
|
### grabCssPropertyFromAll
|
|
1072
999
|
|
|
@@ -1079,10 +1006,10 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
|
|
|
1079
1006
|
|
|
1080
1007
|
#### Parameters
|
|
1081
1008
|
|
|
1082
|
-
* `locator` **([string][
|
|
1083
|
-
* `cssProperty` **[string][
|
|
1009
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1010
|
+
* `cssProperty` **[string][5]** CSS property name.
|
|
1084
1011
|
|
|
1085
|
-
Returns **[Promise][12]<[Array][17]<[string][
|
|
1012
|
+
Returns **[Promise][12]<[Array][17]<[string][5]>>** CSS value
|
|
1086
1013
|
|
|
1087
1014
|
### grabCurrentUrl
|
|
1088
1015
|
|
|
@@ -1094,7 +1021,7 @@ let url = await I.grabCurrentUrl();
|
|
|
1094
1021
|
console.log(`Current URL is [${url}]`);
|
|
1095
1022
|
```
|
|
1096
1023
|
|
|
1097
|
-
Returns **[Promise][12]<[string][
|
|
1024
|
+
Returns **[Promise][12]<[string][5]>** current URL
|
|
1098
1025
|
|
|
1099
1026
|
### grabDataFromPerformanceTiming
|
|
1100
1027
|
|
|
@@ -1143,12 +1070,27 @@ const width = await I.grabElementBoundingRect('h3', 'width');
|
|
|
1143
1070
|
|
|
1144
1071
|
#### Parameters
|
|
1145
1072
|
|
|
1146
|
-
* `locator` **([string][
|
|
1073
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1147
1074
|
* `prop`  
|
|
1148
|
-
* `elementSize` **[string][
|
|
1075
|
+
* `elementSize` **[string][5]?** x, y, width or height of the given element.
|
|
1149
1076
|
|
|
1150
1077
|
Returns **([Promise][12]<DOMRect> | [Promise][12]<[number][11]>)** Element bounding rectangle
|
|
1151
1078
|
|
|
1079
|
+
### grabFromClipboard
|
|
1080
|
+
|
|
1081
|
+
Grabs the text content of the system clipboard and returns it to test.
|
|
1082
|
+
Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
1083
|
+
|
|
1084
|
+
```js
|
|
1085
|
+
I.click('Copy to clipboard');
|
|
1086
|
+
let url = await I.grabFromClipboard();
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
1090
|
+
in Chromium-based browsers, where read access is granted automatically.
|
|
1091
|
+
|
|
1092
|
+
Returns **[Promise][12]<[string][5]>** the system clipboard contents.
|
|
1093
|
+
|
|
1152
1094
|
### grabHTMLFrom
|
|
1153
1095
|
|
|
1154
1096
|
Retrieves the innerHTML from an element located by CSS or XPath and returns it to test.
|
|
@@ -1162,9 +1104,9 @@ let postHTML = await I.grabHTMLFrom('#post');
|
|
|
1162
1104
|
#### Parameters
|
|
1163
1105
|
|
|
1164
1106
|
* `locator`  
|
|
1165
|
-
* `element` **([string][
|
|
1107
|
+
* `element` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1166
1108
|
|
|
1167
|
-
Returns **[Promise][12]<[string][
|
|
1109
|
+
Returns **[Promise][12]<[string][5]>** HTML code for an element
|
|
1168
1110
|
|
|
1169
1111
|
### grabHTMLFromAll
|
|
1170
1112
|
|
|
@@ -1178,9 +1120,9 @@ let postHTMLs = await I.grabHTMLFromAll('.post');
|
|
|
1178
1120
|
#### Parameters
|
|
1179
1121
|
|
|
1180
1122
|
* `locator`  
|
|
1181
|
-
* `element` **([string][
|
|
1123
|
+
* `element` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1182
1124
|
|
|
1183
|
-
Returns **[Promise][12]<[Array][17]<[string][
|
|
1125
|
+
Returns **[Promise][12]<[Array][17]<[string][5]>>** HTML code for an element
|
|
1184
1126
|
|
|
1185
1127
|
### grabNumberOfOpenTabs
|
|
1186
1128
|
|
|
@@ -1204,7 +1146,7 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
|
1204
1146
|
|
|
1205
1147
|
#### Parameters
|
|
1206
1148
|
|
|
1207
|
-
* `locator` **([string][
|
|
1149
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1208
1150
|
|
|
1209
1151
|
Returns **[Promise][12]<[number][11]>** number of visible elements
|
|
1210
1152
|
|
|
@@ -1227,7 +1169,7 @@ Grab the text within the popup. If no popup is visible then it will return null
|
|
|
1227
1169
|
await I.grabPopupText();
|
|
1228
1170
|
```
|
|
1229
1171
|
|
|
1230
|
-
Returns **[Promise][12]<([string][
|
|
1172
|
+
Returns **[Promise][12]<([string][5] | null)>** 
|
|
1231
1173
|
|
|
1232
1174
|
### grabRecordedNetworkTraffics
|
|
1233
1175
|
|
|
@@ -1251,7 +1193,7 @@ Resumes test execution, so **should be used inside async function with `await`**
|
|
|
1251
1193
|
let pageSource = await I.grabSource();
|
|
1252
1194
|
```
|
|
1253
1195
|
|
|
1254
|
-
Returns **[Promise][12]<[string][
|
|
1196
|
+
Returns **[Promise][12]<[string][5]>** source code
|
|
1255
1197
|
|
|
1256
1198
|
### grabTextFrom
|
|
1257
1199
|
|
|
@@ -1266,9 +1208,9 @@ If multiple elements found returns first element.
|
|
|
1266
1208
|
|
|
1267
1209
|
#### Parameters
|
|
1268
1210
|
|
|
1269
|
-
* `locator` **([string][
|
|
1211
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1270
1212
|
|
|
1271
|
-
Returns **[Promise][12]<[string][
|
|
1213
|
+
Returns **[Promise][12]<[string][5]>** attribute value
|
|
1272
1214
|
|
|
1273
1215
|
### grabTextFromAll
|
|
1274
1216
|
|
|
@@ -1281,9 +1223,9 @@ let pins = await I.grabTextFromAll('#pin li');
|
|
|
1281
1223
|
|
|
1282
1224
|
#### Parameters
|
|
1283
1225
|
|
|
1284
|
-
* `locator` **([string][
|
|
1226
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1285
1227
|
|
|
1286
|
-
Returns **[Promise][12]<[Array][17]<[string][
|
|
1228
|
+
Returns **[Promise][12]<[Array][17]<[string][5]>>** attribute value
|
|
1287
1229
|
|
|
1288
1230
|
### grabTitle
|
|
1289
1231
|
|
|
@@ -1294,7 +1236,7 @@ Resumes test execution, so **should be used inside async with `await`** operator
|
|
|
1294
1236
|
let title = await I.grabTitle();
|
|
1295
1237
|
```
|
|
1296
1238
|
|
|
1297
|
-
Returns **[Promise][12]<[string][
|
|
1239
|
+
Returns **[Promise][12]<[string][5]>** title
|
|
1298
1240
|
|
|
1299
1241
|
### grabValueFrom
|
|
1300
1242
|
|
|
@@ -1308,9 +1250,9 @@ let email = await I.grabValueFrom('input[name=email]');
|
|
|
1308
1250
|
|
|
1309
1251
|
#### Parameters
|
|
1310
1252
|
|
|
1311
|
-
* `locator` **([string][
|
|
1253
|
+
* `locator` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1312
1254
|
|
|
1313
|
-
Returns **[Promise][12]<[string][
|
|
1255
|
+
Returns **[Promise][12]<[string][5]>** attribute value
|
|
1314
1256
|
|
|
1315
1257
|
### grabValueFromAll
|
|
1316
1258
|
|
|
@@ -1323,9 +1265,9 @@ let inputs = await I.grabValueFromAll('//form/input');
|
|
|
1323
1265
|
|
|
1324
1266
|
#### Parameters
|
|
1325
1267
|
|
|
1326
|
-
* `locator` **([string][
|
|
1268
|
+
* `locator` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1327
1269
|
|
|
1328
|
-
Returns **[Promise][12]<[Array][17]<[string][
|
|
1270
|
+
Returns **[Promise][12]<[Array][17]<[string][5]>>** attribute value
|
|
1329
1271
|
|
|
1330
1272
|
### grabWebElement
|
|
1331
1273
|
|
|
@@ -1338,7 +1280,7 @@ const webElement = await I.grabWebElement('#button');
|
|
|
1338
1280
|
|
|
1339
1281
|
#### Parameters
|
|
1340
1282
|
|
|
1341
|
-
* `locator` **([string][
|
|
1283
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1342
1284
|
|
|
1343
1285
|
Returns **[Promise][12]<any>** WebElement of being used Web helper
|
|
1344
1286
|
|
|
@@ -1353,7 +1295,7 @@ const webElements = await I.grabWebElements('#button');
|
|
|
1353
1295
|
|
|
1354
1296
|
#### Parameters
|
|
1355
1297
|
|
|
1356
|
-
* `locator` **([string][
|
|
1298
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1357
1299
|
|
|
1358
1300
|
Returns **[Promise][12]<any>** WebElement of being used Web helper
|
|
1359
1301
|
|
|
@@ -1381,7 +1323,7 @@ I.seeFile('avatar.jpg');
|
|
|
1381
1323
|
|
|
1382
1324
|
#### Parameters
|
|
1383
1325
|
|
|
1384
|
-
* `downloadPath` **[string][
|
|
1326
|
+
* `downloadPath` **[string][5]** change this parameter to set another directory for saving
|
|
1385
1327
|
|
|
1386
1328
|
### mockRoute
|
|
1387
1329
|
|
|
@@ -1395,7 +1337,7 @@ This method allows intercepting and mocking requests & responses. [Learn more ab
|
|
|
1395
1337
|
|
|
1396
1338
|
#### Parameters
|
|
1397
1339
|
|
|
1398
|
-
* `url` **([string][
|
|
1340
|
+
* `url` **([string][5] | [RegExp][13])?** URL, regex or pattern for to match URL
|
|
1399
1341
|
* `handler` **[function][15]?** a function to process request
|
|
1400
1342
|
|
|
1401
1343
|
### moveCursorTo
|
|
@@ -1414,8 +1356,8 @@ I.moveCursorTo('#submit', '.container');
|
|
|
1414
1356
|
|
|
1415
1357
|
#### Parameters
|
|
1416
1358
|
|
|
1417
|
-
* `locator` **([string][
|
|
1418
|
-
* `offsetX` **([number][11] | [string][
|
|
1359
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1360
|
+
* `offsetX` **([number][11] | [string][5] | [object][6])** (optional, `0` by default) X-axis offset or context locator.
|
|
1419
1361
|
* `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
1420
1362
|
|
|
1421
1363
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -1493,7 +1435,7 @@ Some of the supported key names are:
|
|
|
1493
1435
|
|
|
1494
1436
|
#### Parameters
|
|
1495
1437
|
|
|
1496
|
-
* `key` **([string][
|
|
1438
|
+
* `key` **([string][5] | [Array][17]<[string][5]>)** key or array of keys to press.
|
|
1497
1439
|
|
|
1498
1440
|
Returns **void** automatically synchronized promise through #recorder
|
|
1499
1441
|
|
|
@@ -1511,7 +1453,7 @@ I.pressKeyUp('Control');
|
|
|
1511
1453
|
|
|
1512
1454
|
#### Parameters
|
|
1513
1455
|
|
|
1514
|
-
* `key` **[string][
|
|
1456
|
+
* `key` **[string][5]** name of key to press down.
|
|
1515
1457
|
|
|
1516
1458
|
Returns **void** automatically synchronized promise through #recorder
|
|
1517
1459
|
|
|
@@ -1529,7 +1471,7 @@ I.pressKeyUp('Control');
|
|
|
1529
1471
|
|
|
1530
1472
|
#### Parameters
|
|
1531
1473
|
|
|
1532
|
-
* `key` **[string][
|
|
1474
|
+
* `key` **[string][5]** name of key to release.
|
|
1533
1475
|
|
|
1534
1476
|
Returns **void** automatically synchronized promise through #recorder
|
|
1535
1477
|
|
|
@@ -1574,8 +1516,8 @@ I.rightClick('Click me', '.context');
|
|
|
1574
1516
|
|
|
1575
1517
|
#### Parameters
|
|
1576
1518
|
|
|
1577
|
-
* `locator` **([string][
|
|
1578
|
-
* `context` **([string][
|
|
1519
|
+
* `locator` **([string][5] | [object][6])** clickable element located by CSS|XPath|strict locator.
|
|
1520
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
1579
1521
|
|
|
1580
1522
|
Returns **void** automatically synchronized promise through #recorder
|
|
1581
1523
|
|
|
@@ -1590,8 +1532,8 @@ I.saveElementScreenshot(`#submit`,'debug.png');
|
|
|
1590
1532
|
|
|
1591
1533
|
#### Parameters
|
|
1592
1534
|
|
|
1593
|
-
* `locator` **([string][
|
|
1594
|
-
* `fileName` **[string][
|
|
1535
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1536
|
+
* `fileName` **[string][5]** file name to save.
|
|
1595
1537
|
|
|
1596
1538
|
Returns **void** automatically synchronized promise through #recorder
|
|
1597
1539
|
|
|
@@ -1608,7 +1550,7 @@ I.saveScreenshot('debug.png', true) //resizes to available scrollHeight and scro
|
|
|
1608
1550
|
|
|
1609
1551
|
#### Parameters
|
|
1610
1552
|
|
|
1611
|
-
* `fileName` **[string][
|
|
1553
|
+
* `fileName` **[string][5]** file name to save.
|
|
1612
1554
|
* `fullPage` **[boolean][24]** (optional, `false` by default) flag to enable fullscreen screenshot mode.
|
|
1613
1555
|
|
|
1614
1556
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -1645,7 +1587,7 @@ I.scrollTo('#submit', 5, 5);
|
|
|
1645
1587
|
|
|
1646
1588
|
#### Parameters
|
|
1647
1589
|
|
|
1648
|
-
* `locator` **([string][
|
|
1590
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1649
1591
|
* `offsetX` **[number][11]** (optional, `0` by default) X-axis offset.
|
|
1650
1592
|
* `offsetY` **[number][11]** (optional, `0` by default) Y-axis offset.
|
|
1651
1593
|
|
|
@@ -1664,8 +1606,8 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1664
1606
|
|
|
1665
1607
|
#### Parameters
|
|
1666
1608
|
|
|
1667
|
-
* `text` **[string][
|
|
1668
|
-
* `context` **([string][
|
|
1609
|
+
* `text` **[string][5]** expected on page.
|
|
1610
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1669
1611
|
|
|
1670
1612
|
Returns **void** automatically synchronized promise through #recorder
|
|
1671
1613
|
|
|
@@ -1679,8 +1621,8 @@ I.seeAttributesOnElements('//form', { method: "post"});
|
|
|
1679
1621
|
|
|
1680
1622
|
#### Parameters
|
|
1681
1623
|
|
|
1682
|
-
* `locator` **([string][
|
|
1683
|
-
* `attributes` **[object][
|
|
1624
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1625
|
+
* `attributes` **[object][6]** attributes and their values to check.
|
|
1684
1626
|
|
|
1685
1627
|
Returns **void** automatically synchronized promise through #recorder
|
|
1686
1628
|
|
|
@@ -1696,7 +1638,25 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1696
1638
|
|
|
1697
1639
|
#### Parameters
|
|
1698
1640
|
|
|
1699
|
-
* `field` **([string][
|
|
1641
|
+
* `field` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
1642
|
+
|
|
1643
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1644
|
+
|
|
1645
|
+
### seeClipboardEquals
|
|
1646
|
+
|
|
1647
|
+
Checks that the system clipboard is equal to the given text.
|
|
1648
|
+
|
|
1649
|
+
```js
|
|
1650
|
+
I.click('Copy to clipboard');
|
|
1651
|
+
I.seeClipboardEquals('https://codecept.io');
|
|
1652
|
+
```
|
|
1653
|
+
|
|
1654
|
+
Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
1655
|
+
in Chromium-based browsers, where read access is granted automatically.
|
|
1656
|
+
|
|
1657
|
+
#### Parameters
|
|
1658
|
+
|
|
1659
|
+
* `text` **[string][5]** value to check.
|
|
1700
1660
|
|
|
1701
1661
|
Returns **void** automatically synchronized promise through #recorder
|
|
1702
1662
|
|
|
@@ -1710,7 +1670,7 @@ I.seeCookie('Auth');
|
|
|
1710
1670
|
|
|
1711
1671
|
#### Parameters
|
|
1712
1672
|
|
|
1713
|
-
* `name` **[string][
|
|
1673
|
+
* `name` **[string][5]** cookie name.
|
|
1714
1674
|
|
|
1715
1675
|
Returns **void** automatically synchronized promise through #recorder
|
|
1716
1676
|
|
|
@@ -1724,8 +1684,8 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
|
1724
1684
|
|
|
1725
1685
|
#### Parameters
|
|
1726
1686
|
|
|
1727
|
-
* `locator` **([string][
|
|
1728
|
-
* `cssProperties` **[object][
|
|
1687
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1688
|
+
* `cssProperties` **[object][6]** object with CSS properties and their values to check.
|
|
1729
1689
|
|
|
1730
1690
|
Returns **void** automatically synchronized promise through #recorder
|
|
1731
1691
|
|
|
@@ -1741,7 +1701,7 @@ I.seeCurrentPathEquals('/'); // passes for '/', '/?user=ok', '/#top'
|
|
|
1741
1701
|
|
|
1742
1702
|
#### Parameters
|
|
1743
1703
|
|
|
1744
|
-
* `path` **[string][
|
|
1704
|
+
* `path` **[string][5]** value to check.
|
|
1745
1705
|
|
|
1746
1706
|
Returns **void** automatically synchronized promise through #recorder
|
|
1747
1707
|
|
|
@@ -1758,7 +1718,7 @@ I.seeCurrentUrlEquals('http://my.site.com/register');
|
|
|
1758
1718
|
|
|
1759
1719
|
#### Parameters
|
|
1760
1720
|
|
|
1761
|
-
* `url` **[string][
|
|
1721
|
+
* `url` **[string][5]** value to check.
|
|
1762
1722
|
|
|
1763
1723
|
Returns **void** automatically synchronized promise through #recorder
|
|
1764
1724
|
|
|
@@ -1780,8 +1740,8 @@ I.seeElement({role: 'dialog'});
|
|
|
1780
1740
|
|
|
1781
1741
|
#### Parameters
|
|
1782
1742
|
|
|
1783
|
-
* `locator` **([string][
|
|
1784
|
-
* `context` **([string][
|
|
1743
|
+
* `locator` **([string][5] | [object][6])** located by CSS|XPath|strict locator.
|
|
1744
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1785
1745
|
|
|
1786
1746
|
Returns **void** automatically synchronized promise through #recorder
|
|
1787
1747
|
|
|
@@ -1796,7 +1756,25 @@ I.seeElementInDOM('#modal');
|
|
|
1796
1756
|
|
|
1797
1757
|
#### Parameters
|
|
1798
1758
|
|
|
1799
|
-
* `locator` **([string][
|
|
1759
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1760
|
+
|
|
1761
|
+
Returns **void** automatically synchronized promise through #recorder
|
|
1762
|
+
|
|
1763
|
+
### seeInClipboard
|
|
1764
|
+
|
|
1765
|
+
Checks that the system clipboard contains the given text.
|
|
1766
|
+
|
|
1767
|
+
```js
|
|
1768
|
+
I.click('Copy to clipboard');
|
|
1769
|
+
I.seeInClipboard('https://codecept.io');
|
|
1770
|
+
```
|
|
1771
|
+
|
|
1772
|
+
Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
|
|
1773
|
+
in Chromium-based browsers, where read access is granted automatically.
|
|
1774
|
+
|
|
1775
|
+
#### Parameters
|
|
1776
|
+
|
|
1777
|
+
* `text` **[string][5]** value to check.
|
|
1800
1778
|
|
|
1801
1779
|
Returns **void** automatically synchronized promise through #recorder
|
|
1802
1780
|
|
|
@@ -1810,7 +1788,7 @@ I.seeInCurrentUrl('/register'); // we are on registration page
|
|
|
1810
1788
|
|
|
1811
1789
|
#### Parameters
|
|
1812
1790
|
|
|
1813
|
-
* `url` **[string][
|
|
1791
|
+
* `url` **[string][5]** a fragment to check
|
|
1814
1792
|
|
|
1815
1793
|
Returns **void** automatically synchronized promise through #recorder
|
|
1816
1794
|
|
|
@@ -1832,9 +1810,9 @@ I.seeInField('Name', 'John', '.form-container');
|
|
|
1832
1810
|
|
|
1833
1811
|
#### Parameters
|
|
1834
1812
|
|
|
1835
|
-
* `field` **([string][
|
|
1836
|
-
* `value` **([string][
|
|
1837
|
-
* `context` **([string][
|
|
1813
|
+
* `field` **([string][5] | [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
1814
|
+
* `value` **([string][5] | [object][6])** value to check.
|
|
1815
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1838
1816
|
|
|
1839
1817
|
Returns **void** automatically synchronized promise through #recorder
|
|
1840
1818
|
|
|
@@ -1849,7 +1827,7 @@ I.seeInPopup('Popup text');
|
|
|
1849
1827
|
|
|
1850
1828
|
#### Parameters
|
|
1851
1829
|
|
|
1852
|
-
* `text` **[string][
|
|
1830
|
+
* `text` **[string][5]** value to check.
|
|
1853
1831
|
|
|
1854
1832
|
Returns **void** automatically synchronized promise through #recorder
|
|
1855
1833
|
|
|
@@ -1863,7 +1841,7 @@ I.seeInSource('<h1>Green eggs & ham</h1>');
|
|
|
1863
1841
|
|
|
1864
1842
|
#### Parameters
|
|
1865
1843
|
|
|
1866
|
-
* `text` **[string][
|
|
1844
|
+
* `text` **[string][5]** value to check.
|
|
1867
1845
|
|
|
1868
1846
|
Returns **void** automatically synchronized promise through #recorder
|
|
1869
1847
|
|
|
@@ -1877,7 +1855,7 @@ I.seeInTitle('Home Page');
|
|
|
1877
1855
|
|
|
1878
1856
|
#### Parameters
|
|
1879
1857
|
|
|
1880
|
-
* `text` **[string][
|
|
1858
|
+
* `text` **[string][5]** text value to check.
|
|
1881
1859
|
|
|
1882
1860
|
Returns **void** automatically synchronized promise through #recorder
|
|
1883
1861
|
|
|
@@ -1892,7 +1870,7 @@ I.seeNumberOfElements('#submitBtn', 1);
|
|
|
1892
1870
|
|
|
1893
1871
|
#### Parameters
|
|
1894
1872
|
|
|
1895
|
-
* `locator` **([string][
|
|
1873
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1896
1874
|
* `num` **[number][11]** number of elements.
|
|
1897
1875
|
|
|
1898
1876
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -1908,7 +1886,7 @@ I.seeNumberOfVisibleElements('.buttons', 3);
|
|
|
1908
1886
|
|
|
1909
1887
|
#### Parameters
|
|
1910
1888
|
|
|
1911
|
-
* `locator` **([string][
|
|
1889
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
1912
1890
|
* `num` **[number][11]** number of elements.
|
|
1913
1891
|
|
|
1914
1892
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -1923,8 +1901,8 @@ I.seeTextEquals('text', 'h1');
|
|
|
1923
1901
|
|
|
1924
1902
|
#### Parameters
|
|
1925
1903
|
|
|
1926
|
-
* `text` **[string][
|
|
1927
|
-
* `context` **([string][
|
|
1904
|
+
* `text` **[string][5]** element value to check.
|
|
1905
|
+
* `context` **([string][5] | [object][6])?** element located by CSS|XPath|strict locator.
|
|
1928
1906
|
|
|
1929
1907
|
Returns **void** automatically synchronized promise through #recorder
|
|
1930
1908
|
|
|
@@ -1938,7 +1916,7 @@ I.seeTitleEquals('Test title.');
|
|
|
1938
1916
|
|
|
1939
1917
|
#### Parameters
|
|
1940
1918
|
|
|
1941
|
-
* `text` **[string][
|
|
1919
|
+
* `text` **[string][5]** value to check.
|
|
1942
1920
|
|
|
1943
1921
|
Returns **void** automatically synchronized promise through #recorder
|
|
1944
1922
|
|
|
@@ -1975,12 +1953,12 @@ await I.seeTraffic({
|
|
|
1975
1953
|
|
|
1976
1954
|
#### Parameters
|
|
1977
1955
|
|
|
1978
|
-
* `opts` **[Object][
|
|
1956
|
+
* `opts` **[Object][6]** options when checking the traffic network.
|
|
1979
1957
|
|
|
1980
|
-
* `opts.name` **[string][
|
|
1981
|
-
* `opts.url` **[string][
|
|
1982
|
-
* `opts.parameters` **[Object][
|
|
1983
|
-
* `opts.requestPostData` **[Object][
|
|
1958
|
+
* `opts.name` **[string][5]** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
|
|
1959
|
+
* `opts.url` **[string][5]** Expected URL of request in network traffic
|
|
1960
|
+
* `opts.parameters` **[Object][6]?** Expected parameters of that request in network traffic
|
|
1961
|
+
* `opts.requestPostData` **[Object][6]?** Expected that request contains post data in network traffic
|
|
1984
1962
|
* `opts.timeout` **[number][11]?** Timeout to wait for request in seconds. Default is 10 seconds.
|
|
1985
1963
|
|
|
1986
1964
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2012,9 +1990,9 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
2012
1990
|
|
|
2013
1991
|
#### Parameters
|
|
2014
1992
|
|
|
2015
|
-
* `select` **([string][
|
|
2016
|
-
* `option` **([string][
|
|
2017
|
-
* `context` **([string][
|
|
1993
|
+
* `select` **([string][5] | [object][6])** field located by label|name|CSS|XPath|strict locator.
|
|
1994
|
+
* `option` **([string][5] | [Array][17]<any>)** visible text or value of option.
|
|
1995
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2018
1996
|
|
|
2019
1997
|
Returns **void** automatically synchronized promise through #recorder
|
|
2020
1998
|
|
|
@@ -2052,7 +2030,7 @@ I.setPuppeteerRequestHeaders({
|
|
|
2052
2030
|
|
|
2053
2031
|
#### Parameters
|
|
2054
2032
|
|
|
2055
|
-
* `customHeaders` **[object][
|
|
2033
|
+
* `customHeaders` **[object][6]** headers to set
|
|
2056
2034
|
|
|
2057
2035
|
### startRecordingTraffic
|
|
2058
2036
|
|
|
@@ -2086,7 +2064,7 @@ I.stopMockingRoute(/(.png$)|(.jpg$)/);
|
|
|
2086
2064
|
|
|
2087
2065
|
#### Parameters
|
|
2088
2066
|
|
|
2089
|
-
* `url` **([string][
|
|
2067
|
+
* `url` **([string][5] | [RegExp][13])?** URL, regex or pattern for to match URL
|
|
2090
2068
|
|
|
2091
2069
|
### stopRecordingTraffic
|
|
2092
2070
|
|
|
@@ -2117,7 +2095,7 @@ I.switchTo(); // switch back to main page
|
|
|
2117
2095
|
|
|
2118
2096
|
#### Parameters
|
|
2119
2097
|
|
|
2120
|
-
* `locator` **([string][
|
|
2098
|
+
* `locator` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
2121
2099
|
|
|
2122
2100
|
Returns **void** automatically synchronized promise through #recorder
|
|
2123
2101
|
|
|
@@ -2171,7 +2149,7 @@ I.type(secret('123456'));
|
|
|
2171
2149
|
|
|
2172
2150
|
* `keys`  
|
|
2173
2151
|
* `delay` **[number][11]?** (optional) delay in ms between key presses
|
|
2174
|
-
* `key` **([string][
|
|
2152
|
+
* `key` **([string][5] | [Array][17]<[string][5]>)** or array of keys to type.
|
|
2175
2153
|
|
|
2176
2154
|
Returns **void** automatically synchronized promise through #recorder
|
|
2177
2155
|
|
|
@@ -2190,8 +2168,8 @@ I.uncheckOption('agree', '//form');
|
|
|
2190
2168
|
|
|
2191
2169
|
#### Parameters
|
|
2192
2170
|
|
|
2193
|
-
* `field` **([string][
|
|
2194
|
-
* `context` **([string][
|
|
2171
|
+
* `field` **([string][5] | [object][6])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
2172
|
+
* `context` **([string][5]? | [object][6])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
2195
2173
|
|
|
2196
2174
|
Returns **void** automatically synchronized promise through #recorder
|
|
2197
2175
|
|
|
@@ -2212,7 +2190,7 @@ I.usePuppeteerTo('emulate offline mode', async ({ page }) {
|
|
|
2212
2190
|
|
|
2213
2191
|
#### Parameters
|
|
2214
2192
|
|
|
2215
|
-
* `description` **[string][
|
|
2193
|
+
* `description` **[string][5]** used to show in logs.
|
|
2216
2194
|
* `fn` **[function][15]** async function that is executed with Puppeteer as argument
|
|
2217
2195
|
|
|
2218
2196
|
### wait
|
|
@@ -2250,7 +2228,7 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
|
|
|
2250
2228
|
|
|
2251
2229
|
#### Parameters
|
|
2252
2230
|
|
|
2253
|
-
* `locator` **([string][
|
|
2231
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2254
2232
|
* `waitTimeout`  
|
|
2255
2233
|
* `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
2256
2234
|
|
|
@@ -2266,7 +2244,7 @@ I.waitForCookie("token");
|
|
|
2266
2244
|
|
|
2267
2245
|
#### Parameters
|
|
2268
2246
|
|
|
2269
|
-
* `name` **[string][
|
|
2247
|
+
* `name` **[string][5]** expected cookie name.
|
|
2270
2248
|
* `sec` **[number][11]** (optional, `3` by default) time in seconds to wait
|
|
2271
2249
|
|
|
2272
2250
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2282,7 +2260,7 @@ I.waitForDetached('#popup');
|
|
|
2282
2260
|
|
|
2283
2261
|
#### Parameters
|
|
2284
2262
|
|
|
2285
|
-
* `locator` **([string][
|
|
2263
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2286
2264
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2287
2265
|
|
|
2288
2266
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2299,7 +2277,7 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
2299
2277
|
|
|
2300
2278
|
#### Parameters
|
|
2301
2279
|
|
|
2302
|
-
* `locator` **([string][
|
|
2280
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2303
2281
|
* `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
2304
2282
|
|
|
2305
2283
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2311,7 +2289,7 @@ Element can be located by CSS or XPath.
|
|
|
2311
2289
|
|
|
2312
2290
|
#### Parameters
|
|
2313
2291
|
|
|
2314
|
-
* `locator` **([string][
|
|
2292
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2315
2293
|
* `sec` **[number][11]** (optional) time in seconds to wait, 1 by default.
|
|
2316
2294
|
|
|
2317
2295
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2333,7 +2311,7 @@ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and
|
|
|
2333
2311
|
|
|
2334
2312
|
#### Parameters
|
|
2335
2313
|
|
|
2336
|
-
* `fn` **([string][
|
|
2314
|
+
* `fn` **([string][5] | [function][15])** to be executed in browser context.
|
|
2337
2315
|
* `argsOrSec` **([Array][17]<any> | [number][11])?** (optional, `1` by default) arguments for function or seconds.
|
|
2338
2316
|
* `sec` **[number][11]?** (optional, `1` by default) time in seconds to wait
|
|
2339
2317
|
|
|
@@ -2350,7 +2328,7 @@ I.waitForInvisible('#popup');
|
|
|
2350
2328
|
|
|
2351
2329
|
#### Parameters
|
|
2352
2330
|
|
|
2353
|
-
* `locator` **([string][
|
|
2331
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2354
2332
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2355
2333
|
|
|
2356
2334
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2391,7 +2369,7 @@ I.waitForRequest(request => request.url() === 'http://example.com' && request.me
|
|
|
2391
2369
|
|
|
2392
2370
|
#### Parameters
|
|
2393
2371
|
|
|
2394
|
-
* `urlOrPredicate` **([string][
|
|
2372
|
+
* `urlOrPredicate` **([string][5] | [function][15])** 
|
|
2395
2373
|
* `sec` **[number][11]?** seconds to wait
|
|
2396
2374
|
|
|
2397
2375
|
### waitForResponse
|
|
@@ -2405,7 +2383,7 @@ I.waitForResponse(response => response.url() === 'http://example.com' && respons
|
|
|
2405
2383
|
|
|
2406
2384
|
#### Parameters
|
|
2407
2385
|
|
|
2408
|
-
* `urlOrPredicate` **([string][
|
|
2386
|
+
* `urlOrPredicate` **([string][5] | [function][15])** 
|
|
2409
2387
|
* `sec` **[number][11]?** number of seconds to wait
|
|
2410
2388
|
|
|
2411
2389
|
### waitForText
|
|
@@ -2421,9 +2399,9 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
2421
2399
|
|
|
2422
2400
|
#### Parameters
|
|
2423
2401
|
|
|
2424
|
-
* `text` **[string][
|
|
2402
|
+
* `text` **[string][5]** to wait for.
|
|
2425
2403
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2426
|
-
* `context` **([string][
|
|
2404
|
+
* `context` **([string][5] | [object][6])?** (optional) element located by CSS|XPath|strict locator.
|
|
2427
2405
|
|
|
2428
2406
|
Returns **void** automatically synchronized promise through #recorder
|
|
2429
2407
|
|
|
@@ -2437,8 +2415,8 @@ I.waitForValue('//input', "GoodValue");
|
|
|
2437
2415
|
|
|
2438
2416
|
#### Parameters
|
|
2439
2417
|
|
|
2440
|
-
* `field` **([string][
|
|
2441
|
-
* `value` **[string][
|
|
2418
|
+
* `field` **([string][5] | [object][6])** input field.
|
|
2419
|
+
* `value` **[string][5]** expected value.
|
|
2442
2420
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2443
2421
|
|
|
2444
2422
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2454,7 +2432,7 @@ I.waitForVisible('#popup');
|
|
|
2454
2432
|
|
|
2455
2433
|
#### Parameters
|
|
2456
2434
|
|
|
2457
|
-
* `locator` **([string][
|
|
2435
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2458
2436
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2459
2437
|
|
|
2460
2438
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2469,7 +2447,7 @@ I.waitInUrl('/info', 2);
|
|
|
2469
2447
|
|
|
2470
2448
|
#### Parameters
|
|
2471
2449
|
|
|
2472
|
-
* `urlPart` **[string][
|
|
2450
|
+
* `urlPart` **[string][5]** value to check.
|
|
2473
2451
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2474
2452
|
|
|
2475
2453
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2484,7 +2462,7 @@ I.waitNumberOfVisibleElements('a', 3);
|
|
|
2484
2462
|
|
|
2485
2463
|
#### Parameters
|
|
2486
2464
|
|
|
2487
|
-
* `locator` **([string][
|
|
2465
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2488
2466
|
* `num` **[number][11]** number of elements.
|
|
2489
2467
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2490
2468
|
|
|
@@ -2501,7 +2479,7 @@ I.waitToHide('#popup');
|
|
|
2501
2479
|
|
|
2502
2480
|
#### Parameters
|
|
2503
2481
|
|
|
2504
|
-
* `locator` **([string][
|
|
2482
|
+
* `locator` **([string][5] | [object][6])** element located by CSS|XPath|strict locator.
|
|
2505
2483
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2506
2484
|
|
|
2507
2485
|
Returns **void** automatically synchronized promise through #recorder
|
|
@@ -2517,22 +2495,106 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
|
2517
2495
|
|
|
2518
2496
|
#### Parameters
|
|
2519
2497
|
|
|
2520
|
-
* `urlPart` **[string][
|
|
2498
|
+
* `urlPart` **[string][5]** value to check.
|
|
2521
2499
|
* `sec` **[number][11]** (optional, `1` by default) time in seconds to wait
|
|
2522
2500
|
|
|
2523
2501
|
Returns **void** automatically synchronized promise through #recorder
|
|
2524
2502
|
|
|
2503
|
+
### _addPopupListener
|
|
2504
|
+
|
|
2505
|
+
Add the 'dialog' event listener to a page
|
|
2506
|
+
|
|
2507
|
+
#### Parameters
|
|
2508
|
+
|
|
2509
|
+
* `page`  
|
|
2510
|
+
|
|
2511
|
+
### _getPageUrl
|
|
2512
|
+
|
|
2513
|
+
Gets page URL including hash.
|
|
2514
|
+
|
|
2515
|
+
### _locate
|
|
2516
|
+
|
|
2517
|
+
Get elements by different locator types, including strict locator
|
|
2518
|
+
Should be used in custom helpers:
|
|
2519
|
+
|
|
2520
|
+
```js
|
|
2521
|
+
const elements = await this.helpers['Puppeteer']._locate({name: 'password'});
|
|
2522
|
+
```
|
|
2523
|
+
|
|
2524
|
+
#### Parameters
|
|
2525
|
+
|
|
2526
|
+
* `locator`  
|
|
2527
|
+
|
|
2528
|
+
### _locateCheckable
|
|
2529
|
+
|
|
2530
|
+
Find a checkbox by providing human-readable text:
|
|
2531
|
+
NOTE: Assumes the checkable element exists
|
|
2532
|
+
|
|
2533
|
+
```js
|
|
2534
|
+
this.helpers['Puppeteer']._locateCheckable('I agree with terms and conditions').then // ...
|
|
2535
|
+
```
|
|
2536
|
+
|
|
2537
|
+
#### Parameters
|
|
2538
|
+
|
|
2539
|
+
* `locator`  
|
|
2540
|
+
* `providedContext`
|
|
2541
|
+
|
|
2542
|
+
### _locateClickable
|
|
2543
|
+
|
|
2544
|
+
Find a clickable element by providing human-readable text:
|
|
2545
|
+
|
|
2546
|
+
```js
|
|
2547
|
+
this.helpers['Puppeteer']._locateClickable('Next page').then // ...
|
|
2548
|
+
```
|
|
2549
|
+
|
|
2550
|
+
#### Parameters
|
|
2551
|
+
|
|
2552
|
+
* `locator`  
|
|
2553
|
+
|
|
2554
|
+
### _locateElement
|
|
2555
|
+
|
|
2556
|
+
Get single element by different locator types, including strict locator
|
|
2557
|
+
Should be used in custom helpers:
|
|
2558
|
+
|
|
2559
|
+
```js
|
|
2560
|
+
const element = await this.helpers['Puppeteer']._locateElement({name: 'password'});
|
|
2561
|
+
```
|
|
2562
|
+
|
|
2563
|
+
#### Parameters
|
|
2564
|
+
|
|
2565
|
+
* `locator`  
|
|
2566
|
+
|
|
2567
|
+
### _locateFields
|
|
2568
|
+
|
|
2569
|
+
Find field elements by providing human-readable text:
|
|
2570
|
+
|
|
2571
|
+
```js
|
|
2572
|
+
this.helpers['Puppeteer']._locateFields('Your email').then // ...
|
|
2573
|
+
```
|
|
2574
|
+
|
|
2575
|
+
#### Parameters
|
|
2576
|
+
|
|
2577
|
+
* `locator`  
|
|
2578
|
+
|
|
2579
|
+
### _setPage
|
|
2580
|
+
|
|
2581
|
+
Set current page
|
|
2582
|
+
|
|
2583
|
+
#### Parameters
|
|
2584
|
+
|
|
2585
|
+
* `page` **[object][6]** page to set
|
|
2586
|
+
|
|
2525
2587
|
[1]: https://github.com/puppeteer/puppeteer
|
|
2526
2588
|
|
|
2527
2589
|
[2]: https://codecept.io/helpers/Puppeteer-firefox
|
|
2528
2590
|
|
|
2529
2591
|
[3]: https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target
|
|
2530
2592
|
|
|
2531
|
-
[4]:
|
|
2593
|
+
[4]: http://jster.net/category/windows-modals-popups
|
|
2532
2594
|
|
|
2533
|
-
[5]:
|
|
2595
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
2534
2596
|
|
|
2535
|
-
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/
|
|
2597
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
2536
2598
|
|
|
2537
2599
|
[7]: https://github.com/puppeteer/puppeteer/issues/5420
|
|
2538
2600
|
|