codeceptjs 4.2.0 → 4.2.1-beta.2

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.
Files changed (66) hide show
  1. package/README.md +2 -0
  2. package/bin/codecept.js +11 -0
  3. package/docs/agents.md +26 -1
  4. package/docs/ai.md +57 -0
  5. package/docs/alternative-browsers.md +175 -148
  6. package/docs/assertions.md +74 -0
  7. package/docs/bootstrap.md +2 -0
  8. package/docs/commands.md +45 -0
  9. package/docs/configuration.md +37 -0
  10. package/docs/debugging.md +1 -1
  11. package/docs/helpers/ApiDataFactory.md +20 -20
  12. package/docs/helpers/Appium.md +1615 -670
  13. package/docs/helpers/Decision.md +146 -0
  14. package/docs/helpers/GraphQL.md +31 -31
  15. package/docs/helpers/GraphQLDataFactory.md +20 -20
  16. package/docs/helpers/Kitesurf.md +1808 -25
  17. package/docs/helpers/Lightpanda.md +139 -0
  18. package/docs/helpers/Obscura.md +1799 -74
  19. package/docs/helpers/Playwright.md +490 -428
  20. package/docs/helpers/Puppeteer.md +317 -255
  21. package/docs/helpers/REST.md +43 -43
  22. package/docs/helpers/WebDriver.md +237 -175
  23. package/docs/installation.md +16 -0
  24. package/docs/mcp.md +7 -1
  25. package/docs/parallel.md +35 -1
  26. package/docs/plugins/pause.md +2 -1
  27. package/docs/plugins/sitemap.md +48 -0
  28. package/docs/plugins.md +4 -0
  29. package/lib/ai.js +81 -2
  30. package/lib/codecept.js +32 -2
  31. package/lib/command/init.js +22 -0
  32. package/lib/command/initAgent.js +78 -0
  33. package/lib/command/run-multiple.js +3 -0
  34. package/lib/command/run-workers.js +10 -3
  35. package/lib/command/run.js +3 -2
  36. package/lib/command/utils.js +15 -0
  37. package/lib/command/workers/runTests.js +10 -10
  38. package/lib/container.js +4 -2
  39. package/lib/effects.js +19 -1
  40. package/lib/helper/CDPBrowser.js +382 -1393
  41. package/lib/helper/Decision.js +256 -0
  42. package/lib/helper/Kitesurf.js +3 -21
  43. package/lib/helper/Lightpanda.js +137 -0
  44. package/lib/helper/Obscura.js +21 -238
  45. package/lib/helper/Playwright.js +6 -4
  46. package/lib/helper/Puppeteer.js +12 -7
  47. package/lib/helper/WebDriver.js +2 -1
  48. package/lib/helper/clientscripts/cdpBrowserClient.js +1 -1
  49. package/lib/helper/clientscripts/layoutProbe.js +12 -0
  50. package/lib/helper/extras/CDPConnection.js +10 -2
  51. package/lib/listener/result.js +4 -0
  52. package/lib/mocha/bdd.js +19 -1
  53. package/lib/plugin/junitReporter.js +4 -1
  54. package/lib/plugin/pause.js +4 -1
  55. package/lib/plugin/sitemap.js +228 -0
  56. package/lib/recorder.js +19 -18
  57. package/lib/result.js +16 -0
  58. package/lib/step/base.js +12 -0
  59. package/lib/utils.js +2 -10
  60. package/lib/webServer.js +193 -0
  61. package/lib/workers.js +118 -31
  62. package/package.json +4 -2
  63. package/typings/index.d.ts +60 -7
  64. package/typings/promiseBasedTypes.d.ts +772 -824
  65. package/typings/types.d.ts +866 -833
  66. package/docs/helpers/CDPBrowser.md +0 -2138
@@ -66,20 +66,25 @@ export CF_API_TOKEN="your-api-token"
66
66
 
67
67
  ## Configuration
68
68
 
69
- This helper should be configured in codecept.conf.js. It accepts everything `CDPBrowser`
70
- accepts (see its config table), plus:
69
+ This helper should be configured in codecept.conf.js
71
70
 
72
- Type: [object][5]
71
+ Type: [object][4]
73
72
 
74
73
  ### Properties
75
74
 
76
- * `url` **[string][4]?** base URL for tests
77
- * `accountId` **[string][4]?** Cloudflare account ID; defaults to CF_ACCOUNT_ID env var
78
- * `apiToken` **[string][4]?** Cloudflare API token; defaults to CF_API_TOKEN env var
79
- * `keepAlive` **[number][6]?** session keep-alive time in milliseconds
80
- * `apiBase` **[string][4]?** Cloudflare API base URL
81
- * `input` **[string][4]?** input method for user actions; defaults to 'cdp' for Kitesurf's real layout engine, but can be overridden
82
- * `capabilities` **[object][5]?** pre-configured capabilities; Kitesurf uses { layout: 'real', screenshot: true }
75
+ * `url` **[string][3]?** base URL for tests
76
+ * `accountId` **[string][3]?** Cloudflare account ID; defaults to CF_ACCOUNT_ID env var
77
+ * `apiToken` **[string][3]?** Cloudflare API token; defaults to CF_API_TOKEN env var
78
+ * `keepAlive` **[number][8]?** session keep-alive time in milliseconds
79
+ * `apiBase` **[string][3]?** Cloudflare API base URL
80
+ * `input` **[string][3]?** how actions are dispatched: `cdp` (real mouse and keyboard events) or `synthetic` (DOM events).
81
+ * `capabilities` **[object][4]?** browser capabilities; Kitesurf sets `{ layout: 'real', screenshot: true }`.
82
+ * `xpathPolyfill` **([string][3] | [boolean][17])?** inject an XPath polyfill for browsers with incomplete XPath support. `auto` detects when it is needed.
83
+ * `waitForTimeout` **[number][8]?** default timeout for wait* actions, in seconds.
84
+ * `waitForAction` **[number][8]?** fixed delay after each action, in milliseconds. When unset, actions wait only for the navigation they trigger.
85
+ * `pollInterval` **[number][8]?** interval between checks while waiting, in milliseconds.
86
+ * `getPageTimeout` **[number][8]?** maximum time to wait for a page to load, in seconds.
87
+ * `waitForNavigation` **[string][3]?** when a navigation is considered finished: `load`, `domcontentloaded`, or `networkidle`.
83
88
 
84
89
 
85
90
 
@@ -89,30 +94,1808 @@ Type: [object][5]
89
94
 
90
95
  * `config` **KitesurfConfig** 
91
96
 
92
- ### _finishTest
97
+ ### amOnPage
93
98
 
94
- Closes the target as `CDPBrowser._finishTest` does, then releases the cloud session acquired
95
- in `_resolveEndpoint` via the Cloudflare API so it does not linger for the full `keepAlive`
96
- window. The release runs in a `finally` so a rejection while closing the CDP connection still
97
- frees the cloud session instead of leaving the browser alive until `keepAlive` expires; the
98
- session id is cleared before the request, so a repeated call never releases it twice.
99
+ Opens a web page in a browser. Requires relative or absolute url.
100
+ If url starts with `/`, opens a web page of a site defined in `url` config parameter.
99
101
 
100
- ### _resolveEndpoint
102
+ ```js
103
+ I.amOnPage('/'); // opens main page of website
104
+ I.amOnPage('https://github.com'); // opens github
105
+ I.amOnPage('/login'); // opens a login page
106
+ ```
107
+
108
+ #### Parameters
109
+
110
+ * `url` **[string][3]** url path or global url.
111
+
112
+ Returns **void** automatically synchronized promise through #recorder
113
+
114
+ ### appendField
115
+
116
+ Appends text to a input field or textarea.
117
+ Field is located by name, label, CSS or XPath
118
+
119
+ The third parameter is an optional context (CSS or XPath locator) to narrow the search.
120
+
121
+ ```js
122
+ I.appendField('#myTextField', 'appended');
123
+ // typing secret
124
+ I.appendField('password', secret('123456'));
125
+ // within a context
126
+ I.appendField('name', 'John', '.form-container');
127
+ ```
128
+
129
+ #### Parameters
130
+
131
+ * `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator
132
+ * `value` **[string][3]** text value to append.
133
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
134
+
135
+ Returns **void** automatically synchronized promise through #recorder
136
+
137
+ ### attachFile
138
+
139
+ Attaches a file to element located by label, name, CSS or XPath
140
+ Path to file is relative current codecept directory (where codecept.conf.ts or codecept.conf.js is located).
141
+ File will be uploaded to remote system (if tests are running remotely).
142
+
143
+ The third parameter is an optional context (CSS or XPath locator) to narrow the search.
144
+
145
+ ```js
146
+ I.attachFile('Avatar', 'data/avatar.jpg');
147
+ I.attachFile('form input[name=avatar]', 'data/avatar.jpg');
148
+ // within a context
149
+ I.attachFile('Avatar', 'data/avatar.jpg', '.form-container');
150
+ ```
151
+
152
+ If the locator points to a non-file-input element (e.g., a dropzone area),
153
+ the file will be dropped onto that element using drag-and-drop events.
154
+
155
+ ```js
156
+ I.attachFile('#dropzone', 'data/avatar.jpg');
157
+ ```
158
+
159
+ #### Parameters
160
+
161
+ * `field`  
162
+ * `pathToFile` **[string][3]** local file path relative to codecept.conf.ts or codecept.conf.js config file.
163
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
164
+ * `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
165
+
166
+ Returns **void** automatically synchronized promise through #recorder
167
+
168
+ ### blur
169
+
170
+ Remove focus from a text input, button, etc.
171
+ Calls [blur][5] on the element.
172
+
173
+ Examples:
174
+
175
+ ```js
176
+ I.blur('.text-area')
177
+ ```
178
+
179
+ ```js
180
+ //element `#product-tile` is focused
181
+ I.see('#add-to-cart-btn');
182
+ I.blur('#product-tile')
183
+ I.dontSee('#add-to-cart-btn');
184
+ ```
185
+
186
+ #### Parameters
187
+
188
+ * `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
189
+ * `options` **any?** Playwright only: [Additional options][6] for available options object as 2nd argument.
190
+
191
+ Returns **void** automatically synchronized promise through #recorder
192
+
193
+ ### checkOption
194
+
195
+ Selects a checkbox or radio button.
196
+ Element is located by label or name or CSS or XPath.
197
+
198
+ The second parameter is an optional context (CSS or XPath locator) to narrow the search.
199
+
200
+ ```js
201
+ I.checkOption('#agree');
202
+ I.checkOption('I Agree to Terms and Conditions');
203
+ I.checkOption('agree', '//form');
204
+ ```
205
+
206
+ #### Parameters
207
+
208
+ * `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
209
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
210
+
211
+ Returns **void** automatically synchronized promise through #recorder
212
+
213
+ ### clearClipboard
214
+
215
+ Clears the system clipboard.
216
+
217
+ ```js
218
+ I.clearClipboard();
219
+ I.seeClipboardEquals('');
220
+ ```
221
+
222
+ Returns **void** automatically synchronized promise through #recorder
223
+
224
+ ### clearCookie
225
+
226
+ Clears a cookie by name,
227
+ if none provided clears all cookies.
228
+
229
+ ```js
230
+ I.clearCookie();
231
+ I.clearCookie('test');
232
+ ```
233
+
234
+ #### Parameters
235
+
236
+ * `name`  
237
+ * `cookie` **[string][3]?** (optional, `null` by default) cookie name
238
+
239
+ ### clearField
240
+
241
+ Clears a `<textarea>` or text `<input>` element's value.
242
+
243
+ The second parameter is an optional context (CSS or XPath locator) to narrow the search.
244
+
245
+ ```js
246
+ I.clearField('Email');
247
+ I.clearField('user[email]');
248
+ I.clearField('#email');
249
+ // within a context
250
+ I.clearField('Email', '.form-container');
251
+ ```
252
+
253
+ #### Parameters
254
+
255
+ * `field` &#x20;
256
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
257
+ * `editable` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
258
+
259
+ Returns **void** automatically synchronized promise through #recorder.
260
+
261
+ ### click
262
+
263
+ Perform a click on a link or a button, given by a locator.
264
+ If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
265
+ For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
266
+ For images, the "alt" attribute and inner text of any parent links are searched.
267
+
268
+ If no locator is provided, defaults to clicking the body element (`'//body'`).
269
+
270
+ The second parameter is a context (CSS or XPath locator) to narrow the search.
271
+
272
+ ```js
273
+ // click body element (default)
274
+ I.click();
275
+ // simple link
276
+ I.click('Logout');
277
+ // button of form
278
+ I.click('Submit');
279
+ // CSS button
280
+ I.click('#form input[type=submit]');
281
+ // XPath
282
+ I.click('//form/*[@type=submit]');
283
+ // link in context
284
+ I.click('Logout', '#nav');
285
+ // using strict locator
286
+ I.click({css: 'nav a.login'});
287
+ // using ARIA role locator
288
+ I.click({role: 'button', name: 'Submit'});
289
+ ```
290
+
291
+ > ℹ️ ARIA role locators (`{role, name}`) match elements the way assistive technology does and survive markup refactors. See [Locators][7].
292
+
293
+ #### Parameters
294
+
295
+ * `locator` **([string][3] | [object][4])** (optional, `'//body'` by default) clickable link or button located by text, or any element located by CSS|XPath|strict locator.
296
+ * `context` **([string][3]? | [object][4] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
297
+
298
+ Returns **void** automatically synchronized promise through #recorder
299
+
300
+ ### clickXY
301
+
302
+ Clicks at page coordinates, or at coordinates relative to an element.
303
+ Requires a browser that renders layout.
304
+
305
+ ```js
306
+ I.clickXY(100, 200); // page coordinates
307
+ I.clickXY('#area', 50, 30); // relative to #area
308
+ ```
309
+
310
+ #### Parameters
311
+
312
+ * `locator` **([string][3] | [object][4] | [number][8])** element to click relative to, or the X page coordinate.
313
+ * `x` **[number][8]?** X coordinate relative to the element, or the Y page coordinate if `locator` is a number.
314
+ * `y` **[number][8]?** Y coordinate relative to the element.
315
+
316
+ Returns **void** automatically synchronized promise through #recorder
317
+
318
+ ### dontSee
319
+
320
+ Opposite to `see`. Checks that a text is not present on a page.
321
+ Use context parameter to narrow down the search.
322
+
323
+ ```js
324
+ I.dontSee('Login'); // assume we are already logged in.
325
+ I.dontSee('Login', '.nav'); // no login inside .nav element
326
+ ```
327
+
328
+ #### Parameters
329
+
330
+ * `text` **[string][3]** which is not present.
331
+ * `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
332
+
333
+ Returns **void** automatically synchronized promise through #recorder
334
+
335
+ ### dontSeeCheckboxIsChecked
336
+
337
+ Verifies that the specified checkbox is not checked.
338
+
339
+ ```js
340
+ I.dontSeeCheckboxIsChecked('#agree'); // located by ID
341
+ I.dontSeeCheckboxIsChecked('I agree to terms'); // located by label
342
+ I.dontSeeCheckboxIsChecked('agree'); // located by name
343
+ ```
344
+
345
+ #### Parameters
346
+
347
+ * `locator` &#x20;
348
+ * `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
349
+
350
+ Returns **void** automatically synchronized promise through #recorder
351
+
352
+ ### dontSeeCookie
353
+
354
+ Checks that cookie with given name does not exist.
355
+
356
+ ```js
357
+ I.dontSeeCookie('auth'); // no auth cookie
358
+ ```
359
+
360
+ #### Parameters
361
+
362
+ * `name` **[string][3]** cookie name.
363
+
364
+ Returns **void** automatically synchronized promise through #recorder
365
+
366
+ ### dontSeeCurrentPathEquals
367
+
368
+ Checks that current URL path does NOT match the expected path.
369
+ Query strings and URL fragments are ignored.
370
+
371
+ ```js
372
+ I.dontSeeCurrentPathEquals('/form'); // fails for '/form', '/form?user=1', '/form#section'
373
+ I.dontSeeCurrentPathEquals('/'); // fails for '/', '/?user=ok', '/#top'
374
+ ```
375
+
376
+ #### Parameters
377
+
378
+ * `path` **[string][3]** value to check.
379
+
380
+ Returns **void** automatically synchronized promise through #recorder
381
+
382
+ ### dontSeeCurrentUrlEquals
383
+
384
+ Checks that current url is not equal to provided one.
385
+ If a relative url provided, a configured url will be prepended to it.
386
+
387
+ ```js
388
+ I.dontSeeCurrentUrlEquals('/login'); // relative url are ok
389
+ I.dontSeeCurrentUrlEquals('http://mysite.com/login'); // absolute urls are also ok
390
+ ```
391
+
392
+ #### Parameters
393
+
394
+ * `url` **[string][3]** value to check.
395
+
396
+ Returns **void** automatically synchronized promise through #recorder
397
+
398
+ ### dontSeeElement
399
+
400
+ Opposite to `seeElement`. Checks that element is not visible (or in DOM)
401
+
402
+ The second parameter is a context (CSS or XPath locator) to narrow the search.
403
+
404
+ ```js
405
+ I.dontSeeElement('.modal'); // modal is not shown
406
+ I.dontSeeElement('.modal', '#container');
407
+ ```
408
+
409
+ #### Parameters
410
+
411
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator.
412
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
413
+
414
+ Returns **void** automatically synchronized promise through #recorder
415
+
416
+ ### dontSeeElementInDOM
417
+
418
+ Opposite to `seeElementInDOM`. Checks that element is not on page.
419
+
420
+ ```js
421
+ I.dontSeeElementInDOM('.nav'); // checks that element is not on page visible or not
422
+ ```
423
+
424
+ #### Parameters
425
+
426
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|Strict locator.
427
+
428
+ Returns **void** automatically synchronized promise through #recorder
429
+
430
+ ### dontSeeInCurrentUrl
431
+
432
+ Checks that current url does not contain a provided fragment.
433
+
434
+ #### Parameters
435
+
436
+ * `url` **[string][3]** value to check.
437
+
438
+ Returns **void** automatically synchronized promise through #recorder
439
+
440
+ ### dontSeeInField
441
+
442
+ Checks that value of input field or textarea doesn't equal to given value
443
+ Opposite to `seeInField`.
444
+
445
+ The third parameter is an optional context (CSS or XPath locator) to narrow the search.
446
+
447
+ ```js
448
+ I.dontSeeInField('email', 'user@user.com'); // field by name
449
+ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
450
+ // within a context
451
+ I.dontSeeInField('Name', 'old_value', '.form-container');
452
+ ```
453
+
454
+ #### Parameters
455
+
456
+ * `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
457
+ * `value` **([string][3] | [object][4])** value to check.
458
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
459
+
460
+ Returns **void** automatically synchronized promise through #recorder
461
+
462
+ ### dontSeeInSource
463
+
464
+ Checks that the current page does not contains the given string in its raw source code.
465
+
466
+ ```js
467
+ I.dontSeeInSource('<!--'); // no comments in source
468
+ ```
469
+
470
+ #### Parameters
471
+
472
+ * `text` &#x20;
473
+ * `value` **[string][3]** to check.
474
+
475
+ Returns **void** automatically synchronized promise through #recorder
476
+
477
+ ### dontSeeInTitle
478
+
479
+ Checks that title does not contain text.
480
+
481
+ ```js
482
+ I.dontSeeInTitle('Error');
483
+ ```
484
+
485
+ #### Parameters
486
+
487
+ * `text` **[string][3]** value to check.
488
+
489
+ Returns **void** automatically synchronized promise through #recorder
490
+
491
+ ### dontSeeTraffic
492
+
493
+ Verifies that a certain request is not part of network traffic.
494
+
495
+ Examples:
496
+
497
+ ```js
498
+ I.dontSeeTraffic({ name: 'Unexpected API Call', url: 'https://api.example.com' });
499
+ I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.example.com.*user/ });
500
+ ```
501
+
502
+ #### Parameters
503
+
504
+ * `opts` **[Object][4]** options when checking the traffic network.
505
+
506
+ * `opts.name` **[string][3]** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
507
+ * `opts.url` **([string][3] | [RegExp][9])** Expected URL of request in network traffic. Can be a string or a regular expression.
508
+
509
+ Returns **void** automatically synchronized promise through #recorder
510
+
511
+ ### doubleClick
512
+
513
+ Performs a double-click on an element matched by link|button|label|CSS or XPath.
514
+ Context can be specified as second parameter to narrow search.
515
+
516
+ ```js
517
+ I.doubleClick('Edit');
518
+ I.doubleClick('Edit', '.actions');
519
+ I.doubleClick({css: 'button.accept'});
520
+ I.doubleClick('.btn.edit');
521
+ ```
522
+
523
+ #### Parameters
524
+
525
+ * `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
526
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
527
+
528
+ Returns **void** automatically synchronized promise through #recorder
529
+
530
+ ### executeAsyncScript
531
+
532
+ Executes async script on page.
533
+ Provided function should execute a passed callback (as first argument) to signal it is finished.
534
+
535
+ Example: In Vue.js to make components completely rendered we are waiting for [nextTick][10].
536
+
537
+ ```js
538
+ I.executeAsyncScript(function(done) {
539
+ Vue.nextTick(done); // waiting for next tick
540
+ });
541
+ ```
542
+
543
+ By passing value to `done()` function you can return values.
544
+ Additional arguments can be passed as well, while `done` function is always last parameter in arguments list.
545
+
546
+ ```js
547
+ let val = await I.executeAsyncScript(function(url, done) {
548
+ // in browser context
549
+ $.ajax(url, { success: (data) => done(data); }
550
+ }, 'http://ajax.callback.url/');
551
+ ```
552
+
553
+ #### Parameters
554
+
555
+ * `fn` **([string][3] | [function][11])** function to be executed in browser context.
556
+ * `args` **...any** to be passed to function.
557
+
558
+ Returns **[Promise][12]<any>** script return value
559
+
560
+ ### executeScript
561
+
562
+ Executes sync script on a page.
563
+ Pass arguments to function as additional parameters.
564
+ Will return execution result to a test.
565
+ In this case you should use async function and await to receive results.
566
+
567
+ Example with jQuery DatePicker:
568
+
569
+ ```js
570
+ // change date of jQuery DatePicker
571
+ I.executeScript(function() {
572
+ // now we are inside browser context
573
+ $('date').datetimepicker('setDate', new Date());
574
+ });
575
+ ```
576
+
577
+ Can return values. Don't forget to use `await` to get them.
578
+
579
+ ```js
580
+ let date = await I.executeScript(function(el) {
581
+ // only basic types can be returned
582
+ return $(el).datetimepicker('getDate').toString();
583
+ }, '#date'); // passing jquery selector
584
+ ```
585
+
586
+ #### Parameters
587
+
588
+ * `fn` **([string][3] | [function][11])** function to be executed in browser context.
589
+ * `args` **...any** to be passed to function.
590
+
591
+ Returns **[Promise][12]<any>** script return value
592
+
593
+ ### fillField
594
+
595
+ Fills a text field or textarea, after clearing its value, with the given string.
596
+ Field is located by name, label, CSS, or XPath.
597
+
598
+ The third parameter is an optional context (CSS or XPath locator) to narrow the search.
599
+
600
+ ```js
601
+ // by label
602
+ I.fillField('Email', 'hello@world.com');
603
+ // by name
604
+ I.fillField('password', secret('123456'));
605
+ // by CSS
606
+ I.fillField('form#login input[name=username]', 'John');
607
+ // or by strict locator
608
+ I.fillField({css: 'form#login input[name=username]'}, 'John');
609
+ // by ARIA role locator
610
+ I.fillField({role: 'textbox', name: 'Email'}, 'hello@world.com');
611
+ // within a context
612
+ I.fillField('Name', 'John', '#section2');
613
+ ```
614
+
615
+ > ℹ️ ARIA role locators (`{role, name}`) match fields by their accessible name and survive markup refactors. See [Locators][7].
616
+
617
+ #### Parameters
618
+
619
+ * `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
620
+ * `value` **([string][3] | [object][4])** text value to fill.
621
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
622
+
623
+ Returns **void** automatically synchronized promise through #recorder
624
+
625
+ ### flushNetworkTraffics
626
+
627
+ Resets all recorded network requests.
628
+
629
+ ```js
630
+ I.flushNetworkTraffics();
631
+ ```
632
+
633
+ ### focus
634
+
635
+ Calls [focus][5] on the matching element.
636
+
637
+ Examples:
638
+
639
+ ```js
640
+ I.dontSee('#add-to-cart-btn');
641
+ I.focus('#product-tile')
642
+ I.see('#add-to-cart-bnt');
643
+ ```
644
+
645
+ #### Parameters
646
+
647
+ * `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
648
+ * `options` **any?** Playwright only: [Additional options][13] for available options object as 2nd argument.
649
+
650
+ Returns **void** automatically synchronized promise through #recorder
651
+
652
+ ### forceClick
653
+
654
+ Perform an emulated click on a link or a button, given by a locator.
655
+ Unlike normal click instead of sending native event, emulates a click with JavaScript.
656
+ This works on hidden, animated or inactive elements as well.
657
+
658
+ If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
659
+ For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
660
+ For images, the "alt" attribute and inner text of any parent links are searched.
661
+
662
+ The second parameter is a context (CSS or XPath locator) to narrow the search.
663
+
664
+ ```js
665
+ // simple link
666
+ I.forceClick('Logout');
667
+ // button of form
668
+ I.forceClick('Submit');
669
+ // CSS button
670
+ I.forceClick('#form input[type=submit]');
671
+ // XPath
672
+ I.forceClick('//form/*[@type=submit]');
673
+ // link in context
674
+ I.forceClick('Logout', '#nav');
675
+ // using strict locator
676
+ I.forceClick({css: 'nav a.login'});
677
+ ```
678
+
679
+ #### Parameters
680
+
681
+ * `locator` **([string][3] | [object][4])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
682
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
683
+
684
+ Returns **void** automatically synchronized promise through #recorder
685
+
686
+ ### grabAttributeFrom
687
+
688
+ Retrieves an attribute from an element located by CSS or XPath and returns it to test.
689
+ Resumes test execution, so **should be used inside async with `await`** operator.
690
+ If more than one element is found - attribute of first element is returned.
691
+
692
+ ```js
693
+ let hint = await I.grabAttributeFrom('#tooltip', 'title');
694
+ ```
695
+
696
+ #### Parameters
697
+
698
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
699
+ * `attr` **[string][3]** attribute name.
700
+
701
+ Returns **[Promise][12]<[string][3]>** attribute value
702
+
703
+ ### grabAttributeFromAll
704
+
705
+ Retrieves an array of attributes from elements located by CSS or XPath and returns it to test.
706
+ Resumes test execution, so **should be used inside async with `await`** operator.
707
+
708
+ ```js
709
+ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
710
+ ```
711
+
712
+ #### Parameters
713
+
714
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
715
+ * `attr` **[string][3]** attribute name.
716
+
717
+ Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
718
+
719
+ ### grabCookie
720
+
721
+ Gets a cookie object by name.
722
+ If none provided gets all cookies.
723
+ Resumes test execution, so **should be used inside async function with `await`** operator.
724
+
725
+ ```js
726
+ let cookie = await I.grabCookie('auth');
727
+ assert(cookie.value, '123456');
728
+ ```
729
+
730
+ #### Parameters
731
+
732
+ * `name` **[string][3]?** cookie name.
733
+
734
+ Returns **any** attribute value
735
+
736
+ ### grabCookies
737
+
738
+ Retrieves all cookies visible to the current page.
739
+ Resumes test execution, so **should be used inside async function with `await`** operator.
740
+
741
+ ```js
742
+ let cookies = await I.grabCookies();
743
+ ```
744
+
745
+ Returns **[Promise][12]<[Array][14]<CodeceptJS.Cookie>>** array of cookie objects.
746
+
747
+ ### grabCssPropertyFrom
748
+
749
+ Grab CSS property for given locator
750
+ Resumes test execution, so **should be used inside an async function with `await`** operator.
751
+ If more than one element is found - value of first element is returned.
752
+
753
+ ```js
754
+ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
755
+ ```
756
+
757
+ #### Parameters
758
+
759
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
760
+ * `cssProperty` **[string][3]** CSS property name.
761
+
762
+ Returns **[Promise][12]<[string][3]>** CSS value
763
+
764
+ ### grabCssPropertyFromAll
765
+
766
+ Grab array of CSS properties for given locator
767
+ Resumes test execution, so **should be used inside an async function with `await`** operator.
768
+
769
+ ```js
770
+ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
771
+ ```
772
+
773
+ #### Parameters
774
+
775
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
776
+ * `cssProperty` **[string][3]** CSS property name.
777
+
778
+ Returns **[Promise][12]<[Array][14]<[string][3]>>** CSS value
779
+
780
+ ### grabCurrentUrl
781
+
782
+ Get current URL from browser.
783
+ Resumes test execution, so should be used inside an async function.
784
+
785
+ ```js
786
+ let url = await I.grabCurrentUrl();
787
+ console.log(`Current URL is [${url}]`);
788
+ ```
789
+
790
+ Returns **[Promise][12]<[string][3]>** current URL
791
+
792
+ ### grabFromClipboard
793
+
794
+ Grabs the text content of the system clipboard and returns it to test.
795
+ Resumes test execution, so **should be used inside async function with `await`** operator.
796
+
797
+ ```js
798
+ I.click('Copy to clipboard');
799
+ let url = await I.grabFromClipboard();
800
+ ```
801
+
802
+ Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
803
+ in Chromium-based browsers, where read access is granted automatically.
804
+
805
+ Returns **[Promise][12]<[string][3]>** the system clipboard contents.
806
+
807
+ ### grabHTMLFrom
808
+
809
+ Retrieves the innerHTML from an element located by CSS or XPath and returns it to test.
810
+ Resumes test execution, so **should be used inside async function with `await`** operator.
811
+ If more than one element is found - HTML of first element is returned.
812
+
813
+ ```js
814
+ let postHTML = await I.grabHTMLFrom('#post');
815
+ ```
816
+
817
+ #### Parameters
818
+
819
+ * `locator` &#x20;
820
+ * `element` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
821
+
822
+ Returns **[Promise][12]<[string][3]>** HTML code for an element
823
+
824
+ ### grabHTMLFromAll
825
+
826
+ Retrieves all the innerHTML from elements located by CSS or XPath and returns it to test.
827
+ Resumes test execution, so **should be used inside async function with `await`** operator.
828
+
829
+ ```js
830
+ let postHTMLs = await I.grabHTMLFromAll('.post');
831
+ ```
832
+
833
+ #### Parameters
834
+
835
+ * `locator` &#x20;
836
+ * `element` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
837
+
838
+ Returns **[Promise][12]<[Array][14]<[string][3]>>** HTML code for an element
839
+
840
+ ### grabNumberOfElements
841
+
842
+ Grab number of elements by locator.
843
+ Resumes test execution, so **should be used inside async function with `await`** operator.
844
+
845
+ ```js
846
+ let numOfElements = await I.grabNumberOfElements('p');
847
+ ```
848
+
849
+ #### Parameters
850
+
851
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
852
+
853
+ Returns **[Promise][12]<[number][8]>** number of matched elements.
854
+
855
+ ### grabNumberOfVisibleElements
856
+
857
+ Grab number of visible elements by locator.
858
+ Resumes test execution, so **should be used inside async function with `await`** operator.
859
+
860
+ ```js
861
+ let numOfElements = await I.grabNumberOfVisibleElements('p');
862
+ ```
863
+
864
+ #### Parameters
865
+
866
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
867
+
868
+ Returns **[Promise][12]<[number][8]>** number of visible elements
869
+
870
+ ### grabPageScrollPosition
871
+
872
+ Retrieves a page scroll position and returns it to test.
873
+ Resumes test execution, so **should be used inside an async function with `await`** operator.
874
+
875
+ ```js
876
+ let { x, y } = await I.grabPageScrollPosition();
877
+ ```
878
+
879
+ Returns **[Promise][12]<PageScrollPosition>** scroll position
880
+
881
+ ### grabRecordedNetworkTraffics
882
+
883
+ Grab the recording network traffics
884
+
885
+ ```js
886
+ const traffics = await I.grabRecordedNetworkTraffics();
887
+ expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
888
+ expect(traffics[0].response.status).to.equal(200);
889
+ expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
890
+ ```
891
+
892
+ Returns **[Array][14]** recorded network traffics
893
+
894
+ ### grabSource
895
+
896
+ Retrieves page source and returns it to test.
897
+ Resumes test execution, so **should be used inside async function with `await`** operator.
898
+
899
+ ```js
900
+ let pageSource = await I.grabSource();
901
+ ```
902
+
903
+ Returns **[Promise][12]<[string][3]>** source code
904
+
905
+ ### grabTextFrom
906
+
907
+ Retrieves a text from an element located by CSS or XPath and returns it to test.
908
+ Resumes test execution, so **should be used inside async with `await`** operator.
909
+
910
+ ```js
911
+ let pin = await I.grabTextFrom('#pin');
912
+ ```
913
+
914
+ If multiple elements found returns first element.
915
+
916
+ #### Parameters
917
+
918
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
919
+
920
+ Returns **[Promise][12]<[string][3]>** attribute value
921
+
922
+ ### grabTextFromAll
923
+
924
+ Retrieves all texts from an element located by CSS or XPath and returns it to test.
925
+ Resumes test execution, so **should be used inside async with `await`** operator.
926
+
927
+ ```js
928
+ let pins = await I.grabTextFromAll('#pin li');
929
+ ```
930
+
931
+ #### Parameters
932
+
933
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
934
+
935
+ Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
936
+
937
+ ### grabTitle
938
+
939
+ Retrieves a page title and returns it to test.
940
+ Resumes test execution, so **should be used inside async with `await`** operator.
941
+
942
+ ```js
943
+ let title = await I.grabTitle();
944
+ ```
945
+
946
+ Returns **[Promise][12]<[string][3]>** title
947
+
948
+ ### grabValueFrom
949
+
950
+ Retrieves a value from a form element located by CSS or XPath and returns it to test.
951
+ Resumes test execution, so **should be used inside async function with `await`** operator.
952
+ If more than one element is found - value of first element is returned.
953
+
954
+ ```js
955
+ let email = await I.grabValueFrom('input[name=email]');
956
+ ```
957
+
958
+ #### Parameters
959
+
960
+ * `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
961
+
962
+ Returns **[Promise][12]<[string][3]>** attribute value
963
+
964
+ ### grabValueFromAll
965
+
966
+ Retrieves an array of value from a form located by CSS or XPath and returns it to test.
967
+ Resumes test execution, so **should be used inside async function with `await`** operator.
968
+
969
+ ```js
970
+ let inputs = await I.grabValueFromAll('//form/input');
971
+ ```
972
+
973
+ #### Parameters
974
+
975
+ * `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
976
+
977
+ Returns **[Promise][12]<[Array][14]<[string][3]>>** attribute value
978
+
979
+ ### grabWebElement
980
+
981
+ Grab WebElement for given locator
982
+ Resumes test execution, so **should be used inside an async function with `await`** operator.
983
+
984
+ ```js
985
+ const webElement = await I.grabWebElement('#button');
986
+ ```
987
+
988
+ #### Parameters
989
+
990
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
991
+
992
+ Returns **[Promise][12]<any>** WebElement of being used Web helper
993
+
994
+ ### grabWebElements
995
+
996
+ Grab WebElements for given locator
997
+ Resumes test execution, so **should be used inside an async function with `await`** operator.
998
+
999
+ ```js
1000
+ const webElements = await I.grabWebElements('#button');
1001
+ ```
1002
+
1003
+ #### Parameters
1004
+
1005
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1006
+
1007
+ Returns **[Promise][12]<any>** WebElement of being used Web helper
1008
+
1009
+ ### pressKey
1010
+
1011
+ Presses a key or a key combination on the focused element.
1012
+
1013
+ ```js
1014
+ I.pressKey('Enter');
1015
+ I.pressKey(['Control', 'a']);
1016
+ ```
1017
+
1018
+ #### Parameters
1019
+
1020
+ * `key` **([string][3] | [Array][14]<[string][3]>)** a key or an array of keys to combine (modifiers first).
1021
+
1022
+ Returns **void** automatically synchronized promise through #recorder
1023
+
1024
+ ### refreshPage
1025
+
1026
+ Reload the current page.
1027
+
1028
+ ```js
1029
+ I.refreshPage();
1030
+ ```
1031
+
1032
+ Returns **void** automatically synchronized promise through #recorder
1033
+
1034
+ ### resizeWindow
1035
+
1036
+ Resize the current window to provided width and height.
1037
+ First parameter can be set to `maximize`.
1038
+
1039
+ #### Parameters
1040
+
1041
+ * `width` **[number][8]** width in pixels or `maximize`.
1042
+ * `height` **[number][8]** height in pixels.
1043
+
1044
+ Returns **void** automatically synchronized promise through #recorder
1045
+
1046
+ ### rightClick
1047
+
1048
+ Performs right click on a clickable element matched by semantic locator, CSS or XPath.
1049
+
1050
+ ```js
1051
+ // right click element with id el
1052
+ I.rightClick('#el');
1053
+ // right click link or button with text "Click me"
1054
+ I.rightClick('Click me');
1055
+ // right click button with text "Click me" inside .context
1056
+ I.rightClick('Click me', '.context');
1057
+ ```
1058
+
1059
+ #### Parameters
1060
+
1061
+ * `locator` **([string][3] | [object][4])** clickable element located by CSS|XPath|strict locator.
1062
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|XPath|strict locator.
1063
+
1064
+ Returns **void** automatically synchronized promise through #recorder
1065
+
1066
+ ### saveElementScreenshot
1067
+
1068
+ Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
1069
+ Filename is relative to output folder.
1070
+
1071
+ ```js
1072
+ I.saveElementScreenshot(`#submit`,'debug.png');
1073
+ ```
1074
+
1075
+ #### Parameters
1076
+
1077
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1078
+ * `fileName` **[string][3]** file name to save.
1079
+
1080
+ Returns **void** automatically synchronized promise through #recorder
1081
+
1082
+ ### saveScreenshot
1083
+
1084
+ Saves a screenshot to the output folder (set in codecept.conf.ts or codecept.conf.js).
1085
+ Filename is relative to the output folder.
1086
+
1087
+ ```js
1088
+ I.saveScreenshot('debug.png');
1089
+ ```
1090
+
1091
+ #### Parameters
1092
+
1093
+ * `fileName` **[string][3]** file name to save.
1094
+
1095
+ Returns **void** automatically synchronized promise through #recorder
1096
+
1097
+ ### scrollPageToBottom
1098
+
1099
+ Scroll page to the bottom.
1100
+
1101
+ ```js
1102
+ I.scrollPageToBottom();
1103
+ ```
1104
+
1105
+ Returns **void** automatically synchronized promise through #recorder
1106
+
1107
+ ### scrollPageToTop
1108
+
1109
+ Scroll page to the top.
1110
+
1111
+ ```js
1112
+ I.scrollPageToTop();
1113
+ ```
1114
+
1115
+ Returns **void** automatically synchronized promise through #recorder
1116
+
1117
+ ### scrollTo
1118
+
1119
+ Scrolls to element matched by locator.
1120
+ Extra shift can be set with offsetX and offsetY options.
1121
+
1122
+ ```js
1123
+ I.scrollTo('footer');
1124
+ I.scrollTo('#submit', 5, 5);
1125
+ ```
1126
+
1127
+ #### Parameters
1128
+
1129
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
1130
+ * `offsetX` **[number][8]** (optional, `0` by default) X-axis offset.
1131
+ * `offsetY` **[number][8]** (optional, `0` by default) Y-axis offset.
1132
+
1133
+ Returns **void** automatically synchronized promise through #recorder
1134
+
1135
+ ### see
1136
+
1137
+ Checks that a page contains a visible text.
1138
+ Use context parameter to narrow down the search.
1139
+
1140
+ ```js
1141
+ I.see('Welcome'); // text welcome on a page
1142
+ I.see('Welcome', '.content'); // text inside .content div
1143
+ I.see('Register', {css: 'form.register'}); // use strict locator
1144
+ ```
1145
+
1146
+ #### Parameters
1147
+
1148
+ * `text` **[string][3]** expected on page.
1149
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1150
+
1151
+ Returns **void** automatically synchronized promise through #recorder
1152
+
1153
+ ### seeAttributesOnElements
1154
+
1155
+ Checks that all elements with given locator have given attributes.
1156
+
1157
+ ```js
1158
+ I.seeAttributesOnElements('//form', { method: "post"});
1159
+ ```
1160
+
1161
+ #### Parameters
1162
+
1163
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
1164
+ * `attributes` **[object][4]** attributes and their values to check.
1165
+
1166
+ Returns **void** automatically synchronized promise through #recorder
1167
+
1168
+ ### seeCheckboxIsChecked
1169
+
1170
+ Verifies that the specified checkbox is checked.
1171
+
1172
+ ```js
1173
+ I.seeCheckboxIsChecked('Agree');
1174
+ I.seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
1175
+ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
1176
+ ```
1177
+
1178
+ #### Parameters
1179
+
1180
+ * `locator` &#x20;
1181
+ * `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
1182
+
1183
+ Returns **void** automatically synchronized promise through #recorder
1184
+
1185
+ ### seeClipboardEquals
1186
+
1187
+ Checks that the system clipboard is equal to the given text.
1188
+
1189
+ ```js
1190
+ I.click('Copy to clipboard');
1191
+ I.seeClipboardEquals('https://codecept.io');
1192
+ ```
1193
+
1194
+ Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
1195
+ in Chromium-based browsers, where read access is granted automatically.
1196
+
1197
+ #### Parameters
1198
+
1199
+ * `text` **[string][3]** value to check.
1200
+
1201
+ Returns **void** automatically synchronized promise through #recorder
1202
+
1203
+ ### seeCookie
1204
+
1205
+ Checks that cookie with given name exists.
1206
+
1207
+ ```js
1208
+ I.seeCookie('Auth');
1209
+ ```
1210
+
1211
+ #### Parameters
1212
+
1213
+ * `name` **[string][3]** cookie name.
1214
+
1215
+ Returns **void** automatically synchronized promise through #recorder
1216
+
1217
+ ### seeCssPropertiesOnElements
1218
+
1219
+ Checks that all elements with given locator have given CSS properties.
1220
+
1221
+ ```js
1222
+ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
1223
+ ```
1224
+
1225
+ #### Parameters
1226
+
1227
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
1228
+ * `cssProperties` **[object][4]** object with CSS properties and their values to check.
1229
+
1230
+ Returns **void** automatically synchronized promise through #recorder
1231
+
1232
+ ### seeCurrentPathEquals
1233
+
1234
+ Checks that current URL path matches the expected path.
1235
+ Query strings and URL fragments are ignored.
1236
+
1237
+ ```js
1238
+ I.seeCurrentPathEquals('/info'); // passes for '/info', '/info?user=1', '/info#section'
1239
+ I.seeCurrentPathEquals('/'); // passes for '/', '/?user=ok', '/#top'
1240
+ ```
1241
+
1242
+ #### Parameters
1243
+
1244
+ * `path` **[string][3]** value to check.
1245
+
1246
+ Returns **void** automatically synchronized promise through #recorder
1247
+
1248
+ ### seeCurrentUrlEquals
1249
+
1250
+ Checks that current url is equal to provided one.
1251
+ If a relative url provided, a configured url will be prepended to it.
1252
+ So both examples will work:
1253
+
1254
+ ```js
1255
+ I.seeCurrentUrlEquals('/register');
1256
+ I.seeCurrentUrlEquals('http://my.site.com/register');
1257
+ ```
1258
+
1259
+ #### Parameters
1260
+
1261
+ * `url` **[string][3]** value to check.
1262
+
1263
+ Returns **void** automatically synchronized promise through #recorder
1264
+
1265
+ ### seeElement
1266
+
1267
+ Checks that a given Element is visible
1268
+ Element is located by CSS or XPath.
1269
+
1270
+ The second parameter is a context (CSS or XPath locator) to narrow the search.
1271
+
1272
+ ```js
1273
+ I.seeElement('#modal');
1274
+ I.seeElement('#modal', '#container');
1275
+ // using ARIA role locator
1276
+ I.seeElement({role: 'dialog'});
1277
+ ```
1278
+
1279
+ > ℹ️ ARIA role locators (`{role, name}`) match elements the way assistive technology does and survive markup refactors. See [Locators][7].
1280
+
1281
+ #### Parameters
1282
+
1283
+ * `locator` **([string][3] | [object][4])** located by CSS|XPath|strict locator.
1284
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
1285
+
1286
+ Returns **void** automatically synchronized promise through #recorder
1287
+
1288
+ ### seeElementInDOM
1289
+
1290
+ Checks that a given Element is present in the DOM
1291
+ Element is located by CSS or XPath.
1292
+
1293
+ ```js
1294
+ I.seeElementInDOM('#modal');
1295
+ ```
1296
+
1297
+ #### Parameters
1298
+
1299
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1300
+
1301
+ Returns **void** automatically synchronized promise through #recorder
1302
+
1303
+ ### seeInClipboard
1304
+
1305
+ Checks that the system clipboard contains the given text.
1306
+
1307
+ ```js
1308
+ I.click('Copy to clipboard');
1309
+ I.seeInClipboard('https://codecept.io');
1310
+ ```
1311
+
1312
+ Reading the clipboard requires a secure context (`https` or `localhost`) and is supported
1313
+ in Chromium-based browsers, where read access is granted automatically.
1314
+
1315
+ #### Parameters
1316
+
1317
+ * `text` **[string][3]** value to check.
101
1318
 
102
- Acquires a Kitesurf browser session from the Cloudflare Browser Run API and resolves it to
103
- the `wss://` debugger URL `CDPConnection` connects to. Overrides `CDPBrowser._resolveEndpoint`,
104
- which resolves a fixed local endpoint instead of provisioning a cloud session per test.
1319
+ Returns **void** automatically synchronized promise through #recorder
105
1320
 
106
- Returns **[Promise][3]<[string][4]>** a `wss://` debugger URL ready to be passed to `CDPConnection`.
1321
+ ### seeInCurrentUrl
1322
+
1323
+ Checks that current url contains a provided fragment.
1324
+
1325
+ ```js
1326
+ I.seeInCurrentUrl('/register'); // we are on registration page
1327
+ ```
1328
+
1329
+ #### Parameters
1330
+
1331
+ * `url` **[string][3]** a fragment to check
1332
+
1333
+ Returns **void** automatically synchronized promise through #recorder
1334
+
1335
+ ### seeInField
1336
+
1337
+ Checks that the given input field or textarea equals to given value.
1338
+ For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
1339
+
1340
+ The third parameter is an optional context (CSS or XPath locator) to narrow the search.
1341
+
1342
+ ```js
1343
+ I.seeInField('Username', 'davert');
1344
+ I.seeInField({css: 'form textarea'},'Type your comment here');
1345
+ I.seeInField('form input[type=hidden]','hidden_value');
1346
+ I.seeInField('#searchform input','Search');
1347
+ // within a context
1348
+ I.seeInField('Name', 'John', '.form-container');
1349
+ ```
1350
+
1351
+ #### Parameters
1352
+
1353
+ * `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
1354
+ * `value` **([string][3] | [object][4])** value to check.
1355
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
1356
+
1357
+ Returns **void** automatically synchronized promise through #recorder
1358
+
1359
+ ### seeInSource
1360
+
1361
+ Checks that the current page contains the given string in its raw source code.
1362
+
1363
+ ```js
1364
+ I.seeInSource('<h1>Green eggs &amp; ham</h1>');
1365
+ ```
1366
+
1367
+ #### Parameters
1368
+
1369
+ * `text` **[string][3]** value to check.
1370
+
1371
+ Returns **void** automatically synchronized promise through #recorder
1372
+
1373
+ ### seeInTitle
1374
+
1375
+ Checks that title contains text.
1376
+
1377
+ ```js
1378
+ I.seeInTitle('Home Page');
1379
+ ```
1380
+
1381
+ #### Parameters
1382
+
1383
+ * `text` **[string][3]** text value to check.
1384
+
1385
+ Returns **void** automatically synchronized promise through #recorder
1386
+
1387
+ ### seeNumberOfVisibleElements
1388
+
1389
+ Asserts that an element is visible a given number of times.
1390
+ Element is located by CSS or XPath.
1391
+
1392
+ ```js
1393
+ I.seeNumberOfVisibleElements('.buttons', 3);
1394
+ ```
1395
+
1396
+ #### Parameters
1397
+
1398
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1399
+ * `num` **[number][8]** number of elements.
1400
+
1401
+ Returns **void** automatically synchronized promise through #recorder
1402
+
1403
+ ### seeTraffic
1404
+
1405
+ Verifies that a certain request is part of network traffic.
1406
+
1407
+ ```js
1408
+ // checking the request url contains certain query strings
1409
+ I.amOnPage('https://openai.com/blog/chatgpt');
1410
+ I.startRecordingTraffic();
1411
+ await I.seeTraffic({
1412
+ name: 'sentry event',
1413
+ url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
1414
+ parameters: {
1415
+ width: '1919',
1416
+ height: '1138',
1417
+ },
1418
+ });
1419
+ ```
1420
+
1421
+ ```js
1422
+ // checking the request url contains certain post data
1423
+ I.amOnPage('https://openai.com/blog/chatgpt');
1424
+ I.startRecordingTraffic();
1425
+ await I.seeTraffic({
1426
+ name: 'event',
1427
+ url: 'https://cloudflareinsights.com/cdn-cgi/rum',
1428
+ requestPostData: {
1429
+ st: 2,
1430
+ },
1431
+ });
1432
+ ```
1433
+
1434
+ #### Parameters
1435
+
1436
+ * `opts` **[Object][4]** options when checking the traffic network.
1437
+
1438
+ * `opts.name` **[string][3]** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
1439
+ * `opts.url` **[string][3]** Expected URL of request in network traffic
1440
+ * `opts.parameters` **[Object][4]?** Expected parameters of that request in network traffic
1441
+ * `opts.requestPostData` **[Object][4]?** Expected that request contains post data in network traffic
1442
+ * `opts.timeout` **[number][8]?** Timeout to wait for request in seconds. Default is 10 seconds.
1443
+
1444
+ Returns **void** automatically synchronized promise through #recorder
1445
+
1446
+ ### selectOption
1447
+
1448
+ Selects an option in a drop-down select.
1449
+ Field is searched by label | name | CSS | XPath.
1450
+ Option is selected by visible text or by value.
1451
+
1452
+ The third parameter is an optional context (CSS or XPath locator) to narrow the search.
1453
+
1454
+ ```js
1455
+ I.selectOption('Choose Plan', 'Monthly'); // select by label
1456
+ I.selectOption('subscription', 'Monthly'); // match option by text
1457
+ I.selectOption('subscription', '0'); // or by value
1458
+ I.selectOption('//form/select[@name=account]','Premium');
1459
+ I.selectOption('form select[name=account]', 'Premium');
1460
+ I.selectOption({css: 'form select[name=account]'}, 'Premium');
1461
+ // within a context
1462
+ I.selectOption('age', '21-60', '#section2');
1463
+ ```
1464
+
1465
+ Provide an array for the second argument to select multiple options.
1466
+
1467
+ ```js
1468
+ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
1469
+ ```
1470
+
1471
+ #### Parameters
1472
+
1473
+ * `select` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
1474
+ * `option` **([string][3] | [Array][14]<any>)** visible text or value of option.
1475
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
1476
+
1477
+ Returns **void** automatically synchronized promise through #recorder
1478
+
1479
+ ### setCookie
1480
+
1481
+ Sets cookie(s).
1482
+
1483
+ Can be a single cookie object or an array of cookies:
1484
+
1485
+ ```js
1486
+ I.setCookie({name: 'auth', value: true});
1487
+
1488
+ // as array
1489
+ I.setCookie([
1490
+ {name: 'auth', value: true},
1491
+ {name: 'agree', value: true}
1492
+ ]);
1493
+ ```
1494
+
1495
+ #### Parameters
1496
+
1497
+ * `cookie` **(Cookie | [Array][14]<Cookie>)** a cookie object or array of cookie objects.
1498
+
1499
+ Returns **void** automatically synchronized promise through #recorder
1500
+
1501
+ ### startRecordingTraffic
1502
+
1503
+ Starts recording the network traffics.
1504
+ This also resets recorded network requests.
1505
+
1506
+ ```js
1507
+ I.startRecordingTraffic();
1508
+ ```
1509
+
1510
+ Returns **void** automatically synchronized promise through #recorder
1511
+
1512
+ ### startScreencast
1513
+
1514
+ Starts recording a video of the page. Stop it with `stopScreencast`.
1515
+ Usually enabled through the `screencast` plugin rather than called directly.
1516
+
1517
+ ```js
1518
+ I.startScreencast();
1519
+ ```
1520
+
1521
+ #### Parameters
1522
+
1523
+ * `options` **[object][4]?** `{ maxWidth, maxHeight, quality, everyNthFrame }`
1524
+
1525
+ Returns **void** automatically synchronized promise through #recorder
1526
+
1527
+ ### stopRecordingTraffic
1528
+
1529
+ Stops recording of network traffic. Recorded traffic is not flashed.
1530
+
1531
+ ```js
1532
+ I.stopRecordingTraffic();
1533
+ ```
1534
+
1535
+ ### stopScreencast
1536
+
1537
+ Stops the recording started by `startScreencast` and returns it as an animated PNG.
1538
+
1539
+ ```js
1540
+ const video = await I.stopScreencast();
1541
+ ```
1542
+
1543
+ #### Parameters
1544
+
1545
+ * `options` **[object][4]?** `{ lastFrameDelayMs }`: how long the last frame is shown, in milliseconds (1000 by default).
1546
+
1547
+ Returns **[Promise][12]<([Buffer][15] | null)>** APNG data, or `null` if no frames were recorded.
1548
+
1549
+ ### type
1550
+
1551
+ Types out the given text into an active field.
1552
+ To slow down typing use a second parameter, to set interval between key presses.
1553
+ *Note:* Should be used when [`fillField`][16] is not an option.
1554
+
1555
+ ```js
1556
+ // passing in a string
1557
+ I.type('Type this out.');
1558
+
1559
+ // typing values with a 100ms interval
1560
+ I.type('4141555311111111', 100);
1561
+
1562
+ // passing in an array
1563
+ I.type(['T', 'E', 'X', 'T']);
1564
+
1565
+ // passing a secret
1566
+ I.type(secret('123456'));
1567
+ ```
1568
+
1569
+ #### Parameters
1570
+
1571
+ * `keys` &#x20;
1572
+ * `delay` **[number][8]?** (optional) delay in ms between key presses
1573
+ * `key` **([string][3] | [Array][14]<[string][3]>)** or array of keys to type.
1574
+
1575
+ Returns **void** automatically synchronized promise through #recorder
1576
+
1577
+ ### uncheckOption
1578
+
1579
+ Unselects a checkbox or radio button.
1580
+ Element is located by label or name or CSS or XPath.
1581
+
1582
+ The second parameter is an optional context (CSS or XPath locator) to narrow the search.
1583
+
1584
+ ```js
1585
+ I.uncheckOption('#agree');
1586
+ I.uncheckOption('I Agree to Terms and Conditions');
1587
+ I.uncheckOption('agree', '//form');
1588
+ ```
1589
+
1590
+ #### Parameters
1591
+
1592
+ * `field` **([string][3] | [object][4])** checkbox located by label | name | CSS | XPath | strict locator.
1593
+ * `context` **([string][3]? | [object][4])** (optional, `null` by default) element located by CSS | XPath | strict locator.
1594
+
1595
+ Returns **void** automatically synchronized promise through #recorder
1596
+
1597
+ ### wait
1598
+
1599
+ Pauses execution for a number of seconds.
1600
+
1601
+ ```js
1602
+ I.wait(2); // wait 2 secs
1603
+ ```
1604
+
1605
+ #### Parameters
1606
+
1607
+ * `sec` **[number][8]** number of second to wait.
1608
+
1609
+ Returns **void** automatically synchronized promise through #recorder
1610
+
1611
+ ### waitCurrentPathEquals
1612
+
1613
+ Waits for the current URL path to match the expected path.
1614
+ Query strings and URL fragments are ignored.
1615
+
1616
+ ```js
1617
+ I.waitCurrentPathEquals('/info', 5);
1618
+ ```
1619
+
1620
+ #### Parameters
1621
+
1622
+ * `path` **[string][3]** value to check.
1623
+ * `sec` **[number][8]?** (optional, `waitForTimeout` by default) time in seconds to wait
1624
+
1625
+ Returns **void** automatically synchronized promise through #recorder
1626
+
1627
+ ### waitForCookie
1628
+
1629
+ Waits for the specified cookie in the cookies.
1630
+
1631
+ ```js
1632
+ I.waitForCookie("token");
1633
+ ```
1634
+
1635
+ #### Parameters
1636
+
1637
+ * `name` **[string][3]** expected cookie name.
1638
+ * `sec` **[number][8]** (optional, `3` by default) time in seconds to wait
1639
+
1640
+ Returns **void** automatically synchronized promise through #recorder
1641
+
1642
+ ### waitForDetached
1643
+
1644
+ Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
1645
+ Element can be located by CSS or XPath.
1646
+
1647
+ ```js
1648
+ I.waitForDetached('#popup');
1649
+ ```
1650
+
1651
+ #### Parameters
1652
+
1653
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1654
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1655
+
1656
+ Returns **void** automatically synchronized promise through #recorder
1657
+
1658
+ ### waitForElement
1659
+
1660
+ Waits for element to be present on page (by default waits for 1sec).
1661
+ Element can be located by CSS or XPath.
1662
+
1663
+ ```js
1664
+ I.waitForElement('.btn.continue');
1665
+ I.waitForElement('.btn.continue', 5); // wait for 5 secs
1666
+ ```
1667
+
1668
+ #### Parameters
1669
+
1670
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1671
+ * `sec` **[number][8]?** (optional, `1` by default) time in seconds to wait
1672
+
1673
+ Returns **void** automatically synchronized promise through #recorder
1674
+
1675
+ ### waitForFunction
1676
+
1677
+ Waits for a function to return true (waits for 1 sec by default).
1678
+ Running in browser context.
1679
+
1680
+ ```js
1681
+ I.waitForFunction(fn[, [args[, timeout]])
1682
+ ```
1683
+
1684
+ ```js
1685
+ I.waitForFunction(() => window.requests == 0);
1686
+ I.waitForFunction(() => window.requests == 0, 5); // waits for 5 sec
1687
+ I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
1688
+ ```
1689
+
1690
+ #### Parameters
1691
+
1692
+ * `fn` **([string][3] | [function][11])** to be executed in browser context.
1693
+ * `argsOrSec` **([Array][14]<any> | [number][8])?** (optional, `1` by default) arguments for function or seconds.
1694
+ * `sec` **[number][8]?** (optional, `1` by default) time in seconds to wait
1695
+
1696
+ Returns **void** automatically synchronized promise through #recorder
1697
+
1698
+ ### waitForInvisible
1699
+
1700
+ Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
1701
+ Element can be located by CSS or XPath.
1702
+
1703
+ ```js
1704
+ I.waitForInvisible('#popup');
1705
+ ```
1706
+
1707
+ #### Parameters
1708
+
1709
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1710
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1711
+
1712
+ Returns **void** automatically synchronized promise through #recorder
1713
+
1714
+ ### waitForText
1715
+
1716
+ Waits for a text to appear (by default waits for 1sec).
1717
+ Element can be located by CSS or XPath.
1718
+ Narrow down search results by providing context.
1719
+
1720
+ ```js
1721
+ I.waitForText('Thank you, form has been submitted');
1722
+ I.waitForText('Thank you, form has been submitted', 5, '#modal');
1723
+ ```
1724
+
1725
+ #### Parameters
1726
+
1727
+ * `text` **[string][3]** to wait for.
1728
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1729
+ * `context` **([string][3] | [object][4])?** (optional) element located by CSS|XPath|strict locator.
1730
+
1731
+ Returns **void** automatically synchronized promise through #recorder
1732
+
1733
+ ### waitForVisible
1734
+
1735
+ Waits for an element to become visible on a page (by default waits for 1sec).
1736
+ Element can be located by CSS or XPath.
1737
+
1738
+ ```js
1739
+ I.waitForVisible('#popup');
1740
+ ```
1741
+
1742
+ #### Parameters
1743
+
1744
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1745
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1746
+
1747
+ Returns **void** automatically synchronized promise through #recorder
1748
+
1749
+ ### waitInUrl
1750
+
1751
+ Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
1752
+
1753
+ ```js
1754
+ I.waitInUrl('/info', 2);
1755
+ ```
1756
+
1757
+ #### Parameters
1758
+
1759
+ * `urlPart` **[string][3]** value to check.
1760
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1761
+
1762
+ Returns **void** automatically synchronized promise through #recorder
1763
+
1764
+ ### waitToHide
1765
+
1766
+ Waits for an element to hide (by default waits for 1sec).
1767
+ Element can be located by CSS or XPath.
1768
+
1769
+ ```js
1770
+ I.waitToHide('#popup');
1771
+ ```
1772
+
1773
+ #### Parameters
1774
+
1775
+ * `locator` **([string][3] | [object][4])** element located by CSS|XPath|strict locator.
1776
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1777
+
1778
+ Returns **void** automatically synchronized promise through #recorder
1779
+
1780
+ ### waitUrlEquals
1781
+
1782
+ Waits for the entire URL to match the expected
1783
+
1784
+ ```js
1785
+ I.waitUrlEquals('/info', 2);
1786
+ I.waitUrlEquals('http://127.0.0.1:8000/info');
1787
+ ```
1788
+
1789
+ #### Parameters
1790
+
1791
+ * `urlPart` **[string][3]** value to check.
1792
+ * `sec` **[number][8]** (optional, `1` by default) time in seconds to wait
1793
+
1794
+ Returns **void** automatically synchronized promise through #recorder
1795
+
1796
+ ### _connect
1797
+
1798
+ In SELF-MANAGED mode, resolves and spawns the browser server (or courtesy-attaches to an
1799
+ already-running one on :9222) exactly once via `_resolveSelfManaged`. Then resolves the CDP
1800
+ endpoint and opens the underlying `CDPConnection`, storing it on `this.cdp`.
1801
+
1802
+ ### _findFreePort
1803
+
1804
+ Picks a free TCP port on 127.0.0.1 by briefly listening on port 0 and reading back the
1805
+ OS-assigned port. Used when `options.port` isn't explicitly set, so multiple `run-workers`
1806
+ workers never collide on the same port.
1807
+
1808
+ Returns **[Promise][12]<[number][8]>** a free port.
1809
+
1810
+ ### _manageServer
1811
+
1812
+ Opts a subclass into managing its own browser server process. Called from a subclass
1813
+ constructor with the raw user config and a server descriptor:
1814
+
1815
+ * `name` — binary name looked up on `PATH`, also used in messages
1816
+ * `envVar` — environment variable that may point at the binary
1817
+ * `args(port)` — arguments the binary is spawned with to serve CDP on `port`
1818
+ * `env` — extra environment variables for the spawned process
1819
+ * `releases` — URL shown when no binary can be resolved
1820
+
1821
+ An explicit `endpoint` in the user config always wins: the helper stays in ATTACH mode and
1822
+ never spawns or kills anything. Otherwise the helper becomes SELF-MANAGED and the default
1823
+ `endpoint` is cleared until `_resolveSelfManaged` sets the real one.
1824
+
1825
+ #### Parameters
1826
+
1827
+ * `config` **[object][4]** the config object the helper was constructed with.
1828
+ * `server` **[object][4]** the server descriptor described above.
1829
+
1830
+ ### _probeUp
1831
+
1832
+ Probes a `/json/version`-style URL with a short timeout, used for the courtesy-attach check.
1833
+
1834
+ #### Parameters
1835
+
1836
+ * `url` **[string][3]**&#x20;
1837
+
1838
+ Returns **[Promise][12]<[boolean][17]>** true if the URL answered.
1839
+
1840
+ ### _resolveBinary
1841
+
1842
+ Resolves the binary to spawn, in priority order: `options.binaryPath`, then the server
1843
+ descriptor's environment variable, then its name on `PATH`. The `PATH` lookup walks the
1844
+ directories itself instead of shelling out to `which`, which does not exist on Windows: on
1845
+ Windows every `PATHEXT` suffix is tried, so a `.exe` on `PATH` is found too.
1846
+
1847
+ Returns **([string][3] | null)** an absolute or relative path to the binary, or null if none resolved.
1848
+
1849
+ ### _resolveSelfManaged
1850
+
1851
+ Resolves how to reach a SELF-MANAGED browser, trying, in order: spawn a binary
1852
+ (`binaryPath` config, then the descriptor's `envVar`, then its `name` on `PATH`) on
1853
+ `options.port` or a free port, courtesy-attach to `http://127.0.0.1:9222` if something already
1854
+ answers there (never killed by this helper), or throw a loud, actionable error. Sets
1855
+ `this.options.endpoint` as a side effect.
1856
+
1857
+ A spawn failure (e.g. a bad binary) is delivered asynchronously by Node as an `error` event;
1858
+ it is recorded on `this.serverError` and surfaced as a rejection from `_waitForServer` instead
1859
+ of crashing the process as an uncaught exception.
1860
+
1861
+ ### _waitForServer
1862
+
1863
+ Polls `http://127.0.0.1:<port>/json/version` until the spawned server responds,
1864
+ `this.serverError` is set by the process' `error` event, or `options.serverStartTimeout`
1865
+ elapses. The process typically comes up within tens of milliseconds — a 20ms retry interval
1866
+ keeps the wasted tail after the server is actually ready small, since this cost is paid once
1867
+ per run and counts directly toward real-world startup latency.
107
1868
 
108
1869
  [1]: https://developers.cloudflare.com/browser-run/
109
1870
 
110
1871
  [2]: https://blog.cloudflare.com/kitesurf/
111
1872
 
112
- [3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
1873
+ [3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
1874
+
1875
+ [4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1876
+
1877
+ [5]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
1878
+
1879
+ [6]: https://playwright.dev/docs/api/class-locator#locator-blur
1880
+
1881
+ [7]: /locators#aria-locators
1882
+
1883
+ [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1884
+
1885
+ [9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp
1886
+
1887
+ [10]: https://vuejs.org/v2/api/#Vue-nextTick
1888
+
1889
+ [11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
1890
+
1891
+ [12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
1892
+
1893
+ [13]: https://playwright.dev/docs/api/class-locator#locator-focus
1894
+
1895
+ [14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
113
1896
 
114
- [4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
1897
+ [15]: https://nodejs.org/api/buffer.html
115
1898
 
116
- [5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
1899
+ [16]: #fillfield
117
1900
 
118
- [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
1901
+ [17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean