@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.
- k6/README.md +2 -2
- k6/experimental/browser/element_handle.d.ts +209 -0
- k6/experimental/browser/frame.d.ts +360 -0
- k6/experimental/browser/index.d.ts +371 -0
- k6/experimental/browser/js_handle.d.ts +51 -0
- k6/experimental/browser/keyboard.d.ts +43 -0
- k6/experimental/browser/locator.d.ts +191 -0
- k6/experimental/browser/mouse.d.ts +43 -0
- k6/experimental/browser/page.d.ts +1432 -0
- k6/experimental/browser/request.d.ts +101 -0
- k6/experimental/browser/response.d.ts +115 -0
- k6/experimental/browser/touchscreen.d.ts +13 -0
- k6/experimental/browser/worker.d.ts +13 -0
- k6/index.d.ts +2 -0
- k6/package.json +7 -2
k6/README.md
CHANGED
|
@@ -8,9 +8,9 @@ This package contains type definitions for k6 (https://k6.io/docs/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 30 May 2023 15:02:52 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
|
15
15
|
# Credits
|
|
16
|
-
These definitions were written by [na--](https://github.com/na--), [Mihail Stoykov](https://github.com/MStoykov), [Ivan](https://github.com/codebien), [Ivan Mirić](https://github.com/imiric), [Théo Crevon](https://github.com/oleiade), [Oleg Bespalov](https://github.com/olegbespalov), [Pepe Cano](https://github.com/ppcano),
|
|
16
|
+
These definitions were written by [na--](https://github.com/na--), [Mihail Stoykov](https://github.com/MStoykov), [Ivan](https://github.com/codebien), [Ivan Mirić](https://github.com/imiric), [Théo Crevon](https://github.com/oleiade), [Oleg Bespalov](https://github.com/olegbespalov), [Pepe Cano](https://github.com/ppcano), [Nicole van der Hoeven](https://github.com/nicolevanderhoeven), and [Ankur Agarwal](https://github.com/ankur22).
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Rect,
|
|
3
|
+
ElementHandlePointerOptions,
|
|
4
|
+
ElementClickOptions,
|
|
5
|
+
KeyboardModifierOptions,
|
|
6
|
+
TimeoutOptions,
|
|
7
|
+
KeyboardPressOptions,
|
|
8
|
+
ScreenshotOptions,
|
|
9
|
+
ElementHandleOptions,
|
|
10
|
+
MouseMoveOptions,
|
|
11
|
+
StrictnessOptions,
|
|
12
|
+
InputElementState,
|
|
13
|
+
ElementState,
|
|
14
|
+
SelectOptionsObject } from "./";
|
|
15
|
+
import { JSHandle } from "./js_handle";
|
|
16
|
+
import { Frame } from "./frame";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* ElementHandle represents an in-page DOM element.
|
|
20
|
+
*/
|
|
21
|
+
export class ElementHandle extends JSHandle {
|
|
22
|
+
/**
|
|
23
|
+
* Finds an element matching the specified selector in the `ElementHandle`'s subtree.
|
|
24
|
+
* @param selector A selector to query element for.
|
|
25
|
+
* @returns An `ElementHandle` pointing to the result element or `null`.
|
|
26
|
+
*/
|
|
27
|
+
$(selector: string): ElementHandle | null;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Finds all elements matching the specified selector in the `ElementHandle`'s subtree.
|
|
31
|
+
* @param selector A selector to query element for.
|
|
32
|
+
* @returns A list of `ElementHandle`s pointing to the result elements.
|
|
33
|
+
*/
|
|
34
|
+
$$(selector: string): ElementHandle[];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* This method returns the bounding box of the element.
|
|
38
|
+
* @returns Element's bounding box.
|
|
39
|
+
*/
|
|
40
|
+
boundingBox(): Rect;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the content frame for element handles.
|
|
44
|
+
* @returns The content frame handle of the element handle.
|
|
45
|
+
*/
|
|
46
|
+
contentFrame(): Frame;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Fill the `input` or `textarea` element with the provided `value`.
|
|
50
|
+
* @param value Value to fill for the `input` or `textarea` element.
|
|
51
|
+
* @param options Element handle options.
|
|
52
|
+
*/
|
|
53
|
+
fill(value: string, options?: ElementHandleOptions): void;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Focuses the element.
|
|
57
|
+
*/
|
|
58
|
+
focus(): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Fetch the element's attribute value.
|
|
62
|
+
* @param name Attribute name to get the value for.
|
|
63
|
+
* @returns Attribute value.
|
|
64
|
+
*/
|
|
65
|
+
getAttribute(name: string): string | null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Scrolls element into view and hovers over its center point.
|
|
69
|
+
* @param options Hover options.
|
|
70
|
+
*/
|
|
71
|
+
hover(options?: ElementClickOptions & KeyboardModifierOptions): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns the `element.innerHTML`.
|
|
75
|
+
* @returns Element's innerHTML.
|
|
76
|
+
*/
|
|
77
|
+
innerHTML(): string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Returns the `element.innerText`.
|
|
81
|
+
* @returns Element's innerText.
|
|
82
|
+
*/
|
|
83
|
+
innerText(): string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Returns `input.value` for the selected `input`, `textarea` or `select` element.
|
|
87
|
+
* @returns The input value of the element.
|
|
88
|
+
*/
|
|
89
|
+
inputValue(options?: TimeoutOptions): string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Checks if a checkbox or radio is checked.
|
|
93
|
+
* @returns Whether the element is checked.
|
|
94
|
+
*/
|
|
95
|
+
isChecked(): boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Checks if the element is disabled.
|
|
99
|
+
* @returns Whether the element is disabled.
|
|
100
|
+
*/
|
|
101
|
+
isDisabled(): boolean;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Checks if the element is editable.
|
|
105
|
+
* @returns Whether the element is editable.
|
|
106
|
+
*/
|
|
107
|
+
isEditable(): boolean;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Checks if the element is enabled.
|
|
111
|
+
* @returns Whether the element is enabled.
|
|
112
|
+
*/
|
|
113
|
+
isEnabled(): boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Checks if the element is hidden.
|
|
117
|
+
* @returns Whether the element is hidden.
|
|
118
|
+
*/
|
|
119
|
+
isHidden(): boolean;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Checks if the element is visible.
|
|
123
|
+
* @returns Whether the element is visible.
|
|
124
|
+
*/
|
|
125
|
+
isVisible(): boolean;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Returns the frame containing the given element.
|
|
129
|
+
* @returns The frame that contains the element handle.
|
|
130
|
+
*/
|
|
131
|
+
ownerFrame(): Frame;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Focuses the element, and then uses `keyboard.down` and `keyboard.up` with the specified key.
|
|
135
|
+
* @param key A keyboard key name or a single character to press.
|
|
136
|
+
* @param options Keyboard press options.
|
|
137
|
+
*/
|
|
138
|
+
press(key: string, options?: KeyboardPressOptions): void;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* This method scrolls element into view, if needed, and then captures a
|
|
142
|
+
* screenshot of it.
|
|
143
|
+
* @param options Screenshot options.
|
|
144
|
+
* @returns An `ArrayBuffer` with the screenshot data.
|
|
145
|
+
*/
|
|
146
|
+
screenshot(options?: ScreenshotOptions & TimeoutOptions): ArrayBuffer;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* This method checks whether the element is actionable using provided options, and
|
|
150
|
+
* then tries to scroll it into view, unless it is completely visible.
|
|
151
|
+
* @param options Element handle options.
|
|
152
|
+
*/
|
|
153
|
+
scrollIntoViewIfNeeded(options?: ElementHandleOptions): void;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Select one or more options of a `<select>` element which match the values.
|
|
157
|
+
* @param values Values of options to select.
|
|
158
|
+
* @param options Element handle options.
|
|
159
|
+
* @returns List of selected options.
|
|
160
|
+
*/
|
|
161
|
+
selectOption(values: string | ElementHandle | SelectOptionsObject | string[] | ElementHandle[] | SelectOptionsObject[], options?: ElementHandleOptions): string[];
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Focuses the element and selects all its text content.
|
|
165
|
+
* @param options Element handle options.
|
|
166
|
+
*/
|
|
167
|
+
selectText(options?: ElementHandleOptions): void;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Scrolls element into view if needed, and then uses `page.tapscreen` to tap in the center of the element
|
|
171
|
+
* or at the specified position.
|
|
172
|
+
* @param options Tap options.
|
|
173
|
+
*/
|
|
174
|
+
tap(options?: MouseMoveOptions): void;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Returns the `node.textContent`.
|
|
178
|
+
* @returns The text content of the element.
|
|
179
|
+
*/
|
|
180
|
+
textContent(): string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Scrolls element into view, focuses element and types text.
|
|
184
|
+
* @param text Text to type into the element.
|
|
185
|
+
* @param options Typing options.
|
|
186
|
+
*/
|
|
187
|
+
type(text: string, options?: KeyboardPressOptions): void;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Scrolls element into view, and if it's an input element of type
|
|
191
|
+
* checkbox that is already checked, clicks on it to mark it as unchecked.
|
|
192
|
+
* @param options Click options.
|
|
193
|
+
*/
|
|
194
|
+
uncheck(options?: ElementClickOptions & StrictnessOptions): void;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Returns when the element satisfies the `state`.
|
|
198
|
+
* @param state Wait for element to satisfy this state.
|
|
199
|
+
* @param options Wait options.
|
|
200
|
+
*/
|
|
201
|
+
waitForElementState(state: InputElementState, options?: TimeoutOptions): void;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Returns when the child element matching `selector` satisfies the `state`.
|
|
205
|
+
* @param selector A selector to query for.
|
|
206
|
+
* @param options Wait options.
|
|
207
|
+
*/
|
|
208
|
+
waitForSelector(selector: string, options?: { state?: ElementState; } & StrictnessOptions & TimeoutOptions): void;
|
|
209
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ContentLoadOptions,
|
|
3
|
+
ElementClickOptions,
|
|
4
|
+
ElementHandleOptions,
|
|
5
|
+
ElementStateFilter,
|
|
6
|
+
KeyboardModifierOptions,
|
|
7
|
+
KeyboardPressOptions,
|
|
8
|
+
LifecycleEvent,
|
|
9
|
+
MouseClickOptions,
|
|
10
|
+
MouseMoveOptions,
|
|
11
|
+
MouseMultiClickOptions,
|
|
12
|
+
NavigationOptions,
|
|
13
|
+
PageFunction,
|
|
14
|
+
PollingOptions,
|
|
15
|
+
SelectOptionsObject,
|
|
16
|
+
StrictnessOptions,
|
|
17
|
+
TimeoutOptions,
|
|
18
|
+
} from ".";
|
|
19
|
+
import { ElementHandle } from "./element_handle";
|
|
20
|
+
import { JSHandle } from "./js_handle";
|
|
21
|
+
import { Response } from "./response";
|
|
22
|
+
import { Locator } from "./locator";
|
|
23
|
+
import { Page } from "./page";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Frame represents the frame within a page. A page is made up of hierarchy of frames.
|
|
27
|
+
*/
|
|
28
|
+
export class Frame {
|
|
29
|
+
/**
|
|
30
|
+
* Finds an element matching the specified selector within the `Frame`.
|
|
31
|
+
* @param selector A selector to query element for.
|
|
32
|
+
* @returns An `ElementHandle` pointing to the result element or `null`.
|
|
33
|
+
*/
|
|
34
|
+
$(selector: string): ElementHandle | null;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Finds all elements matching the specified selector within the `Frame`.
|
|
38
|
+
* @param selector A selector to query element for.
|
|
39
|
+
* @returns A list of `ElementHandle`s pointing to the result elements.
|
|
40
|
+
*/
|
|
41
|
+
$$(selector: string): ElementHandle[];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Checks the first checkbox element found that matches selector.
|
|
45
|
+
* @param selector The selector to use.
|
|
46
|
+
* @param options The options to use.
|
|
47
|
+
*/
|
|
48
|
+
check(selector: string, options?: ElementClickOptions & StrictnessOptions): void;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Uncheck the first found element that matches the selector.
|
|
52
|
+
* @param selector The selector to use.
|
|
53
|
+
* @param options The options to use.
|
|
54
|
+
*/
|
|
55
|
+
uncheck(selector: string, options?: ElementClickOptions & StrictnessOptions): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Clicks the element.
|
|
59
|
+
* @param selector The selector to use.
|
|
60
|
+
* @param options The options to use.
|
|
61
|
+
* @returns A promise that resolves when the element is clicked.
|
|
62
|
+
*/
|
|
63
|
+
click(selector: string, options?: MouseMultiClickOptions & StrictnessOptions): Promise<void>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Double clicks the element.
|
|
67
|
+
* @param selector The selector to use.
|
|
68
|
+
* @param options The options to use.
|
|
69
|
+
*/
|
|
70
|
+
dblclick(selector: string, options?: MouseClickOptions & MouseMoveOptions & StrictnessOptions): void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Fills out the first element found that matches the selector.
|
|
74
|
+
* @param selector The selector to use.
|
|
75
|
+
* @param value The value to fill.
|
|
76
|
+
* @param options The options to use.
|
|
77
|
+
*/
|
|
78
|
+
fill(selector: string, value: string, options?: ElementHandleOptions & StrictnessOptions): void;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Focuses the first element found that matches the selector.
|
|
82
|
+
* @param selector The selector to use.
|
|
83
|
+
* @param options The options to use.
|
|
84
|
+
*/
|
|
85
|
+
focus(selector: string, options?: TimeoutOptions & StrictnessOptions): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Hovers the first element found that matches the selector.
|
|
89
|
+
* @param selector The selector to use.
|
|
90
|
+
* @param options The options to use.
|
|
91
|
+
*/
|
|
92
|
+
hover(selector: string, options?: ElementClickOptions & KeyboardModifierOptions & StrictnessOptions): void;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Taps the first element found that matches the selector.
|
|
96
|
+
* @param selector The selector to use.
|
|
97
|
+
* @param options The options to use.
|
|
98
|
+
*/
|
|
99
|
+
tap(selector: string, options?: ElementClickOptions & KeyboardModifierOptions & StrictnessOptions): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Press the given key for the first element found that matches the selector.
|
|
103
|
+
* @param selector The selector to use.
|
|
104
|
+
* @param key The key to press.
|
|
105
|
+
* @param options The options to use.
|
|
106
|
+
*/
|
|
107
|
+
press(selector: string, key: string, options?: KeyboardPressOptions & StrictnessOptions): void;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Type the given text for the first element found that matches the selector.
|
|
111
|
+
* @param selector The selector to use.
|
|
112
|
+
* @param text The text to type.
|
|
113
|
+
* @param options The options to use.
|
|
114
|
+
*/
|
|
115
|
+
type(selector: string, text: string, options?: KeyboardPressOptions & StrictnessOptions): void;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Select the given options and return the array of option values of the first element
|
|
119
|
+
* found that matches the selector.
|
|
120
|
+
* @param selector The selector to use.
|
|
121
|
+
* @param values The values to select.
|
|
122
|
+
* @returns The array of option values of the first element found.
|
|
123
|
+
*/
|
|
124
|
+
selectOption(
|
|
125
|
+
selector: string,
|
|
126
|
+
values: string | ElementHandle | SelectOptionsObject | string[] | ElementHandle[] | SelectOptionsObject[],
|
|
127
|
+
options?: ElementHandleOptions & StrictnessOptions): string[];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Dispatches an event for the first element matching the selector.
|
|
131
|
+
* @param selector The selector to use.
|
|
132
|
+
* @param type The type of event to dispatch.
|
|
133
|
+
* @param eventInit The event initialization properties.
|
|
134
|
+
* @param options The options to use.
|
|
135
|
+
*/
|
|
136
|
+
dispatchEvent(selector: string, type: string, eventInit?: object, options?: TimeoutOptions & StrictnessOptions): void;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Returns the value of the `pageFunction` invocation.
|
|
140
|
+
*
|
|
141
|
+
* A string can also be passed in instead of a function.
|
|
142
|
+
*
|
|
143
|
+
* @param pageFunction Function to be evaluated in the page context.
|
|
144
|
+
* @param arg Optional argument to pass to `pageFunction`.
|
|
145
|
+
*/
|
|
146
|
+
evaluate<R, Arg>(pageFunction: PageFunction<Arg, R>, arg?: Arg): R;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Returns the value of the `pageFunction` invocation as a [JSHandle].
|
|
150
|
+
*
|
|
151
|
+
* The only difference between page.evaluate(pageFunction[, arg]) and
|
|
152
|
+
* page.evaluateHandle(pageFunction[, arg]) is that
|
|
153
|
+
* page.evaluateHandle(pageFunction[, arg])returns [JSHandle].
|
|
154
|
+
*
|
|
155
|
+
* @param pageFunction Function to be evaluated in the page context.
|
|
156
|
+
* @param arg Optional argument to pass to `pageFunction`.
|
|
157
|
+
*/
|
|
158
|
+
evaluateHandle<R, Arg>(pageFunction: PageFunction<Arg, R>, arg?: Arg): JSHandle<R>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Get the page that owns frame.
|
|
162
|
+
* @returns The page that owns frame.
|
|
163
|
+
*/
|
|
164
|
+
page(): Page;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Get the parent frame.
|
|
168
|
+
* @returns The parent frame, or `null` if there is no parent frame.
|
|
169
|
+
*/
|
|
170
|
+
parentFrame(): Frame|null;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Get a list of all child frames.
|
|
174
|
+
* @returns A list of all child frames.
|
|
175
|
+
*/
|
|
176
|
+
childFrames(): Frame[];
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Get the `ElementHandle` for this frame.
|
|
180
|
+
* @returns The `ElementHandle` for this frame.
|
|
181
|
+
*/
|
|
182
|
+
frameElement(): ElementHandle;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Navigate the frame to the specified URL and return a HTTP response object.
|
|
186
|
+
* @param url The URL to navigate to.
|
|
187
|
+
* @param options The options to use.
|
|
188
|
+
* @returns A promise that resolves to the HTTP response object.
|
|
189
|
+
*/
|
|
190
|
+
goto(url: string, options?: NavigationOptions): Promise<Response|null>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Replace the entire HTML document content.
|
|
194
|
+
* @param html The HTML to use.
|
|
195
|
+
* @param options The options to use.
|
|
196
|
+
*/
|
|
197
|
+
setContent(html: string, options?: ContentLoadOptions): void;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Get the name of the frame.
|
|
201
|
+
* @returns The name of the frame.
|
|
202
|
+
*/
|
|
203
|
+
name(): string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get the title of the frame.
|
|
207
|
+
* @returns The title of the frame.
|
|
208
|
+
*/
|
|
209
|
+
title(): string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Get the URL of the frame.
|
|
213
|
+
* @returns The URL of the frame.
|
|
214
|
+
*/
|
|
215
|
+
url(): string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Get the HTML content of the frame.
|
|
219
|
+
* @returns The HTML content of the frame.
|
|
220
|
+
*/
|
|
221
|
+
content(): string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get whether the frame is detached or not.
|
|
225
|
+
* @returns `true` if the frame is detached, `false` otherwise.
|
|
226
|
+
*/
|
|
227
|
+
isDetached(): boolean;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Сreates and returns a new locator for this frame.
|
|
231
|
+
* @param selector The selector to use.
|
|
232
|
+
* @returns The new locator.
|
|
233
|
+
*/
|
|
234
|
+
locator(selector: string): Locator;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Get the `innerHTML` attribute of the first element found that matches the selector.
|
|
238
|
+
* @param selector The selector to use.
|
|
239
|
+
* @param options The options to use.
|
|
240
|
+
* @returns The `innerHTML` attribute of the first element found.
|
|
241
|
+
*/
|
|
242
|
+
innerHTML(selector: string, options?: TimeoutOptions & StrictnessOptions): string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Get the `innerText` attribute of the first element found that matches the selector.
|
|
246
|
+
* @param selector The selector to use.
|
|
247
|
+
* @param options The options to use.
|
|
248
|
+
* @returns The `innerText` attribute of the first element found.
|
|
249
|
+
*/
|
|
250
|
+
innerText(selector: string, options?: TimeoutOptions & StrictnessOptions): string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Get the text content of the first element found that matches the selector.
|
|
254
|
+
* @param selector The selector to use.
|
|
255
|
+
* @param options The options to use.
|
|
256
|
+
* @returns The text content of the first element found.
|
|
257
|
+
*/
|
|
258
|
+
textContent(selector: string, options?: TimeoutOptions & StrictnessOptions): string;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Get the value of an attribute of the first element found that matches the selector.
|
|
262
|
+
* @param selector The selector to use.
|
|
263
|
+
* @param name The name of the attribute to get.
|
|
264
|
+
* @param options The options to use.
|
|
265
|
+
* @returns The value of the attribute.
|
|
266
|
+
*/
|
|
267
|
+
getAttribute(selector: string, name: string, options?: TimeoutOptions & StrictnessOptions): string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Get the input value of the first element found that matches the selector.
|
|
271
|
+
* @param selector The selector to use.
|
|
272
|
+
* @param options The options to use.
|
|
273
|
+
* @returns The input value of the first element found.
|
|
274
|
+
*/
|
|
275
|
+
inputValue(selector: string, options?: TimeoutOptions & StrictnessOptions): string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Get the `checked` attribute of the first checkbox element found that matches the selector.
|
|
279
|
+
* @param selector The selector to use.
|
|
280
|
+
* @param options The options to use.
|
|
281
|
+
* @returns `true` if the checkbox is checked, `false` otherwise.
|
|
282
|
+
*/
|
|
283
|
+
isChecked(selector: string, options?: TimeoutOptions & StrictnessOptions): boolean;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Get whether the first element found that matches the selector is disabled or not.
|
|
287
|
+
* @param selector The selector to use.
|
|
288
|
+
* @param options The options to use.
|
|
289
|
+
* @returns `true` if the element is disabled, `false` otherwise.
|
|
290
|
+
*/
|
|
291
|
+
isDisabled(selector: string, options?: TimeoutOptions & StrictnessOptions): boolean;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Get whether the first element found that matches the selector is enabled or not.
|
|
295
|
+
* @param selector The selector to use.
|
|
296
|
+
* @param options The options to use.
|
|
297
|
+
* @returns `true` if the element is enabled, `false` otherwise.
|
|
298
|
+
*/
|
|
299
|
+
isEnabled(selector: string, options?: TimeoutOptions & StrictnessOptions): boolean;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Get whether the first element found that matches the selector is editable or not.
|
|
303
|
+
* @param selector The selector to use.
|
|
304
|
+
* @param options The options to use.
|
|
305
|
+
* @returns `true` if the element is editable, `false` otherwise.
|
|
306
|
+
*/
|
|
307
|
+
isEditable(selector: string, options?: TimeoutOptions & StrictnessOptions): boolean;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Get whether the first element found that matches the selector is hidden or not.
|
|
311
|
+
* @param selector The selector to use.
|
|
312
|
+
* @param options The options to use.
|
|
313
|
+
* @returns `true` if the element is hidden, `false` otherwise.
|
|
314
|
+
*/
|
|
315
|
+
isHidden(selector: string, options?: TimeoutOptions & StrictnessOptions): boolean;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Get whether the first element found that matches the selector is visible or not.
|
|
319
|
+
* @param selector The selector to use.
|
|
320
|
+
* @param options The options to use.
|
|
321
|
+
* @returns `true` if the element is visible, `false` otherwise.
|
|
322
|
+
*/
|
|
323
|
+
isVisible(selector: string, options?: TimeoutOptions & StrictnessOptions): boolean;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Wait for the given function to return a truthy value.
|
|
327
|
+
* @param predicate The function to call and wait for.
|
|
328
|
+
* @param options The options to use.
|
|
329
|
+
*/
|
|
330
|
+
waitForFunction<R, Arg>(pageFunction: PageFunction<Arg, R>, options?: PollingOptions & TimeoutOptions, arg?: Arg): Promise<JSHandle<R>>;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Wait for the given load state to be reached.
|
|
334
|
+
* This will unblock if that lifecycle event has already been received.
|
|
335
|
+
* @param state The load state to wait for, defaults to `load`.
|
|
336
|
+
* @param options The options to use.
|
|
337
|
+
*/
|
|
338
|
+
waitForLoadState(state?: LifecycleEvent, options?: TimeoutOptions): void;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Waits for the navigation event to happen.
|
|
342
|
+
* @param options The options to use.
|
|
343
|
+
* @returns A promise that resolves to the response of the navigation when it happens.
|
|
344
|
+
*/
|
|
345
|
+
waitForNavigation(options?: ContentLoadOptions): Promise<Response|null>;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Wait for the given selector to match the waiting criteria.
|
|
349
|
+
* @param selector The selector to use.
|
|
350
|
+
* @param options The options to use.
|
|
351
|
+
* @returns The first element found that matches the selector.
|
|
352
|
+
*/
|
|
353
|
+
waitForSelector(selector: string, options?: ElementStateFilter & TimeoutOptions & StrictnessOptions): ElementHandle;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Wait for the given timeout to elapse.
|
|
357
|
+
* @param timeout The timeout to wait for.
|
|
358
|
+
*/
|
|
359
|
+
waitForTimeout(timeout: number): void;
|
|
360
|
+
}
|