Skip to content

Commit b8ee5ae

Browse files
authored
docs: release notes for v1.61 (#41261)
1 parent 49c1f69 commit b8ee5ae

5 files changed

Lines changed: 449 additions & 0 deletions

File tree

‎docs/src/api/class-credentials.md‎

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,76 @@ await page.goto('https://example.com/login');
3333
// The page's navigator.credentials.get() is answered with the seeded passkey.
3434
```
3535

36+
```java
37+
BrowserContext context = browser.newContext();
38+
39+
// A passkey your backend already provisioned for a test user.
40+
context.credentials().create("example.com", new Credentials.CreateOptions()
41+
.setId(knownCredentialId) // base64url
42+
.setUserHandle(knownUserHandle) // base64url
43+
.setPrivateKey(knownPrivateKey) // base64url PKCS#8 (DER)
44+
.setPublicKey(knownPublicKey)); // base64url SPKI (DER)
45+
context.credentials().install();
46+
47+
Page page = context.newPage();
48+
page.navigate("https://example.com/login");
49+
// The page's navigator.credentials.get() is answered with the seeded passkey.
50+
```
51+
52+
```python async
53+
context = await browser.new_context()
54+
55+
# A passkey your backend already provisioned for a test user.
56+
await context.credentials.create(
57+
"example.com",
58+
id=known_credential_id, # base64url
59+
user_handle=known_user_handle, # base64url
60+
private_key=known_private_key, # base64url PKCS#8 (DER)
61+
public_key=known_public_key, # base64url SPKI (DER)
62+
)
63+
await context.credentials.install()
64+
65+
page = await context.new_page()
66+
await page.goto("https://example.com/login")
67+
# The page's navigator.credentials.get() is answered with the seeded passkey.
68+
```
69+
70+
```python sync
71+
context = browser.new_context()
72+
73+
# A passkey your backend already provisioned for a test user.
74+
context.credentials.create(
75+
"example.com",
76+
id=known_credential_id, # base64url
77+
user_handle=known_user_handle, # base64url
78+
private_key=known_private_key, # base64url PKCS#8 (DER)
79+
public_key=known_public_key, # base64url SPKI (DER)
80+
)
81+
context.credentials.install()
82+
83+
page = context.new_page()
84+
page.goto("https://example.com/login")
85+
# The page's navigator.credentials.get() is answered with the seeded passkey.
86+
```
87+
88+
```csharp
89+
var context = await browser.NewContextAsync();
90+
91+
// A passkey your backend already provisioned for a test user.
92+
await context.Credentials.CreateAsync("example.com", new()
93+
{
94+
Id = knownCredentialId, // base64url
95+
UserHandle = knownUserHandle, // base64url
96+
PrivateKey = knownPrivateKey, // base64url PKCS#8 (DER)
97+
PublicKey = knownPublicKey, // base64url SPKI (DER)
98+
});
99+
await context.Credentials.InstallAsync();
100+
101+
var page = await context.NewPageAsync();
102+
await page.GotoAsync("https://example.com/login");
103+
// The page's navigator.credentials.get() is answered with the seeded passkey.
104+
```
105+
36106
**Usage: capture a passkey, then reuse it**
37107

38108
```js
@@ -49,6 +119,65 @@ const [credential] = await context.credentials.get({ rpId: 'example.com' });
49119
fs.writeFileSync('playwright/.auth/passkey.json', JSON.stringify(credential));
50120
```
51121

122+
```java
123+
// setup test: let the app register a passkey, then save it.
124+
BrowserContext context = browser.newContext();
125+
context.credentials().install();
126+
127+
Page page = context.newPage();
128+
page.navigate("https://example.com/register");
129+
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Create a passkey")).click();
130+
131+
// Read back the passkey the page registered — it includes the private key.
132+
VirtualCredential credential = context.credentials().get(
133+
new Credentials.GetOptions().setRpId("example.com")).get(0);
134+
Files.writeString(Paths.get("playwright/.auth/passkey.json"), new Gson().toJson(credential));
135+
```
136+
137+
```python async
138+
# setup test: let the app register a passkey, then save it.
139+
context = await browser.new_context()
140+
await context.credentials.install()
141+
142+
page = await context.new_page()
143+
await page.goto("https://example.com/register")
144+
await page.get_by_role("button", name="Create a passkey").click()
145+
146+
# Read back the passkey the page registered — it includes the private key.
147+
[credential] = await context.credentials.get(rp_id="example.com")
148+
with open("playwright/.auth/passkey.json", "w") as f:
149+
json.dump(credential, f)
150+
```
151+
152+
```python sync
153+
# setup test: let the app register a passkey, then save it.
154+
context = browser.new_context()
155+
context.credentials.install()
156+
157+
page = context.new_page()
158+
page.goto("https://example.com/register")
159+
page.get_by_role("button", name="Create a passkey").click()
160+
161+
# Read back the passkey the page registered — it includes the private key.
162+
[credential] = context.credentials.get(rp_id="example.com")
163+
with open("playwright/.auth/passkey.json", "w") as f:
164+
json.dump(credential, f)
165+
```
166+
167+
```csharp
168+
// setup test: let the app register a passkey, then save it.
169+
var context = await browser.NewContextAsync();
170+
await context.Credentials.InstallAsync();
171+
172+
var page = await context.NewPageAsync();
173+
await page.GotoAsync("https://example.com/register");
174+
await page.GetByRole(AriaRole.Button, new() { Name = "Create a passkey" }).ClickAsync();
175+
176+
// Read back the passkey the page registered — it includes the private key.
177+
var credentials = await context.Credentials.GetAsync(new() { RpId = "example.com" });
178+
File.WriteAllText("playwright/.auth/passkey.json", JsonSerializer.Serialize(credentials[0]));
179+
```
180+
52181
```js
53182
// later test: seed the captured passkey so the app starts already enrolled.
54183
const credential = JSON.parse(fs.readFileSync('playwright/.auth/passkey.json', 'utf8'));
@@ -61,6 +190,80 @@ await page.goto('https://example.com/login');
61190
// navigator.credentials.get() resolves the captured passkey — already signed in.
62191
```
63192

193+
```java
194+
// later test: seed the captured passkey so the app starts already enrolled.
195+
VirtualCredential credential = new Gson().fromJson(
196+
Files.readString(Paths.get("playwright/.auth/passkey.json")), VirtualCredential.class);
197+
BrowserContext context = browser.newContext();
198+
context.credentials().create(credential.rpId, new Credentials.CreateOptions()
199+
.setId(credential.id)
200+
.setUserHandle(credential.userHandle)
201+
.setPrivateKey(credential.privateKey)
202+
.setPublicKey(credential.publicKey));
203+
context.credentials().install();
204+
205+
Page page = context.newPage();
206+
page.navigate("https://example.com/login");
207+
// navigator.credentials.get() resolves the captured passkey — already signed in.
208+
```
209+
210+
```python async
211+
# later test: seed the captured passkey so the app starts already enrolled.
212+
with open("playwright/.auth/passkey.json") as f:
213+
credential = json.load(f)
214+
context = await browser.new_context()
215+
await context.credentials.create(
216+
credential["rpId"],
217+
id=credential["id"],
218+
user_handle=credential["userHandle"],
219+
private_key=credential["privateKey"],
220+
public_key=credential["publicKey"],
221+
)
222+
await context.credentials.install()
223+
224+
page = await context.new_page()
225+
await page.goto("https://example.com/login")
226+
# navigator.credentials.get() resolves the captured passkey — already signed in.
227+
```
228+
229+
```python sync
230+
# later test: seed the captured passkey so the app starts already enrolled.
231+
with open("playwright/.auth/passkey.json") as f:
232+
credential = json.load(f)
233+
context = browser.new_context()
234+
context.credentials.create(
235+
credential["rpId"],
236+
id=credential["id"],
237+
user_handle=credential["userHandle"],
238+
private_key=credential["privateKey"],
239+
public_key=credential["publicKey"],
240+
)
241+
context.credentials.install()
242+
243+
page = context.new_page()
244+
page.goto("https://example.com/login")
245+
# navigator.credentials.get() resolves the captured passkey — already signed in.
246+
```
247+
248+
```csharp
249+
// later test: seed the captured passkey so the app starts already enrolled.
250+
var credential = JsonSerializer.Deserialize<VirtualCredential>(
251+
File.ReadAllText("playwright/.auth/passkey.json"));
252+
var context = await browser.NewContextAsync();
253+
await context.Credentials.CreateAsync(credential.RpId, new()
254+
{
255+
Id = credential.Id,
256+
UserHandle = credential.UserHandle,
257+
PrivateKey = credential.PrivateKey,
258+
PublicKey = credential.PublicKey,
259+
});
260+
await context.Credentials.InstallAsync();
261+
262+
var page = await context.NewPageAsync();
263+
await page.GotoAsync("https://example.com/login");
264+
// navigator.credentials.get() resolves the captured passkey — already signed in.
265+
```
266+
64267
**Defaults**
65268

66269
- The authenticator presents itself as a **platform** authenticator (`authenticatorAttachment` is

‎docs/src/release-notes-csharp.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,65 @@ toc_max_heading_level: 2
66

77
import LiteYouTube from '@site/src/components/LiteYouTube';
88

9+
## Version 1.61
10+
11+
### 🔑 WebAuthn passkeys
12+
13+
New [Credentials] virtual authenticator, available via [`property: BrowserContext.credentials`], lets tests register passkeys and answer `navigator.credentials.create()` / `navigator.credentials.get()` ceremonies in the page — no real hardware key required, works in all browsers:
14+
15+
```csharp
16+
var context = await browser.NewContextAsync();
17+
18+
// Seed a passkey your backend provisioned for a test user.
19+
await context.Credentials.CreateAsync("example.com", new()
20+
{
21+
Id = credentialId,
22+
UserHandle = userHandle,
23+
PrivateKey = privateKey,
24+
PublicKey = publicKey,
25+
});
26+
await context.Credentials.InstallAsync();
27+
28+
var page = await context.NewPageAsync();
29+
await page.GotoAsync("https://example.com/login");
30+
// The page's navigator.credentials.get() is answered with the seeded passkey.
31+
```
32+
33+
You can also let the app register a passkey once in a setup test, read it back with [`method: Credentials.get`], and seed it into later tests — see [Credentials] for details.
34+
35+
### 🗃️ Web Storage
36+
37+
New [WebStorage] API, available via [`property: Page.localStorage`] and [`property: Page.sessionStorage`], reads and writes the page's storage for the current origin:
38+
39+
```csharp
40+
await page.LocalStorage.SetItemAsync("token", "abc");
41+
var token = await page.LocalStorage.GetItemAsync("token");
42+
var items = await page.SessionStorage.ItemsAsync();
43+
```
44+
45+
### New APIs
46+
47+
- [`method: APIResponse.securityDetails`] and [`method: APIResponse.serverAddr`] mirror the browser-side [`method: Response.securityDetails`] and [`method: Response.serverAddr`].
48+
- New option `ArtifactsDir` in [`method: BrowserType.connectOverCDP`] controls where artifacts such as traces and downloads are stored when attached to an existing browser.
49+
- New option `Cursor` in [`method: Screencast.showActions`] controls the cursor decoration rendered for pointer actions.
50+
- The `OnFrame` callback in [`method: Screencast.start`] now receives a `Timestamp` of when the frame was presented by the browser.
51+
52+
### 🛠️ Other improvements
53+
54+
- Playwright now supports Ubuntu 26.04.
55+
56+
### Browser Versions
57+
58+
- Chromium 149.0.7827.55
59+
- Mozilla Firefox 151.0
60+
- WebKit 26.5
61+
62+
This version was also tested against the following stable channels:
63+
64+
- Google Chrome 149
65+
- Microsoft Edge 149
66+
67+
968
## Version 1.60
1069

1170
### 🌐 HAR recording on Tracing

‎docs/src/release-notes-java.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,63 @@ toc_max_heading_level: 2
66

77
import LiteYouTube from '@site/src/components/LiteYouTube';
88

9+
## Version 1.61
10+
11+
### 🔑 WebAuthn passkeys
12+
13+
New [Credentials] virtual authenticator, available via [`property: BrowserContext.credentials`], lets tests register passkeys and answer `navigator.credentials.create()` / `navigator.credentials.get()` ceremonies in the page — no real hardware key required, works in all browsers:
14+
15+
```java
16+
BrowserContext context = browser.newContext();
17+
18+
// Seed a passkey your backend provisioned for a test user.
19+
context.credentials().create("example.com", new Credentials.CreateOptions()
20+
.setId(credentialId)
21+
.setUserHandle(userHandle)
22+
.setPrivateKey(privateKey)
23+
.setPublicKey(publicKey));
24+
context.credentials().install();
25+
26+
Page page = context.newPage();
27+
page.navigate("https://example.com/login");
28+
// The page's navigator.credentials.get() is answered with the seeded passkey.
29+
```
30+
31+
You can also let the app register a passkey once in a setup test, read it back with [`method: Credentials.get`], and seed it into later tests — see [Credentials] for details.
32+
33+
### 🗃️ Web Storage
34+
35+
New [WebStorage] API, available via [`property: Page.localStorage`] and [`property: Page.sessionStorage`], reads and writes the page's storage for the current origin:
36+
37+
```java
38+
page.localStorage().setItem("token", "abc");
39+
String token = page.localStorage().getItem("token");
40+
List<NameValue> items = page.sessionStorage().items();
41+
```
42+
43+
### New APIs
44+
45+
- [`method: APIResponse.securityDetails`] and [`method: APIResponse.serverAddr`] mirror the browser-side [`method: Response.securityDetails`] and [`method: Response.serverAddr`].
46+
- New option `artifactsDir` in [`method: BrowserType.connectOverCDP`] controls where artifacts such as traces and downloads are stored when attached to an existing browser.
47+
- New option `cursor` in [`method: Screencast.showActions`] controls the cursor decoration rendered for pointer actions.
48+
- The `onFrame` callback in [`method: Screencast.start`] now receives a `timestamp` of when the frame was presented by the browser.
49+
50+
### 🛠️ Other improvements
51+
52+
- Playwright now supports Ubuntu 26.04.
53+
54+
### Browser Versions
55+
56+
- Chromium 149.0.7827.55
57+
- Mozilla Firefox 151.0
58+
- WebKit 26.5
59+
60+
This version was also tested against the following stable channels:
61+
62+
- Google Chrome 149
63+
- Microsoft Edge 149
64+
65+
966
## Version 1.60
1067

1168
### 🌐 HAR recording on Tracing

0 commit comments

Comments
 (0)