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