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
54 changes: 54 additions & 0 deletions dotnet/docs/api/class-apiresponse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,60 @@ ApiResponse.Ok
**Returns**
- [bool]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-ok-return"/><a href="#api-response-ok-return" class="list-anchor">#</a>

---

### SecurityDetailsAsync {#api-response-security-details}

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

Returns SSL and other security information. Resolves to `null` for non-HTTPS responses. For redirected requests, returns the information for the last request in the redirect chain.

**Usage**

```csharp
await ApiResponse.SecurityDetailsAsync();
```

**Returns**
- SecurityDetails?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-security-details-return"/><a href="#api-response-security-details-return" class="list-anchor">#</a>
- `issuer` [string]? *(optional)*

Common Name component of the Issuer field. from the certificate. This should only be used for informational purposes. Optional.
- `protocol` [string]? *(optional)*

The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.
- `subjectName` [string]? *(optional)*

Common Name component of the Subject field from the certificate. This should only be used for informational purposes. Optional.
- `validFrom` [float]? *(optional)*

Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.
- `validTo` [float]? *(optional)*

Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.

---

### ServerAddrAsync {#api-response-server-addr}

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

Returns the IP address and port of the server. Resolves to `null` if the server address is not available. For redirected requests, returns the information for the last request in the redirect chain.

**Usage**

```csharp
await ApiResponse.ServerAddrAsync();
```

**Returns**
- ServerAddr?<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-server-addr-return"/><a href="#api-response-server-addr-return" class="list-anchor">#</a>
- `ipAddress` [string]

IPv4 or IPV6 address of the server.
- `port` [int]


---

### Status {#api-response-status}
Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Console.WriteLine(await frame.EvaluateAsync<int>("1 + 2")); // prints "3"
[ElementHandle] instances can be passed as an argument to the [Frame.EvaluateAsync()](/api/class-frame.mdx#frame-evaluate):

```csharp
var bodyHandle = await frame.EvaluateAsync("document.body");
var bodyHandle = await frame.EvaluateHandleAsync("document.body");
var html = await frame.EvaluateAsync<string>("([body, suffix]) => body.innerHTML + suffix", new object [] { bodyHandle, "hello" });
await bodyHandle.DisposeAsync();
```
Expand Down
4 changes: 2 additions & 2 deletions dotnet/docs/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Console.WriteLine(await page.EvaluateAsync<int>("1 + 2")); // prints "3"
[ElementHandle] instances can be passed as an argument to the [Page.EvaluateAsync()](/api/class-page.mdx#page-evaluate):

```csharp
var bodyHandle = await page.EvaluateAsync("document.body");
var bodyHandle = await page.EvaluateHandleAsync("document.body");
var html = await page.EvaluateAsync<string>("([body, suffix]) => body.innerHTML + suffix", new object [] { bodyHandle, "hello" });
await bodyHandle.DisposeAsync();
```
Expand Down Expand Up @@ -4767,7 +4767,7 @@ When all steps combined have not finished during the specified [Timeout](/api/cl

:::note

[Page.TapAsync()](/api/class-page.mdx#page-tap) the method will throw if [HasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
[Page.TapAsync()](/api/class-page.mdx#page-tap) will throw if the [HasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
:::

**Usage**
Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/api/class-touchscreen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Dispatches a `touchstart` and `touchend` event with a single touch at the positi

:::note

[Page.TapAsync()](/api/class-page.mdx#page-tap) the method will throw if [HasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
[Touchscreen.TapAsync()](/api/class-touchscreen.mdx#touchscreen-tap) will throw if the [HasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
:::

**Usage**
Expand Down
10 changes: 5 additions & 5 deletions dotnet/docs/ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright/dotnet:v1.59.0-noble
image: mcr.microsoft.com/playwright/dotnet:v1.60.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -159,7 +159,7 @@ trigger:

pool:
vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright/dotnet:v1.59.0-noble
container: mcr.microsoft.com/playwright/dotnet:v1.60.0-noble

steps:
- task: UseDotNet@2
Expand All @@ -182,7 +182,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-noble-development:
docker:
- image: mcr.microsoft.com/playwright/dotnet:v1.59.0-noble
- image: mcr.microsoft.com/playwright/dotnet:v1.60.0-noble
```

Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures.
Expand All @@ -193,7 +193,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](

```groovy
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.59.0-noble' } }
agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.60.0-noble' } }
stages {
stage('e2e-tests') {
steps {
Expand All @@ -210,7 +210,7 @@ pipeline {
Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)).

```yml
image: mcr.microsoft.com/playwright/dotnet:v1.59.0-noble
image: mcr.microsoft.com/playwright/dotnet:v1.60.0-noble
```

### GitLab CI
Expand Down
16 changes: 8 additions & 8 deletions dotnet/docs/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This Docker image is intended to be used for testing and development purposes on
### Pull the image

```bash
docker pull mcr.microsoft.com/playwright/dotnet:v1.59.0-noble
docker pull mcr.microsoft.com/playwright/dotnet:v1.60.0-noble
```

### Run the image
Expand All @@ -34,15 +34,15 @@ By default, the Docker image will use the `root` user to run the browsers. This
On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers.

```bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.59.0-noble /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.60.0-noble /bin/bash
```

#### Crawling and scraping

On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it.

```bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.59.0-noble /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.60.0-noble /bin/bash
```

[`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions:
Expand Down Expand Up @@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the
Start the Playwright Server in Docker:

```bash
docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.59.0-noble /bin/sh -c "npx -y playwright@1.59.0 run-server --port 3000 --host 0.0.0.0"
docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.60.0-noble /bin/sh -c "npx -y playwright@1.60.0 run-server --port 3000 --host 0.0.0.0"
```

#### Connecting to the Server
Expand All @@ -99,7 +99,7 @@ await using var browser = await playwright.Chromium.ConnectAsync("ws://127.0.0.1
If you need to access local servers from within the Docker container:

```bash
docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.59.0-noble /bin/sh -c "npx -y playwright@1.59.0 run-server --port 3000 --host 0.0.0.0"
docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.60.0-noble /bin/sh -c "npx -y playwright@1.60.0 run-server --port 3000 --host 0.0.0.0"
```

This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers.
Expand Down Expand Up @@ -132,9 +132,9 @@ Once this is enabled you can open the port specified in a new browser tab and yo
See [all available image tags].

We currently publish images with the following tags:
- `:v1.59.0` - Playwright v1.59.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.59.0-noble` - Playwright v1.59.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.59.0-jammy` - Playwright v1.59.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.60.0` - Playwright v1.60.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.60.0-noble` - Playwright v1.60.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.60.0-jammy` - Playwright v1.60.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).

:::note

Expand Down
54 changes: 54 additions & 0 deletions java/docs/api/class-apiresponse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,60 @@ APIResponse.ok();
**Returns**
- [boolean]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-ok-return"/><a href="#api-response-ok-return" class="list-anchor">#</a>

---

### securityDetails {#api-response-security-details}

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

Returns SSL and other security information. Resolves to `null` for non-HTTPS responses. For redirected requests, returns the information for the last request in the redirect chain.

**Usage**

```java
APIResponse.securityDetails();
```

**Returns**
- [null] | SecurityDetails<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-security-details-return"/><a href="#api-response-security-details-return" class="list-anchor">#</a>
- `issuer` [String] *(optional)*

Common Name component of the Issuer field. from the certificate. This should only be used for informational purposes. Optional.
- `protocol` [String] *(optional)*

The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.
- `subjectName` [String] *(optional)*

Common Name component of the Subject field from the certificate. This should only be used for informational purposes. Optional.
- `validFrom` [double] *(optional)*

Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.
- `validTo` [double] *(optional)*

Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.

---

### serverAddr {#api-response-server-addr}

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

Returns the IP address and port of the server. Resolves to `null` if the server address is not available. For redirected requests, returns the information for the last request in the redirect chain.

**Usage**

```java
APIResponse.serverAddr();
```

**Returns**
- [null] | ServerAddr<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-server-addr-return"/><a href="#api-response-server-addr-return" class="list-anchor">#</a>
- `ipAddress` [String]

IPv4 or IPV6 address of the server.
- `port` [int]


---

### status {#api-response-status}
Expand Down
2 changes: 1 addition & 1 deletion java/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ System.out.println(frame.evaluate("1 + 2")); // prints "3"
[ElementHandle] instances can be passed as an argument to the [Frame.evaluate()](/api/class-frame.mdx#frame-evaluate):

```java
ElementHandle bodyHandle = frame.evaluate("document.body");
ElementHandle bodyHandle = frame.evaluateHandle("document.body");
String html = (String) frame.evaluate("([body, suffix]) => body.innerHTML + suffix", Arrays.asList(bodyHandle, "hello"));
bodyHandle.dispose();
```
Expand Down
4 changes: 2 additions & 2 deletions java/docs/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ System.out.println(page.evaluate("1 + 2")); // prints "3"
[ElementHandle] instances can be passed as an argument to the [Page.evaluate()](/api/class-page.mdx#page-evaluate):

```java
ElementHandle bodyHandle = page.evaluate("document.body");
ElementHandle bodyHandle = page.evaluateHandle("document.body");
String html = (String) page.evaluate("([body, suffix]) => body.innerHTML + suffix", Arrays.asList(bodyHandle, "hello"));
bodyHandle.dispose();
```
Expand Down Expand Up @@ -4549,7 +4549,7 @@ When all steps combined have not finished during the specified [setTimeout](/api

:::note

[Page.tap()](/api/class-page.mdx#page-tap) the method will throw if [setHasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
[Page.tap()](/api/class-page.mdx#page-tap) will throw if the [setHasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
:::

**Usage**
Expand Down
2 changes: 1 addition & 1 deletion java/docs/api/class-touchscreen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Dispatches a `touchstart` and `touchend` event with a single touch at the positi

:::note

[Page.tap()](/api/class-page.mdx#page-tap) the method will throw if [setHasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
[Touchscreen.tap()](/api/class-touchscreen.mdx#touchscreen-tap) will throw if the [setHasTouch](/api/class-browser.mdx#browser-new-context-option-has-touch) option of the browser context is false.
:::

**Usage**
Expand Down
54 changes: 54 additions & 0 deletions nodejs/docs/api/class-apiresponse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,60 @@ apiResponse.ok();
**Returns**
- [boolean]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-ok-return"/><a href="#api-response-ok-return" class="list-anchor">#</a>

---

### securityDetails {#api-response-security-details}

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

Returns SSL and other security information. Resolves to `null` for non-HTTPS responses. For redirected requests, returns the information for the last request in the redirect chain.

**Usage**

```js
await apiResponse.securityDetails();
```

**Returns**
- [Promise]&lt;[null] | [Object]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-security-details-return"/><a href="#api-response-security-details-return" class="list-anchor">#</a>
- `issuer` [string] *(optional)*

Common Name component of the Issuer field. from the certificate. This should only be used for informational purposes. Optional.
- `protocol` [string] *(optional)*

The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.
- `subjectName` [string] *(optional)*

Common Name component of the Subject field from the certificate. This should only be used for informational purposes. Optional.
- `validFrom` [number] *(optional)*

Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.
- `validTo` [number] *(optional)*

Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.

---

### serverAddr {#api-response-server-addr}

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

Returns the IP address and port of the server. Resolves to `null` if the server address is not available. For redirected requests, returns the information for the last request in the redirect chain.

**Usage**

```js
await apiResponse.serverAddr();
```

**Returns**
- [Promise]&lt;[null] | [Object]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-response-server-addr-return"/><a href="#api-response-server-addr-return" class="list-anchor">#</a>
- `ipAddress` [string]

IPv4 or IPV6 address of the server.
- `port` [number]


---

### status {#api-response-status}
Expand Down
23 changes: 23 additions & 0 deletions nodejs/docs/api/class-electron.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@ const { _electron: electron } = require('playwright');
If you are not able to launch Electron and it will end up in timeouts during launch, try the following:
* Ensure that `nodeCliInspect` ([FuseV1Options.EnableNodeCliInspectArguments](https://www.electronjs.org/docs/latest/tutorial/fuses#nodecliinspect)) fuse is **not** set to `false`.

**Mocking native dialogs:**

Playwright does not intercept the native Electron [dialog](https://www.electronjs.org/docs/latest/api/dialog) API (`dialog.showOpenDialog`, `dialog.showSaveDialog`, `dialog.showMessageBox`, etc.) because those calls happen in the Electron main process and go straight to OS APIs. Use [electronApplication.evaluate()](/api/class-electronapplication.mdx#electron-application-evaluate) to replace the relevant methods in the main process so tests run deterministically without any OS-level UI:

```js
// Stub the open dialog to always return a fixed path.
await electronApp.evaluate(({ dialog }, filePaths) => {
dialog.showOpenDialog = () => Promise.resolve({ canceled: false, filePaths });
}, ['/path/to/file.txt']);

// Stub the save dialog.
await electronApp.evaluate(({ dialog }, filePath) => {
dialog.showSaveDialog = () => Promise.resolve({ canceled: false, filePath });
}, '/path/to/saved.txt');

// Stub showMessageBox to click the first button.
await electronApp.evaluate(({ dialog }) => {
dialog.showMessageBox = () => Promise.resolve({ response: 0, checkboxChecked: false });
});
```

The replacement persists until the application is closed. Synchronous variants (`showOpenDialogSync`, `showSaveDialogSync`, `showMessageBoxSync`) can be stubbed the same way — just return the value directly instead of a `Promise`.


---

Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ console.log(await frame.evaluate('1 + 2')); // prints "3"
[ElementHandle] instances can be passed as an argument to the [frame.evaluate()](/api/class-frame.mdx#frame-evaluate):

```js
const bodyHandle = await frame.evaluate('document.body');
const bodyHandle = await frame.evaluateHandle('document.body');
const html = await frame.evaluate(([body, suffix]) =>
body.innerHTML + suffix, [bodyHandle, 'hello'],
);
Expand Down
Loading
Loading