@types/k6 0.44.0 → 0.44.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,1432 @@
1
+ import {
2
+ BrowserContext,
3
+ EvaluationArgument,
4
+ PageFunction,
5
+ SelectOptionsObject,
6
+ KeyboardModifier,
7
+ MouseButton,
8
+ ScreenshotOptions,
9
+ NavigationOptions } from "./";
10
+ import { Touchscreen } from "./touchscreen";
11
+ import { Response } from "./response";
12
+ import { Locator } from "./locator";
13
+ import { JSHandle } from "./js_handle";
14
+ import { Keyboard } from "./keyboard";
15
+ import { Mouse } from "./mouse";
16
+ import { ElementHandle } from "./element_handle";
17
+ import { Frame } from "./frame";
18
+ import { Worker } from "./worker";
19
+
20
+ /**
21
+ * Page provides methods to interact with a single tab in a running web browser
22
+ * instance. One instance of the browser can have many page instances.
23
+ */
24
+ export class Page {
25
+ /**
26
+ * Activates the browser tab so that it comes into focus and actions can be
27
+ * performed against it.
28
+ */
29
+ bringToFront(): void;
30
+
31
+ /**
32
+ * **NOTE** Use locator-based `locator.check([options])` instead.
33
+ *
34
+ * This method is used to select an input checkbox.
35
+ * @param selector A selector to search for an element. If there are multiple
36
+ * elements satisfying the selector, the first will be used.
37
+ * @param options
38
+ */
39
+ check(selector: string, options?: {
40
+ /**
41
+ * Setting this to `true` will bypass the actionability checks (visible,
42
+ * stable, enabled). Defaults to `false`.
43
+ */
44
+ force?: boolean;
45
+
46
+ /**
47
+ * If set to `true` and a navigation occurs from performing this action, it
48
+ * will not wait for it to complete. Defaults to `false`.
49
+ */
50
+ noWaitAfter?: boolean;
51
+
52
+ /**
53
+ * A point to use relative to the top left corner of the element. If not
54
+ * supplied, a visible point of the element is used.
55
+ */
56
+ position?: {
57
+ x: number;
58
+
59
+ y: number;
60
+ };
61
+
62
+ /**
63
+ * When `true`, the call requires selector to resolve to a single element.
64
+ * If given selector resolves to more than one element, the call throws
65
+ * an exception. Defaults to `false`.
66
+ */
67
+ strict?: boolean;
68
+
69
+ /**
70
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
71
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
72
+ * `page` methods.
73
+ *
74
+ * Setting the value to `0` will disable the timeout.
75
+ */
76
+ timeout?: number;
77
+
78
+ /**
79
+ * Setting this to `true` will perform the actionability checks without
80
+ * performing the action. Useful to wait until the element is ready for the
81
+ * action without performing it. Defaults to `false`.
82
+ */
83
+ trial?: boolean;
84
+ }): void;
85
+
86
+ /**
87
+ * **NOTE** Use locator-based `locator.click([options])` instead.
88
+ *
89
+ * This method clicks an element matching `selector`.
90
+ * @param selector A selector to search for an element. If there are multiple
91
+ * elements satisfying the selector, the first will be used.
92
+ * @param options
93
+ */
94
+ click(selector: string, options?: {
95
+ /**
96
+ * The mouse button (`left`, `middle` or `right`) to use during the action.
97
+ * Defaults to `left`.
98
+ */
99
+ button?: MouseButton;
100
+
101
+ /**
102
+ * The number of times the action is performed. Defaults to `1`.
103
+ */
104
+ clickCount?: number;
105
+
106
+ /**
107
+ * Milliseconds to wait between `mousedown` and `mouseup`. Defaults to `0`.
108
+ */
109
+ delay?: number;
110
+
111
+ /**
112
+ * Setting this to `true` will bypass the actionability checks (`visible`,
113
+ * `stable`, `enabled`). Defaults to `false`.
114
+ */
115
+ force?: boolean;
116
+
117
+ /**
118
+ * `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the
119
+ * action. If not specified, currently pressed modifiers are used,
120
+ * otherwise defaults to `null`.
121
+ */
122
+ modifiers?: KeyboardModifier[];
123
+
124
+ /**
125
+ * If set to `true` and a navigation occurs from performing this action, it
126
+ * will not wait for it to complete. Defaults to `false`.
127
+ */
128
+ noWaitAfter?: boolean;
129
+
130
+ /**
131
+ * A point to use relative to the top left corner of the element. If not
132
+ * supplied, a visible point of the element is used.
133
+ */
134
+ position?: {
135
+ x: number;
136
+
137
+ y: number;
138
+ };
139
+
140
+ /**
141
+ * When `true`, the call requires selector to resolve to a single element.
142
+ * If given selector resolves to more than one element, the call throws
143
+ * an exception. Defaults to `false`.
144
+ */
145
+ strict?: boolean;
146
+
147
+ /**
148
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
149
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
150
+ * `page` methods.
151
+ *
152
+ * Setting the value to `0` will disable the timeout.
153
+ */
154
+ timeout?: number;
155
+
156
+ /**
157
+ * Setting this to `true` will perform the actionability checks without
158
+ * performing the action. Useful to wait until the element is ready for the
159
+ * action without performing it. Defaults to `false`.
160
+ */
161
+ trial?: boolean;
162
+ }): Promise<void>;
163
+
164
+ /**
165
+ * This will close the tab that this page is associated with.
166
+ */
167
+ close(): void;
168
+
169
+ /**
170
+ * Gets the HTML contents of the page.
171
+ */
172
+ content(): string;
173
+
174
+ /**
175
+ * Gets the `BrowserContext` that the page belongs to.
176
+ */
177
+ context(): BrowserContext;
178
+
179
+ /**
180
+ * **NOTE** Use locator-based `locator.dblclick([options])` instead.
181
+ *
182
+ * Mouse double clicks an element matching provided selector.
183
+ * @param selector A selector to search for an element. If there are multiple
184
+ * elements satisfying the selector, the first will be used.
185
+ * @param options
186
+ */
187
+ dblclick(selector: string, options?: {
188
+ /**
189
+ * The mouse button (`left`, `middle` or `right`) to use during the action.
190
+ * Defaults to `left`.
191
+ */
192
+ button?: MouseButton;
193
+
194
+ /**
195
+ * Milliseconds to wait between `mousedown` and `mouseup`. Defaults to `0`.
196
+ */
197
+ delay?: number;
198
+
199
+ /**
200
+ * Setting this to `true` will bypass the actionability checks (`visible`,
201
+ * `stable`, `enabled`). Defaults to `false`.
202
+ */
203
+ force?: boolean;
204
+
205
+ /**
206
+ * `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the
207
+ * action. If not specified, currently pressed modifiers are used,
208
+ * otherwise defaults to `null`.
209
+ */
210
+ modifiers?: KeyboardModifier[];
211
+
212
+ /**
213
+ * If set to `true` and a navigation occurs from performing this action, it
214
+ * will not wait for it to complete. Defaults to `false`.
215
+ */
216
+ noWaitAfter?: boolean;
217
+
218
+ /**
219
+ * A point to use relative to the top left corner of the element. If not
220
+ * supplied, a visible point of the element is used.
221
+ */
222
+ position?: {
223
+ x: number;
224
+
225
+ y: number;
226
+ };
227
+
228
+ /**
229
+ * When `true`, the call requires selector to resolve to a single element.
230
+ * If given selector resolves to more than one element, the call throws
231
+ * an exception. Defaults to `false`.
232
+ */
233
+ strict?: boolean;
234
+
235
+ /**
236
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
237
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
238
+ * `page` methods.
239
+ *
240
+ * Setting the value to `0` will disable the timeout.
241
+ */
242
+ timeout?: number;
243
+
244
+ /**
245
+ * Setting this to `true` will perform the actionability checks without
246
+ * performing the action. Useful to wait until the element is ready for the
247
+ * action without performing it. Defaults to `false`.
248
+ */
249
+ trial?: boolean;
250
+ }): void;
251
+
252
+ /**
253
+ * **NOTE** Use locator-based locator.dispatchEvent([options]) instead.
254
+ *
255
+ * @param selector A selector to search for an element. If there are multiple
256
+ * elements satisfying the selector, the first will be used.
257
+ * @param type DOM event type: `"click"` etc.
258
+ * @param eventInit Optional event-specific initialization properties.
259
+ * @param options
260
+ */
261
+ dispatchEvent(selector: string, type: string, eventInit?: EvaluationArgument, options?: {
262
+ /**
263
+ * When `true`, the call requires selector to resolve to a single element.
264
+ * If given selector resolves to more than one element, the call throws
265
+ * an exception. Defaults to `false`.
266
+ */
267
+ strict?: boolean;
268
+
269
+ /**
270
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
271
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
272
+ * `page` methods.
273
+ *
274
+ * Setting the value to `0` will disable the timeout.
275
+ */
276
+ timeout?: number;
277
+ }): void;
278
+
279
+ /**
280
+ * This method changes the `CSS media type` through the `media` argument,
281
+ * and/or the `'prefers-colors-scheme'` media feature, using the `colorScheme`
282
+ * argument.
283
+ * @param options
284
+ */
285
+ emulateMedia(options?: {
286
+ /**
287
+ * Emulates `'prefers-colors-scheme'` media feature, supported values are
288
+ * `'light'`, `'dark'`, and `'no-preference'`.
289
+ */
290
+ colorScheme?: "light"|"dark"|"no-preference";
291
+
292
+ /**
293
+ * Changes the CSS media type of the page. The only allowed values are
294
+ * `'screen'`, and `'print'`.
295
+ */
296
+ media?: "screen"|"print";
297
+
298
+ /**
299
+ * Emulates `'prefers-reduced-motion'` media feature, supported values are
300
+ * `'reduce'`, `'no-preference'`.
301
+ */
302
+ reducedMotion?: "reduce"|"no-preference";
303
+ }): void;
304
+
305
+ /**
306
+ * This emulates your website with the specified vision deficiency type.
307
+ * The supported types are:
308
+ * - none: default.
309
+ * - blurredVision: where vision is less precise.
310
+ * - protanopia: the inability to perceive any red light.
311
+ * - deuteranopia: the inability to perceive any green light.
312
+ * - tritanopia: the inability to perceive any blue light.
313
+ * - achromatopsia: the inability to perceive any color except for shades of
314
+ * grey (extremely rare).
315
+ * @param type
316
+ */
317
+ emulateVisionDeficiency(
318
+ type: "none"|"blurredVision"|"deuteranopia"|"protanopia"|"tritanopia"|"achromatopsia"
319
+ ): void;
320
+
321
+ /**
322
+ * Returns the value of the `pageFunction` invocation.
323
+ *
324
+ * A string can also be passed in instead of a function.
325
+ *
326
+ * @param pageFunction Function to be evaluated in the page context.
327
+ * @param arg Optional argument to pass to `pageFunction`.
328
+ */
329
+ evaluate<R, Arg>(pageFunction: PageFunction<Arg, R>, arg?: Arg): R;
330
+
331
+ /**
332
+ * Returns the value of the `pageFunction` invocation as a [JSHandle].
333
+ *
334
+ * The only difference between page.evaluate(pageFunction[, arg]) and
335
+ * page.evaluateHandle(pageFunction[, arg]) is that
336
+ * page.evaluateHandle(pageFunction[, arg])returns [JSHandle].
337
+ *
338
+ * @param pageFunction Function to be evaluated in the page context.
339
+ * @param arg Optional argument to pass to `pageFunction`.
340
+ */
341
+ evaluateHandle<R, Arg>(pageFunction: PageFunction<Arg, R>, arg?: Arg): JSHandle<R>;
342
+
343
+ /**
344
+ * **NOTE** Use locator-based `locator.fill(value[, options])` instead.
345
+ *
346
+ * Fill an `input`, `textarea` or `[contenteditable]` element with the
347
+ * provided value.
348
+ *
349
+ * @param selector A selector to search for an element. If there are multiple
350
+ * elements satisfying the selector, the first will be used.
351
+ * @param value Value to fill for the `<input>`, `<textarea>` or
352
+ * `[contenteditable]` element.
353
+ * @param options
354
+ */
355
+ fill(selector: string, value: string, options?: {
356
+ /**
357
+ * Setting this to `true` will bypass the actionability checks (`visible`,
358
+ * `stable`, `enabled`). Defaults to `false`.
359
+ */
360
+ force?: boolean;
361
+
362
+ /**
363
+ * If set to `true` and a navigation occurs from performing this action, it
364
+ * will not wait for it to complete. Defaults to `false`.
365
+ */
366
+ noWaitAfter?: boolean;
367
+
368
+ /**
369
+ * When `true`, the call requires selector to resolve to a single element.
370
+ * If given selector resolves to more than one element, the call throws
371
+ * an exception. Defaults to `false`.
372
+ */
373
+ strict?: boolean;
374
+
375
+ /**
376
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
377
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
378
+ * `page` methods.
379
+ *
380
+ * Setting the value to `0` will disable the timeout.
381
+ */
382
+ timeout?: number;
383
+ }): void;
384
+
385
+ /**
386
+ * **NOTE** Use locator-based `locator.focus([options])` instead.
387
+ *
388
+ * This method fetches an element with `selector` and focuses it.
389
+ *
390
+ * @param selector A selector to search for an element. If there are multiple
391
+ * elements satisfying the selector, the first will be used.
392
+ * @param options
393
+ */
394
+ focus(selector: string, options?: {
395
+ /**
396
+ * When `true`, the call requires selector to resolve to a single element.
397
+ * If given selector resolves to more than one element, the call throws
398
+ * an exception. Defaults to `false`.
399
+ */
400
+ strict?: boolean;
401
+
402
+ /**
403
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
404
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
405
+ * `page` methods.
406
+ *
407
+ * Setting the value to `0` will disable the timeout.
408
+ */
409
+ timeout?: number;
410
+ }): void;
411
+
412
+ /**
413
+ * Frames returns an array of frames on the page.
414
+ */
415
+ frames(): Frame[];
416
+
417
+ /**
418
+ * **NOTE** Use locator-based locator.getAttribute(name[, options]) instead.
419
+ *
420
+ * Returns the element attribute value for the given attribute name.
421
+ *
422
+ * @param selector A selector to search for an element. If there are multiple
423
+ * elements satisfying the selector, the first will be used.
424
+ * @param name Attribute name to get the value for.
425
+ * @param options
426
+ */
427
+ getAttribute(selector: string, name: string, options?: {
428
+ /**
429
+ * When `true`, the call requires selector to resolve to a single element.
430
+ * If given selector resolves to more than one element, the call throws
431
+ * an exception. Defaults to `false`.
432
+ */
433
+ strict?: boolean;
434
+
435
+ /**
436
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
437
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
438
+ * `page` methods.
439
+ *
440
+ * Setting the value to `0` will disable the timeout.
441
+ */
442
+ timeout?: number;
443
+ }): null|string;
444
+
445
+ /**
446
+ * Navigates to the specified url and returns the main resource response.
447
+ *
448
+ * navigating to `about:blank` or navigation to the same URL with a different
449
+ * hash, will succeed and return `null`.
450
+ *
451
+ * @param url URL to navigate page to. The url should include scheme, e.g.
452
+ * `https://`.
453
+ * @param options
454
+ */
455
+ goto(url: string, options?: NavigationOptions): Promise<null|Response>;
456
+
457
+ /**
458
+ * **NOTE** Use locator-based locator.hover([options]) instead.
459
+ *
460
+ * This method hovers over an element matching `selector`.
461
+ *
462
+ * @param selector A selector to search for an element. If there are multiple
463
+ * elements satisfying the selector, the first will be used.
464
+ * @param options
465
+ */
466
+ hover(selector: string, options?: {
467
+ /**
468
+ * Setting this to `true` will bypass the actionability checks (`visible`,
469
+ * `stable`, `enabled`). Defaults to `false`.
470
+ */
471
+ force?: boolean;
472
+
473
+ /**
474
+ * `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the
475
+ * action. If not specified, currently pressed modifiers are used,
476
+ * otherwise defaults to `null`.
477
+ */
478
+ modifiers?: KeyboardModifier[];
479
+
480
+ /**
481
+ * If set to `true` and a navigation occurs from performing this action, it
482
+ * will not wait for it to complete. Defaults to `false`.
483
+ */
484
+ noWaitAfter?: boolean;
485
+
486
+ /**
487
+ * A point to use relative to the top left corner of the element. If not
488
+ * supplied, a visible point of the element is used.
489
+ */
490
+ position?: {
491
+ x: number;
492
+
493
+ y: number;
494
+ };
495
+
496
+ /**
497
+ * When `true`, the call requires selector to resolve to a single element.
498
+ * If given selector resolves to more than one element, the call throws
499
+ * an exception. Defaults to `false`.
500
+ */
501
+ strict?: boolean;
502
+
503
+ /**
504
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
505
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
506
+ * `page` methods.
507
+ *
508
+ * Setting the value to `0` will disable the timeout.
509
+ */
510
+ timeout?: number;
511
+
512
+ /**
513
+ * Setting this to `true` will perform the actionability checks without
514
+ * performing the action. Useful to wait until the element is ready for the
515
+ * action without performing it. Defaults to `false`.
516
+ */
517
+ trial?: boolean;
518
+ }): void;
519
+
520
+ /**
521
+ * **NOTE** Use locator-based locator.innerHTML([options]) instead.
522
+ *
523
+ * Returns `element.innerHTML`.
524
+ *
525
+ * @param selector A selector to search for an element. If there are multiple
526
+ * elements satisfying the selector, the first will be used.
527
+ * @param options
528
+ */
529
+ innerHTML(selector: string, options?: {
530
+ /**
531
+ * When `true`, the call requires selector to resolve to a single element.
532
+ * If given selector resolves to more than one element, the call throws
533
+ * an exception. Defaults to `false`.
534
+ */
535
+ strict?: boolean;
536
+
537
+ /**
538
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
539
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
540
+ * `page` methods.
541
+ *
542
+ * Setting the value to `0` will disable the timeout.
543
+ */
544
+ timeout?: number;
545
+ }): string;
546
+
547
+ /**
548
+ * **NOTE** Use locator-based locator.innerText([options]) instead.
549
+ *
550
+ * Returns `element.innerText`.
551
+ *
552
+ * @param selector A selector to search for an element. If there are multiple
553
+ * elements satisfying the selector, the first will be used.
554
+ * @param options
555
+ */
556
+ innerText(selector: string, options?: {
557
+ /**
558
+ * When `true`, the call requires selector to resolve to a single element.
559
+ * If given selector resolves to more than one element, the call throws
560
+ * an exception. Defaults to `false`.
561
+ */
562
+ strict?: boolean;
563
+
564
+ /**
565
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
566
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
567
+ * `page` methods.
568
+ *
569
+ * Setting the value to `0` will disable the timeout.
570
+ */
571
+ timeout?: number;
572
+ }): string;
573
+
574
+ /**
575
+ * **NOTE** Use locator-based locator.inputValue([options]) instead.
576
+ *
577
+ * Returns `input.value` for the selected `<input>` or `<textarea>` or
578
+ * `<select>` element.
579
+ *
580
+ * @param selector A selector to search for an element. If there are multiple
581
+ * elements satisfying the selector, the first will be used.
582
+ * @param options
583
+ */
584
+ inputValue(selector: string, options?: {
585
+ /**
586
+ * When `true`, the call requires selector to resolve to a single element.
587
+ * If given selector resolves to more than one element, the call throws
588
+ * an exception. Defaults to `false`.
589
+ */
590
+ strict?: boolean;
591
+
592
+ /**
593
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
594
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
595
+ * `page` methods.
596
+ *
597
+ * Setting the value to `0` will disable the timeout.
598
+ */
599
+ timeout?: number;
600
+ }): string;
601
+
602
+ /**
603
+ * **NOTE** Use locator-based locator.isChecked([options]) instead.
604
+ *
605
+ * Checks to see if the `checkbox` `input` type is selected or not.
606
+ *
607
+ * @param selector A selector to search for an element. If there are multiple
608
+ * elements satisfying the selector, the first will be used.
609
+ * @param options
610
+ */
611
+ isChecked(selector: string, options?: {
612
+ /**
613
+ * When `true`, the call requires selector to resolve to a single element.
614
+ * If given selector resolves to more than one element, the call throws
615
+ * an exception. Defaults to `false`.
616
+ */
617
+ strict?: boolean;
618
+
619
+ /**
620
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
621
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
622
+ * `page` methods.
623
+ *
624
+ * Setting the value to `0` will disable the timeout.
625
+ */
626
+ timeout?: number;
627
+ }): boolean;
628
+
629
+ /**
630
+ * Indicates that the page has been closed.
631
+ */
632
+ isClosed(): boolean;
633
+
634
+ /**
635
+ * **NOTE** Use locator-based locator.isDisabled([options]) instead.
636
+ *
637
+ * Returns whether the element is disabled.
638
+ *
639
+ * @param selector A selector to search for an element. If there are multiple
640
+ * elements satisfying the selector, the first will be used.
641
+ * @param options
642
+ */
643
+ isDisabled(selector: string, options?: {
644
+ /**
645
+ * When `true`, the call requires selector to resolve to a single element.
646
+ * If given selector resolves to more than one element, the call throws
647
+ * an exception. Defaults to `false`.
648
+ */
649
+ strict?: boolean;
650
+
651
+ /**
652
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
653
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
654
+ * `page` methods.
655
+ *
656
+ * Setting the value to `0` will disable the timeout.
657
+ */
658
+ timeout?: number;
659
+ }): boolean;
660
+
661
+ /**
662
+ * **NOTE** Use locator-based locator.isEditable([options]) instead.
663
+ *
664
+ * Returns whether the element is editable.
665
+ *
666
+ * @param selector A selector to search for an element. If there are multiple
667
+ * elements satisfying the selector, the first will be used.
668
+ * @param options
669
+ */
670
+ isEditable(selector: string, options?: {
671
+ /**
672
+ * When `true`, the call requires selector to resolve to a single element.
673
+ * If given selector resolves to more than one element, the call throws
674
+ * an exception. Defaults to `false`.
675
+ */
676
+ strict?: boolean;
677
+
678
+ /**
679
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
680
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
681
+ * `page` methods.
682
+ *
683
+ * Setting the value to `0` will disable the timeout.
684
+ */
685
+ timeout?: number;
686
+ }): boolean;
687
+
688
+ /**
689
+ * **NOTE** Use locator-based locator.isEnabled([options]) instead.
690
+ *
691
+ * Returns whether the element is enabled.
692
+ *
693
+ * @param selector A selector to search for an element. If there are multiple
694
+ * elements satisfying the selector, the first will be used.
695
+ * @param options
696
+ */
697
+ isEnabled(selector: string, options?: {
698
+ /**
699
+ * When `true`, the call requires selector to resolve to a single element.
700
+ * If given selector resolves to more than one element, the call throws
701
+ * an exception. Defaults to `false`.
702
+ */
703
+ strict?: boolean;
704
+
705
+ /**
706
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
707
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
708
+ * `page` methods.
709
+ *
710
+ * Setting the value to `0` will disable the timeout.
711
+ */
712
+ timeout?: number;
713
+ }): boolean;
714
+
715
+ /**
716
+ * **NOTE** Use locator-based locator.isHidden([options]) instead.
717
+ *
718
+ * Returns whether the element is hidden.
719
+ *
720
+ * @param selector A selector to search for an element. If there are multiple
721
+ * elements satisfying the selector, the first will be used.
722
+ * @param options
723
+ */
724
+ isHidden(selector: string, options?: {
725
+ /**
726
+ * When `true`, the call requires selector to resolve to a single element.
727
+ * If given selector resolves to more than one element, the call throws
728
+ * an exception. Defaults to `false`.
729
+ */
730
+ strict?: boolean;
731
+
732
+ /**
733
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
734
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
735
+ * `page` methods.
736
+ *
737
+ * Setting the value to `0` will disable the timeout.
738
+ */
739
+ timeout?: number;
740
+ }): boolean;
741
+
742
+ /**
743
+ * **NOTE** Use locator-based locator.isVisible([options]) instead.
744
+ *
745
+ * Returns whether the element is visible.
746
+ *
747
+ * @param selector A selector to search for an element. If there are multiple
748
+ * elements satisfying the selector, the first will be used.
749
+ * @param options
750
+ */
751
+ isVisible(selector: string, options?: {
752
+ /**
753
+ * When `true`, the call requires selector to resolve to a single element.
754
+ * If given selector resolves to more than one element, the call throws
755
+ * an exception. Defaults to `false`.
756
+ */
757
+ strict?: boolean;
758
+
759
+ /**
760
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
761
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
762
+ * `page` methods.
763
+ *
764
+ * Setting the value to `0` will disable the timeout.
765
+ */
766
+ timeout?: number;
767
+ }): boolean;
768
+
769
+ /**
770
+ * Returns the keyboard instance to interact with a virtual keyboard on the
771
+ * page.
772
+ */
773
+ keyboard: Keyboard;
774
+
775
+ /**
776
+ * The method returns an element locator. Locators resolve to the element
777
+ * when the action takes place, which means locators can span over navigations
778
+ * where the underlying dom changes.
779
+ *
780
+ * @param selector A selector to use when resolving DOM element.
781
+ */
782
+ locator(selector: string): Locator;
783
+
784
+ /**
785
+ * The page's main frame. Page is made up of frames in a hierarchical. At the
786
+ * top is mainFrame. A page is guaranteed to have a mainFrame.
787
+ */
788
+ mainFrame(): Frame;
789
+
790
+ /**
791
+ * Returns the mouse instance to interact with a virtual mouse on the page.
792
+ */
793
+ mouse: Mouse;
794
+
795
+ /**
796
+ * Returns the page that opened the current page. The first page that is
797
+ * navigated to will have a null opener.
798
+ */
799
+ opener(): Page | null;
800
+
801
+ /**
802
+ * **NOTE** Use locator-based locator.press(key[, options]) instead.
803
+ *
804
+ * Focuses the element, and then uses keyboard.down(key) and
805
+ * keyboard.up(key).
806
+ *
807
+ * A superset of the `key` values can be found [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values).
808
+ *
809
+ * Following modification shortcuts are also supported: `Shift`, `Control`,
810
+ * `Alt`, `Meta`, `ShiftLeft`.
811
+ *
812
+ * Holding down `Shift` will type the text that corresponds to the `key` in
813
+ * the upper case.
814
+ *
815
+ * If `key` is a single character, it is case-sensitive, so the values `a`
816
+ * and `A` will generate different respective texts.
817
+ *
818
+ * Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are
819
+ * supported as well. When specified with the modifier, modifier is pressed
820
+ * and being held while the subsequent key is being pressed.
821
+ *
822
+ * @param selector A selector to search for an element. If there are multiple
823
+ * elements satisfying the selector, the first will be used.
824
+ * @param key Name of the key to press or a character to generate, such as
825
+ * `ArrowLeft` or `a`.
826
+ * @param options
827
+ */
828
+ press(selector: string, key: string, options?: {
829
+ /**
830
+ * Milliseconds to wait between `mousedown` and `mouseup`. Defaults to `0`.
831
+ */
832
+ delay?: number;
833
+
834
+ /**
835
+ * If set to `true` and a navigation occurs from performing this action, it
836
+ * will not wait for it to complete. Defaults to `false`.
837
+ */
838
+ noWaitAfter?: boolean;
839
+
840
+ /**
841
+ * When `true`, the call requires selector to resolve to a single element.
842
+ * If given selector resolves to more than one element, the call throws
843
+ * an exception. Defaults to `false`.
844
+ */
845
+ strict?: boolean;
846
+
847
+ /**
848
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
849
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
850
+ * `page` methods.
851
+ *
852
+ * Setting the value to `0` will disable the timeout.
853
+ */
854
+ timeout?: number;
855
+ }): void;
856
+
857
+ /**
858
+ * This reloads the current page Returns the main resource response.
859
+ *
860
+ * @param options
861
+ */
862
+ reload(options?: {
863
+ /**
864
+ * Maximum operation time in milliseconds. Defaults to `30` seconds. The
865
+ * default value can be changed via the
866
+ * browserContext.setDefaultNavigationTimeout(timeout),
867
+ * browserContext.setDefaultTimeout(timeout),
868
+ * page.setDefaultNavigationTimeout(timeout) or
869
+ * page.setDefaultTimeout(timeout) methods.
870
+ *
871
+ * Setting the value to `0` will disable the timeout.
872
+ *
873
+ */
874
+ timeout?: number;
875
+
876
+ /**
877
+ * When to consider operation succeeded, defaults to `load`. Events can be
878
+ * either:
879
+ * - `'domcontentloaded'` - consider operation to be finished when the
880
+ * `DOMContentLoaded` event is fired.
881
+ * - `'load'` - consider operation to be finished when the `load` event is
882
+ * fired.
883
+ * - `'networkidle'` - **DISCOURAGED** consider operation to be finished
884
+ * when there are no network connections for at least `500` ms. Don't use
885
+ * this method for testing especially with chatty websites where the event
886
+ * may never fire, rely on web assertions to assess readiness instead.
887
+ */
888
+ waitUntil?: "load"|"domcontentloaded"|"networkidle";
889
+ }): null | Response;
890
+
891
+ /**
892
+ * Returns the buffer with the captured screenshot from the browser.
893
+ *
894
+ * @param options
895
+ */
896
+ screenshot(options?: {
897
+ /**
898
+ * An object which specifies clipping of the resulting image.
899
+ */
900
+ clip?: {
901
+ /**
902
+ * x-coordinate of top-left corner of clip area
903
+ */
904
+ x: number;
905
+
906
+ /**
907
+ * y-coordinate of top-left corner of clip area
908
+ */
909
+ y: number;
910
+
911
+ /**
912
+ * width of clipping area
913
+ */
914
+ width: number;
915
+
916
+ /**
917
+ * height of clipping area
918
+ */
919
+ height: number;
920
+ };
921
+
922
+ /**
923
+ * When true, takes a screenshot of the full scrollable page, instead of
924
+ * the currently visible viewport. Defaults to `false`.
925
+ */
926
+ fullPage?: boolean;
927
+ } & ScreenshotOptions): ArrayBuffer;
928
+
929
+ /**
930
+ * **NOTE** Use locator-based locator.selectOption(values[, options]) instead.
931
+ *
932
+ * This select one or more options which match the values from a <select>
933
+ * element.
934
+ *
935
+ * @param selector A selector to search for an element. If there are multiple
936
+ * elements satisfying the selector, the first will be used.
937
+ * @param values Options to select. If the select has multiple attribute, all
938
+ * matching options are selected, otherwise only the first option matching
939
+ * one of the passed options is selected. Object can be made up of keys with
940
+ * value, label or index.
941
+ * @param options
942
+ */
943
+ selectOption(selector: string, values: string|ElementHandle|SelectOptionsObject|string[]|ElementHandle[]|SelectOptionsObject[], options?: {
944
+ /**
945
+ * Setting this to `true` will bypass the actionability checks (visible,
946
+ * stable, enabled). Defaults to `false`.
947
+ */
948
+ force?: boolean;
949
+
950
+ /**
951
+ * If set to `true` and a navigation occurs from performing this action, it
952
+ * will not wait for it to complete. Defaults to `false`.
953
+ */
954
+ noWaitAfter?: boolean;
955
+
956
+ /**
957
+ * When `true`, the call requires selector to resolve to a single element.
958
+ * If given selector resolves to more than one element, the call throws
959
+ * an exception. Defaults to `false`.
960
+ */
961
+ strict?: boolean;
962
+
963
+ /**
964
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
965
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
966
+ * `page` methods.
967
+ *
968
+ * Setting the value to `0` will disable the timeout.
969
+ */
970
+ timeout?: number;
971
+ }): string[];
972
+
973
+ /**
974
+ * Set the supplied html string to the current page.
975
+ *
976
+ * @param html HTML markup to assign to the page.
977
+ * @param options
978
+ */
979
+ setContent(html: string, options?: {
980
+ /**
981
+ * Maximum operation time in milliseconds. Defaults to `30` seconds. The
982
+ * default value can be changed via the
983
+ * browserContext.setDefaultNavigationTimeout(timeout),
984
+ * browserContext.setDefaultTimeout(timeout),
985
+ * page.setDefaultNavigationTimeout(timeout) or
986
+ * page.setDefaultTimeout(timeout) methods.
987
+ *
988
+ * Setting the value to `0` will disable the timeout.
989
+ *
990
+ */
991
+ timeout?: number;
992
+
993
+ /**
994
+ * When to consider operation succeeded, defaults to `load`. Events can be
995
+ * either:
996
+ * - `'domcontentloaded'` - consider operation to be finished when the
997
+ * `DOMContentLoaded` event is fired.
998
+ * - `'load'` - consider operation to be finished when the `load` event is
999
+ * fired.
1000
+ * - `'networkidle'` - **DISCOURAGED** consider operation to be finished
1001
+ * when there are no network connections for at least `500` ms. Don't use
1002
+ * this method for testing especially with chatty websites where the event
1003
+ * may never fire, rely on web assertions to assess readiness instead.
1004
+ */
1005
+ waitUntil?: "load"|"domcontentloaded"|"networkidle";
1006
+ }): void;
1007
+
1008
+ /**
1009
+ * This setting will change the navigation timeout for the following methods:
1010
+ * - page.goto(url[, options])
1011
+ * - page.reload([options])
1012
+ * - page.setContent(html[, options])
1013
+ * - page.waitForNavigation([options])
1014
+ *
1015
+ * @param timeout in milliseconds
1016
+ */
1017
+ setDefaultNavigationTimeout(timeout: number): void;
1018
+
1019
+ /**
1020
+ * This setting will change the timeout for all the methods accepting a
1021
+ * `timeout` option.
1022
+ *
1023
+ * @param timeout in milliseconds
1024
+ */
1025
+ setDefaultTimeout(timeout: number): void;
1026
+
1027
+ /**
1028
+ * This sets extra HTTP headers which will be sent with subsequent
1029
+ * HTTP requests.
1030
+ *
1031
+ * @param headers An object containing the additional HTTP headers.
1032
+ * All header values must be strings.
1033
+ */
1034
+ setExtraHTTPHeaders(headers: { [key: string]: string; }): void;
1035
+
1036
+ /**
1037
+ * This will update the page's width and height.
1038
+ *
1039
+ * @param viewportSize
1040
+ */
1041
+ setViewportSize(viewportSize: {
1042
+ /**
1043
+ * page width in pixels.
1044
+ */
1045
+ width: number;
1046
+
1047
+ /**
1048
+ * page height in pixels.
1049
+ */
1050
+ height: number;
1051
+ }): void;
1052
+
1053
+ /**
1054
+ * **NOTE** Use locator-based locator.tap([options]) instead.
1055
+ *
1056
+ * Tap the first element that matches the selector.
1057
+ *
1058
+ * @param selector A selector to search for an element. If there are multiple
1059
+ * elements satisfying the selector, the first will be used.
1060
+ * @param options
1061
+ */
1062
+ tap(selector: string, options?: {
1063
+ /**
1064
+ * Setting this to `true` will bypass the actionability checks (visible,
1065
+ * stable, enabled). Defaults to `false`.
1066
+ */
1067
+ force?: boolean;
1068
+
1069
+ /**
1070
+ * `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the
1071
+ * action. If not specified, currently pressed modifiers are used,
1072
+ * otherwise defaults to `null`.
1073
+ */
1074
+ modifiers?: KeyboardModifier[];
1075
+
1076
+ /**
1077
+ * If set to `true` and a navigation occurs from performing this action, it
1078
+ * will not wait for it to complete. Defaults to `false`.
1079
+ */
1080
+ noWaitAfter?: boolean;
1081
+
1082
+ /**
1083
+ * A point to use relative to the top left corner of the element. If not
1084
+ * supplied, a visible point of the element is used.
1085
+ */
1086
+ position?: {
1087
+ x: number;
1088
+
1089
+ y: number;
1090
+ };
1091
+
1092
+ /**
1093
+ * When `true`, the call requires selector to resolve to a single element.
1094
+ * If given selector resolves to more than one element, the call throws
1095
+ * an exception. Defaults to `false`.
1096
+ */
1097
+ strict?: boolean;
1098
+
1099
+ /**
1100
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
1101
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
1102
+ * `page` methods.
1103
+ *
1104
+ * Setting the value to `0` will disable the timeout.
1105
+ */
1106
+ timeout?: number;
1107
+
1108
+ /**
1109
+ * Setting this to `true` will perform the actionability checks without
1110
+ * performing the action. Useful to wait until the element is ready for the
1111
+ * action without performing it. Defaults to `false`.
1112
+ */
1113
+ trial?: boolean;
1114
+ }): void;
1115
+
1116
+ /**
1117
+ * **NOTE** Use locator-based locator.textContent([options]) instead.
1118
+ *
1119
+ * Returns `element.textContent`.
1120
+ *
1121
+ * @param selector A selector to search for an element. If there are multiple
1122
+ * elements satisfying the selector, the first will be used.
1123
+ * @param options
1124
+ */
1125
+ textContent(selector: string, options?: {
1126
+ /**
1127
+ * When `true`, the call requires selector to resolve to a single element.
1128
+ * If given selector resolves to more than one element, the call throws
1129
+ * an exception. Defaults to `false`.
1130
+ */
1131
+ strict?: boolean;
1132
+
1133
+ /**
1134
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
1135
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
1136
+ * `page` methods.
1137
+ *
1138
+ * Setting the value to `0` will disable the timeout.
1139
+ */
1140
+ timeout?: number;
1141
+ }): string;
1142
+
1143
+ /**
1144
+ * Returns the page's title.
1145
+ */
1146
+ title(): string;
1147
+
1148
+ /**
1149
+ * Returns the touchscreen instance to interact with a virtual touchscreen on
1150
+ * the page.
1151
+ */
1152
+ touchscreen: Touchscreen;
1153
+
1154
+ /**
1155
+ * **NOTE** Use locator-based locator.type(text[, options]) instead.
1156
+ *
1157
+ * Type the `text` in the first element found that matches the selector.
1158
+ *
1159
+ * @param selector A selector to search for an element. If there are multiple
1160
+ * elements satisfying the selector, the first will be used.
1161
+ * @param text The text to type into the element.
1162
+ * @param options
1163
+ */
1164
+ type(selector: string, text: string, options?: {
1165
+ /**
1166
+ * Milliseconds to wait between `mousedown` and `mouseup`. Defaults to `0`.
1167
+ */
1168
+ delay?: number;
1169
+
1170
+ /**
1171
+ * If set to `true` and a navigation occurs from performing this action, it
1172
+ * will not wait for it to complete. Defaults to `false`.
1173
+ */
1174
+ noWaitAfter?: boolean;
1175
+
1176
+ /**
1177
+ * When `true`, the call requires selector to resolve to a single element.
1178
+ * If given selector resolves to more than one element, the call throws
1179
+ * an exception. Defaults to `false`.
1180
+ */
1181
+ strict?: boolean;
1182
+
1183
+ /**
1184
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
1185
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
1186
+ * `page` methods.
1187
+ *
1188
+ * Setting the value to `0` will disable the timeout.
1189
+ */
1190
+ timeout?: number;
1191
+ }): void;
1192
+
1193
+ /**
1194
+ * **NOTE** Use locator-based `locator.uncheck([options])` instead.
1195
+ *
1196
+ * This method is used to unselect an input checkbox.
1197
+ *
1198
+ * @param selector A selector to search for an element. If there are multiple
1199
+ * elements satisfying the selector, the first will be used.
1200
+ * @param options
1201
+ */
1202
+ uncheck(selector: string, options?: {
1203
+ /**
1204
+ * Setting this to `true` will bypass the actionability checks (visible,
1205
+ * stable, enabled). Defaults to `false`.
1206
+ */
1207
+ force?: boolean;
1208
+
1209
+ /**
1210
+ * If set to `true` and a navigation occurs from performing this action, it
1211
+ * will not wait for it to complete. Defaults to `false`.
1212
+ */
1213
+ noWaitAfter?: boolean;
1214
+
1215
+ /**
1216
+ * A point to use relative to the top left corner of the element. If not
1217
+ * supplied, a visible point of the element is used.
1218
+ */
1219
+ position?: {
1220
+ x: number;
1221
+
1222
+ y: number;
1223
+ };
1224
+
1225
+ /**
1226
+ * When `true`, the call requires selector to resolve to a single element.
1227
+ * If given selector resolves to more than one element, the call throws
1228
+ * an exception. Defaults to `false`.
1229
+ */
1230
+ strict?: boolean;
1231
+
1232
+ /**
1233
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
1234
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
1235
+ * `page` methods.
1236
+ *
1237
+ * Setting the value to `0` will disable the timeout.
1238
+ */
1239
+ timeout?: number;
1240
+
1241
+ /**
1242
+ * Setting this to `true` will perform the actionability checks without
1243
+ * performing the action. Useful to wait until the element is ready for the
1244
+ * action without performing it. Defaults to `false`.
1245
+ */
1246
+ trial?: boolean;
1247
+ }): void;
1248
+
1249
+ /**
1250
+ * Returns the page's URL.
1251
+ */
1252
+ url(): string;
1253
+
1254
+ /**
1255
+ * Returns the page's size (width and height).
1256
+ */
1257
+ viewportSize(): {
1258
+ /**
1259
+ * page width in pixels.
1260
+ */
1261
+ width: number;
1262
+
1263
+ /**
1264
+ * page height in pixels.
1265
+ */
1266
+ height: number;
1267
+ };
1268
+
1269
+ /**
1270
+ * Returns when the `pageFunction` returns a truthy value.
1271
+ *
1272
+ * @param pageFunction Function to be evaluated in the page context.
1273
+ * @param arg Optional argument to pass to `pageFunction`.
1274
+ * @param options
1275
+ */
1276
+ waitForFunction<R, Arg>(pageFunction: PageFunction<Arg, R>, options?: {
1277
+ /**
1278
+ * If `polling` is `'raf'`, then `pageFunction` is constantly executed in
1279
+ * `requestAnimationFrame` callback. If `polling` is a number, then it is
1280
+ * treated as an interval in milliseconds at which the function would be
1281
+ * executed. Defaults to `raf`.
1282
+ */
1283
+ polling?: number|"raf";
1284
+
1285
+ /**
1286
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
1287
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
1288
+ * `page` methods.
1289
+ *
1290
+ * Setting the value to `0` will disable the timeout.
1291
+ */
1292
+ timeout?: number;
1293
+ }, arg?: Arg): Promise<JSHandle<R>>;
1294
+
1295
+ /**
1296
+ * This waits for the given load state to be reached. It will immediately
1297
+ * unblock if that lifecycle event has already been received.
1298
+ *
1299
+ * @param state Optional load state to wait for, defaults to `load`:
1300
+ * - `'domcontentloaded'` - consider operation to be finished when the
1301
+ * `DOMContentLoaded` event is fired.
1302
+ * - `'load'` - consider operation to be finished when the `load` event is
1303
+ * fired.
1304
+ * - `'networkidle'` - **DISCOURAGED** consider operation to be finished
1305
+ * when there are no network connections for at least `500` ms. Don't use
1306
+ * this method for testing especially with chatty websites where the event
1307
+ * may never fire, rely on web assertions to assess readiness instead.
1308
+ * @param options
1309
+ */
1310
+ waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {
1311
+ /**
1312
+ * Maximum operation time in milliseconds. Defaults to `30` seconds. The
1313
+ * default value can be changed via the
1314
+ * browserContext.setDefaultNavigationTimeout(timeout),
1315
+ * browserContext.setDefaultTimeout(timeout),
1316
+ * page.setDefaultNavigationTimeout(timeout) or
1317
+ * page.setDefaultTimeout(timeout) methods.
1318
+ *
1319
+ * Setting the value to `0` will disable the timeout.
1320
+ *
1321
+ */
1322
+ timeout?: number;
1323
+ }): void;
1324
+
1325
+ /**
1326
+ * Waits for the given navigation lifecycle event to occur and returns the main
1327
+ * resource response.
1328
+ *
1329
+ * @param options
1330
+ */
1331
+ waitForNavigation(options?: {
1332
+ /**
1333
+ * Maximum operation time in milliseconds. Defaults to `30` seconds. The
1334
+ * default value can be changed via the
1335
+ * browserContext.setDefaultNavigationTimeout(timeout),
1336
+ * browserContext.setDefaultTimeout(timeout),
1337
+ * page.setDefaultNavigationTimeout(timeout) or
1338
+ * page.setDefaultTimeout(timeout) methods.
1339
+ *
1340
+ * Setting the value to `0` will disable the timeout.
1341
+ *
1342
+ */
1343
+ timeout?: number;
1344
+
1345
+ /**
1346
+ * When to consider operation succeeded, defaults to `load`. Events can be
1347
+ * either:
1348
+ * - `'domcontentloaded'` - consider operation to be finished when the
1349
+ * `DOMContentLoaded` event is fired.
1350
+ * - `'load'` - consider operation to be finished when the `load` event is
1351
+ * fired.
1352
+ * - `'networkidle'` - **DISCOURAGED** consider operation to be finished
1353
+ * when there are no network connections for at least `500` ms. Don't use
1354
+ * this method for testing especially with chatty websites where the event
1355
+ * may never fire, rely on web assertions to assess readiness instead.
1356
+ */
1357
+ waitUntil?: "load"|"domcontentloaded"|"networkidle";
1358
+ }): Promise<null|Response>;
1359
+
1360
+ /**
1361
+ * **NOTE** Use web assertions that assert visibility or a locator-based
1362
+ * locator.waitFor([options]) instead.
1363
+ *
1364
+ * Returns when element specified by selector satisfies `state` option.
1365
+ *
1366
+ * @param selector A selector to query for.
1367
+ * @param options
1368
+ */
1369
+ waitForSelector(selector: string, options?: {
1370
+ /**
1371
+ * Defaults to `'visible'`. Can be either:
1372
+ * - `'attached'` - wait for element to be present in DOM.
1373
+ * - `'detached'` - wait for element to not be present in DOM.
1374
+ * - `'visible'` - wait for element to have non-empty bounding box and no
1375
+ * `visibility:hidden`.
1376
+ * - `'hidden'` - wait for element to be either detached from DOM, or have
1377
+ * an empty bounding box or `visibility:hidden`.
1378
+ */
1379
+ state?: "attached"|"detached"|"visible"|"hidden";
1380
+
1381
+ /**
1382
+ * When `true`, the call requires selector to resolve to a single element.
1383
+ * If given selector resolves to more than one element, the call throws
1384
+ * an exception. Defaults to `false`.
1385
+ */
1386
+ strict?: boolean;
1387
+
1388
+ /**
1389
+ * Maximum time in milliseconds. Defaults to `30` seconds. Default is
1390
+ * overridden by the `setDefaultTimeout` option on `BrowserContext` or
1391
+ * `page` methods.
1392
+ *
1393
+ * Setting the value to `0` will disable the timeout.
1394
+ */
1395
+ timeout?: number;
1396
+ }): ElementHandle;
1397
+
1398
+ /**
1399
+ * **NOTE** Never wait for timeout in production, use this only for debugging.
1400
+ * Tests that wait for time are inherently flaky. Use `Locator` actions and
1401
+ * web assertions that wait automatically.
1402
+ *
1403
+ * Waits for the given `timeout` in milliseconds.
1404
+ *
1405
+ * @param timeout A timeout to wait for
1406
+ */
1407
+ waitForTimeout(timeout: number): void;
1408
+
1409
+ /**
1410
+ * This method returns all of the dedicated WebWorkers associated with the page.
1411
+ */
1412
+ workers(): Worker[];
1413
+
1414
+ /**
1415
+ * **NOTE** Use locator-based page.locator(selector[, options]) instead.
1416
+ *
1417
+ * The method finds an element matching the specified selector within the page.
1418
+ * If no elements match the selector, the return value resolves to `null`.
1419
+ * To wait for an element on the page, use locator.waitFor([options]).
1420
+ * @param selector A selector to query for.
1421
+ */
1422
+ $(selector: string): ElementHandle;
1423
+
1424
+ /**
1425
+ * **NOTE** Use locator-based page.locator(selector[, options]) instead.
1426
+ *
1427
+ * The method finds all elements matching the specified selector within the
1428
+ * page. If no elements match the selector, the return value resolves to `[]`.
1429
+ * @param selector A selector to query for.
1430
+ */
1431
+ $$(selector: string): ElementHandle[];
1432
+ }