Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dotnet/docs/api/class-consolemessage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ ConsoleMessage.Type
**Returns**
- [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="console-message-type-return"/><a href="#console-message-type-return" class="list-anchor">#</a>

---

### Worker {#console-message-worker}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>consoleMessage.Worker</x-search>

The web worker or service worker that produced this console message, if any. Note that console messages from web workers also have non-null [ConsoleMessage.Page](/api/class-consolemessage.mdx#console-message-page).

**Usage**

```csharp
ConsoleMessage.Worker
```

**Returns**
- [Worker]?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="console-message-worker-return"/><a href="#console-message-worker-return" class="list-anchor">#</a>


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
3 changes: 3 additions & 0 deletions dotnet/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ await Frame.DragAndDropAsync(source, target, options);


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `Steps` [int]? *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-drag-and-drop-option-steps"/><a href="#frame-drag-and-drop-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `Strict` [bool]? *(optional)* <font size="2">Added in: v1.14</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-drag-and-drop-option-strict"/><a href="#frame-drag-and-drop-option-strict" class="list-anchor">#</a>

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
Expand Down
3 changes: 3 additions & 0 deletions dotnet/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ await source.DragToAsync(target, new()


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `Steps` [int]? *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="locator-drag-to-option-steps"/><a href="#locator-drag-to-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `TargetPosition` TargetPosition? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="locator-drag-to-option-target-position"/><a href="#locator-drag-to-option-target-position" class="list-anchor">#</a>
- `X` [float]

Expand Down
3 changes: 3 additions & 0 deletions dotnet/docs/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ await Page.DragAndDropAsync("#source", "#target", new()


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `Steps` [int]? *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-drag-and-drop-option-steps"/><a href="#page-drag-and-drop-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `Strict` [bool]? *(optional)* <font size="2">Added in: v1.14</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-drag-and-drop-option-strict"/><a href="#page-drag-and-drop-option-strict" class="list-anchor">#</a>

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
Expand Down
17 changes: 17 additions & 0 deletions dotnet/docs/api/class-worker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,23 @@ Worker.Close += async (_, worker) => {};
**Event data**
- [Worker]

---

### event Console {#worker-event-console}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>worker.event Console</x-search>

Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.

**Usage**

```csharp
Worker.Console += async (_, consoleMessage) => {};
```

**Event data**
- [ConsoleMessage]


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
17 changes: 17 additions & 0 deletions java/docs/api/class-consolemessage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,23 @@ ConsoleMessage.type();
**Returns**
- [String]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="console-message-type-return"/><a href="#console-message-type-return" class="list-anchor">#</a>

---

### worker {#console-message-worker}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>consoleMessage.worker</x-search>

The web worker or service worker that produced this console message, if any. Note that console messages from web workers also have non-null [ConsoleMessage.page()](/api/class-consolemessage.mdx#console-message-page).

**Usage**

```java
ConsoleMessage.worker();
```

**Returns**
- [null] | [Worker]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="console-message-worker-return"/><a href="#console-message-worker-return" class="list-anchor">#</a>


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
3 changes: 3 additions & 0 deletions java/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ Frame.dragAndDrop(source, target, options);


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `setSteps` [int] *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-drag-and-drop-option-steps"/><a href="#frame-drag-and-drop-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `setStrict` [boolean] *(optional)* <font size="2">Added in: v1.14</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-drag-and-drop-option-strict"/><a href="#frame-drag-and-drop-option-strict" class="list-anchor">#</a>

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
Expand Down
3 changes: 3 additions & 0 deletions java/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ source.dragTo(target, new Locator.DragToOptions()


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `setSteps` [int] *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="locator-drag-to-option-steps"/><a href="#locator-drag-to-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `setTargetPosition` TargetPosition *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="locator-drag-to-option-target-position"/><a href="#locator-drag-to-option-target-position" class="list-anchor">#</a>
- `setX` [double]

Expand Down
3 changes: 3 additions & 0 deletions java/docs/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ page.dragAndDrop("#source", "#target", new Page.DragAndDropOptions()


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `setSteps` [int] *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-drag-and-drop-option-steps"/><a href="#page-drag-and-drop-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `setStrict` [boolean] *(optional)* <font size="2">Added in: v1.14</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-drag-and-drop-option-strict"/><a href="#page-drag-and-drop-option-strict" class="list-anchor">#</a>

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
Expand Down
17 changes: 17 additions & 0 deletions java/docs/api/class-worker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,23 @@ Worker.onClose(handler)
**Event data**
- [Worker]

---

### onConsole(handler) {#worker-event-console}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>worker.onConsole(handler)</x-search>

Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.

**Usage**

```java
Worker.onConsole(handler)
```

**Event data**
- [ConsoleMessage]


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
17 changes: 17 additions & 0 deletions nodejs/docs/api/class-consolemessage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,23 @@ consoleMessage.type();
**Returns**
- "log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd"<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="console-message-type-return"/><a href="#console-message-type-return" class="list-anchor">#</a>

---

### worker {#console-message-worker}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>consoleMessage.worker</x-search>

The web worker or service worker that produced this console message, if any. Note that console messages from web workers also have non-null [consoleMessage.page()](/api/class-consolemessage.mdx#console-message-page).

**Usage**

```js
consoleMessage.worker();
```

**Returns**
- [null] | [Worker]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="console-message-worker-return"/><a href="#console-message-worker-return" class="list-anchor">#</a>


[Android]: /api/class-android.mdx "Android"
[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice"
Expand Down
3 changes: 3 additions & 0 deletions nodejs/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ await frame.dragAndDrop(source, target, options);


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `steps` [number] *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-drag-and-drop-option-steps"/><a href="#frame-drag-and-drop-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `strict` [boolean] *(optional)* <font size="2">Added in: v1.14</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-drag-and-drop-option-strict"/><a href="#frame-drag-and-drop-option-strict" class="list-anchor">#</a>

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
Expand Down
3 changes: 3 additions & 0 deletions nodejs/docs/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ await source.dragTo(target, {


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `steps` [number] *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="locator-drag-to-option-steps"/><a href="#locator-drag-to-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `targetPosition` [Object] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="locator-drag-to-option-target-position"/><a href="#locator-drag-to-option-target-position" class="list-anchor">#</a>
- `x` [number]

Expand Down
3 changes: 3 additions & 0 deletions nodejs/docs/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ await page.dragAndDrop('#source', '#target', {


Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
- `steps` [number] *(optional)* <font size="2">Added in: v1.57</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-drag-and-drop-option-steps"/><a href="#page-drag-and-drop-option-steps" class="list-anchor">#</a>

Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
- `strict` [boolean] *(optional)* <font size="2">Added in: v1.14</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-drag-and-drop-option-strict"/><a href="#page-drag-and-drop-option-strict" class="list-anchor">#</a>

When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.
Expand Down
6 changes: 3 additions & 3 deletions nodejs/docs/api/class-testconfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1110,14 +1110,14 @@ export default defineConfig({
- `wait` [Object] *(optional)*
- `stdout` [RegExp] *(optional)*


Regular expression to wait for in the `stdout` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?<my_server_port>\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`.
- `stderr` [RegExp] *(optional)*


Regular expression to wait for in the `stderr` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?<my_server_port>\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`.
- `time` [number] *(optional)*


Consider command started only when given output has been produced or a time in milliseconds has passed.
Consider command started only when given output has been produced.
- `timeout` [number] *(optional)*

How long to wait for the process to start up and be available in milliseconds. Defaults to 60000.
Expand Down
55 changes: 55 additions & 0 deletions nodejs/docs/api/class-worker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,44 @@ worker.url();

---

### waitForEvent {#worker-wait-for-event}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>worker.waitForEvent</x-search>

Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value. Will throw an error if the page is closed before the event is fired. Returns the event data value.

**Usage**

```js
// Start waiting for download before clicking. Note no await.
const consolePromise = worker.waitForEvent('console');
await worker.evaluate('console.log(42)');
const consoleMessage = await consolePromise;
```

**Arguments**
- `event` [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-event-option-event"/><a href="#worker-wait-for-event-option-event" class="list-anchor">#</a>

Event name, same one typically passed into `*.on(event)`.
- `optionsOrPredicate` [function] | [Object] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-event-option-options-or-predicate"/><a href="#worker-wait-for-event-option-options-or-predicate" class="list-anchor">#</a>
- `predicate` [function]

Receives the event data and resolves to truthy value when the waiting should resolve.
- `timeout` [number] *(optional)*

Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods.

Either a predicate that receives an event or an options object. Optional.
- `options` [Object] *(optional)*
- `predicate` [function] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-event-option-predicate"/><a href="#worker-wait-for-event-option-predicate" class="list-anchor">#</a>

Receives the event data and resolves to truthy value when the waiting should resolve.

**Returns**
- [Promise]&lt;[Object]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="worker-wait-for-event-return"/><a href="#worker-wait-for-event-return" class="list-anchor">#</a>

---

## Events

### on('close') {#worker-event-close}
Expand All @@ -117,6 +155,23 @@ worker.on('close', data => {});
**Event data**
- [Worker]

---

### on('console') {#worker-event-console}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.57</font><x-search>worker.on('console')</x-search>

Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.

**Usage**

```js
worker.on('console', data => {});
```

**Event data**
- [ConsoleMessage]


[Android]: /api/class-android.mdx "Android"
[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice"
Expand Down
Loading
Loading