Skip to content

Commit 41f7b9a

Browse files
authored
chore: fixes uncovered by the .NET 1.61 roll (#41266)
1 parent ba50778 commit 41f7b9a

8 files changed

Lines changed: 93 additions & 51 deletions

File tree

docs/src/api/class-credentials.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ Installs the virtual WebAuthn authenticator into the context, overriding
281281
`navigator.credentials.create()` and `navigator.credentials.get()` in all current
282282
and future pages. Call this before the page first touches `navigator.credentials`.
283283

284-
Required: until `install()` is called, no interception is in place and the page sees
284+
Required: until [`method: Credentials.install`] is called, no interception is in place and the page sees
285285
the platform's native (or absent) WebAuthn behaviour. Seeding credentials with
286-
[`method: Credentials.create`] without `install()` populates the authenticator, but the
286+
[`method: Credentials.create`] without installing populates the authenticator, but the
287287
page will never see those credentials.
288288

289289
## async method: Credentials.create
@@ -298,13 +298,12 @@ page will never see those credentials.
298298

299299
Seeds a virtual WebAuthn credential and returns it.
300300

301-
With only `rpId`, generates a fresh **ECDSA P-256** keypair, credential id and user handle. The
301+
With only [`param: Credentials.create.rpId`], generates a fresh **ECDSA P-256** keypair, credential id and user handle. The
302302
seeded credential is discoverable (resident), so the page can resolve it from both
303-
username-then-passkey and usernameless passkey flows. The returned object carries the `privateKey` and `publicKey`, so
304-
it can be persisted to disk and re-seeded in a later test.
303+
username-then-passkey and usernameless passkey flows. The returned object carries the private and public keys, so it can be persisted to disk and re-seeded in a later test.
305304

306-
To **import a known credential**, supply all four of `id`, `userHandle`, `privateKey` and
307-
`publicKey` together.
305+
To **import a known credential**, supply all four of [`option: Credentials.create.id`], [`option: Credentials.create.userHandle`], [`option: Credentials.create.privateKey`] and
306+
[`option: Credentials.create.publicKey`] together.
308307

309308
Call [`method: Credentials.install`] before navigating to a page that uses WebAuthn.
310309

@@ -361,11 +360,11 @@ Base64url-encoded credential id.
361360
- `privateKey` <[string]>
362361
- `publicKey` <[string]>
363362

364-
Returns every credential currently held by the authenticator, optionally filtered by `rpId` or
365-
`id`. This includes both credentials seeded with [`method: Credentials.create`] and credentials
363+
Returns every credential currently held by the authenticator, optionally filtered by [`option: Credentials.get.rpId`] or
364+
[`option: Credentials.get.id`]. This includes both credentials seeded with [`method: Credentials.create`] and credentials
366365
the page registered itself by calling `navigator.credentials.create()`.
367366

368-
Each returned credential includes its `privateKey` and `publicKey`, so a passkey the app just
367+
Each returned credential includes its private and public keys, so a passkey the app just
369368
registered can be saved and re-seeded into a later test with [`method: Credentials.create`] — see the second example in the class overview.
370369

371370
### option: Credentials.get.rpId

docs/src/api/class-webstorage.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ page.local_storage.clear()
3737
page.navigate("https://example.com");
3838
page.localStorage().setItem("token", "abc");
3939
String token = page.localStorage().getItem("token");
40-
List<NameValue> all = page.localStorage().items();
40+
List<WebStorageItem> all = page.localStorage().items();
4141
page.localStorage().removeItem("token");
4242
page.localStorage().clear();
4343
```
@@ -54,16 +54,17 @@ await page.LocalStorage.ClearAsync();
5454
## async method: WebStorage.items
5555
* since: v1.61
5656
- returns: <[Array]<[Object]>>
57+
* alias: WebStorageItem
5758
- `name` <[string]>
5859
- `value` <[string]>
5960

60-
Returns all items in the storage as `name`/`value` pairs.
61+
Returns all items in the storage as name/value pairs.
6162

6263
## async method: WebStorage.getItem
6364
* since: v1.61
6465
- returns: <[null]|[string]>
6566

66-
Returns the value for the given `name`, or `null` if the key is not present.
67+
Returns the value for the given [`param: WebStorage.getItem.name`] if present.
6768

6869
### param: WebStorage.getItem.name
6970
* since: v1.61
@@ -74,7 +75,7 @@ Name of the item to retrieve.
7475
## async method: WebStorage.setItem
7576
* since: v1.61
7677

77-
Sets the value for the given `name`. Overwrites any existing value for that name.
78+
Sets the value for the given [`param: WebStorage.setItem.name`]. Overwrites any existing value for that name.
7879

7980
### param: WebStorage.setItem.name
8081
* since: v1.61
@@ -91,7 +92,7 @@ New value for the item.
9192
## async method: WebStorage.removeItem
9293
* since: v1.61
9394

94-
Removes the item with the given `name`. No-op if the item is absent.
95+
Removes the item with the given [`param: WebStorage.removeItem.name`]. No-op if the item is absent.
9596

9697
### param: WebStorage.removeItem.name
9798
* since: v1.61

packages/playwright-client/types/types.d.ts

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18867,12 +18867,16 @@ export interface Credentials {
1886718867
/**
1886818868
* Seeds a virtual WebAuthn credential and returns it.
1886918869
*
18870-
* With only `rpId`, generates a fresh **ECDSA P-256** keypair, credential id and user handle. The seeded credential
18871-
* is discoverable (resident), so the page can resolve it from both username-then-passkey and usernameless passkey
18872-
* flows. The returned object carries the `privateKey` and `publicKey`, so it can be persisted to disk and re-seeded
18873-
* in a later test.
18870+
* With only [`rpId`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-rp-id), generates a
18871+
* fresh **ECDSA P-256** keypair, credential id and user handle. The seeded credential is discoverable (resident), so
18872+
* the page can resolve it from both username-then-passkey and usernameless passkey flows. The returned object carries
18873+
* the private and public keys, so it can be persisted to disk and re-seeded in a later test.
1887418874
*
18875-
* To **import a known credential**, supply all four of `id`, `userHandle`, `privateKey` and `publicKey` together.
18875+
* To **import a known credential**, supply all four of
18876+
* [`id`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-id),
18877+
* [`userHandle`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-user-handle),
18878+
* [`privateKey`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-private-key) and
18879+
* [`publicKey`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-public-key) together.
1887618880
*
1887718881
* Call [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) before
1887818882
* navigating to a page that uses WebAuthn.
@@ -18935,13 +18939,15 @@ export interface Credentials {
1893518939
delete(id: string): Promise<void>;
1893618940

1893718941
/**
18938-
* Returns every credential currently held by the authenticator, optionally filtered by `rpId` or `id`. This includes
18939-
* both credentials seeded with
18942+
* Returns every credential currently held by the authenticator, optionally filtered by
18943+
* [`rpId`](https://playwright.dev/docs/api/class-credentials#credentials-get-option-rp-id) or
18944+
* [`id`](https://playwright.dev/docs/api/class-credentials#credentials-get-option-id). This includes both credentials
18945+
* seeded with
1894018946
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) and
1894118947
* credentials the page registered itself by calling `navigator.credentials.create()`.
1894218948
*
18943-
* Each returned credential includes its `privateKey` and `publicKey`, so a passkey the app just registered can be
18944-
* saved and re-seeded into a later test with
18949+
* Each returned credential includes its private and public keys, so a passkey the app just registered can be saved
18950+
* and re-seeded into a later test with
1894518951
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) — see
1894618952
* the second example in the class overview.
1894718953
* @param options
@@ -18973,10 +18979,11 @@ export interface Credentials {
1897318979
* `navigator.credentials.get()` in all current and future pages. Call this before the page first touches
1897418980
* `navigator.credentials`.
1897518981
*
18976-
* Required: until `install()` is called, no interception is in place and the page sees the platform's native (or
18977-
* absent) WebAuthn behaviour. Seeding credentials with
18982+
* Required: until [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) is
18983+
* called, no interception is in place and the page sees the platform's native (or absent) WebAuthn behaviour. Seeding
18984+
* credentials with
1897818985
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) without
18979-
* `install()` populates the authenticator, but the page will never see those credentials.
18986+
* installing populates the authenticator, but the page will never see those credentials.
1898018987
*/
1898118988
install(): Promise<void>;
1898218989
}
@@ -21677,13 +21684,14 @@ export interface WebStorage {
2167721684
clear(): Promise<void>;
2167821685

2167921686
/**
21680-
* Returns the value for the given `name`, or `null` if the key is not present.
21687+
* Returns the value for the given
21688+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-get-item-option-name) if present.
2168121689
* @param name Name of the item to retrieve.
2168221690
*/
2168321691
getItem(name: string): Promise<null|string>;
2168421692

2168521693
/**
21686-
* Returns all items in the storage as `name`/`value` pairs.
21694+
* Returns all items in the storage as name/value pairs.
2168721695
*/
2168821696
items(): Promise<Array<{
2168921697
name: string;
@@ -21692,13 +21700,17 @@ export interface WebStorage {
2169221700
}>>;
2169321701

2169421702
/**
21695-
* Removes the item with the given `name`. No-op if the item is absent.
21703+
* Removes the item with the given
21704+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-remove-item-option-name). No-op if the item
21705+
* is absent.
2169621706
* @param name Name of the item to remove.
2169721707
*/
2169821708
removeItem(name: string): Promise<void>;
2169921709

2170021710
/**
21701-
* Sets the value for the given `name`. Overwrites any existing value for that name.
21711+
* Sets the value for the given
21712+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-set-item-option-name). Overwrites any
21713+
* existing value for that name.
2170221714
* @param name Name of the item to set.
2170321715
* @param value New value for the item.
2170421716
*/

packages/playwright-core/src/server/trace/recorder/snapshotter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class Snapshotter {
6969

7070
async reset() {
7171
if (this._started)
72-
await this._context.safeNonStallingEvaluateInAllFrames(`window["${this._snapshotStreamer}"].reset()`, 'main');
72+
await this._context.safeNonStallingEvaluateInAllFrames(`window["${this._snapshotStreamer}"].resetHistory()`, 'main');
7373
}
7474

7575
stop() {

packages/playwright-core/types/types.d.ts

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18867,12 +18867,16 @@ export interface Credentials {
1886718867
/**
1886818868
* Seeds a virtual WebAuthn credential and returns it.
1886918869
*
18870-
* With only `rpId`, generates a fresh **ECDSA P-256** keypair, credential id and user handle. The seeded credential
18871-
* is discoverable (resident), so the page can resolve it from both username-then-passkey and usernameless passkey
18872-
* flows. The returned object carries the `privateKey` and `publicKey`, so it can be persisted to disk and re-seeded
18873-
* in a later test.
18870+
* With only [`rpId`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-rp-id), generates a
18871+
* fresh **ECDSA P-256** keypair, credential id and user handle. The seeded credential is discoverable (resident), so
18872+
* the page can resolve it from both username-then-passkey and usernameless passkey flows. The returned object carries
18873+
* the private and public keys, so it can be persisted to disk and re-seeded in a later test.
1887418874
*
18875-
* To **import a known credential**, supply all four of `id`, `userHandle`, `privateKey` and `publicKey` together.
18875+
* To **import a known credential**, supply all four of
18876+
* [`id`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-id),
18877+
* [`userHandle`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-user-handle),
18878+
* [`privateKey`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-private-key) and
18879+
* [`publicKey`](https://playwright.dev/docs/api/class-credentials#credentials-create-option-public-key) together.
1887618880
*
1887718881
* Call [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) before
1887818882
* navigating to a page that uses WebAuthn.
@@ -18935,13 +18939,15 @@ export interface Credentials {
1893518939
delete(id: string): Promise<void>;
1893618940

1893718941
/**
18938-
* Returns every credential currently held by the authenticator, optionally filtered by `rpId` or `id`. This includes
18939-
* both credentials seeded with
18942+
* Returns every credential currently held by the authenticator, optionally filtered by
18943+
* [`rpId`](https://playwright.dev/docs/api/class-credentials#credentials-get-option-rp-id) or
18944+
* [`id`](https://playwright.dev/docs/api/class-credentials#credentials-get-option-id). This includes both credentials
18945+
* seeded with
1894018946
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) and
1894118947
* credentials the page registered itself by calling `navigator.credentials.create()`.
1894218948
*
18943-
* Each returned credential includes its `privateKey` and `publicKey`, so a passkey the app just registered can be
18944-
* saved and re-seeded into a later test with
18949+
* Each returned credential includes its private and public keys, so a passkey the app just registered can be saved
18950+
* and re-seeded into a later test with
1894518951
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) — see
1894618952
* the second example in the class overview.
1894718953
* @param options
@@ -18973,10 +18979,11 @@ export interface Credentials {
1897318979
* `navigator.credentials.get()` in all current and future pages. Call this before the page first touches
1897418980
* `navigator.credentials`.
1897518981
*
18976-
* Required: until `install()` is called, no interception is in place and the page sees the platform's native (or
18977-
* absent) WebAuthn behaviour. Seeding credentials with
18982+
* Required: until [credentials.install()](https://playwright.dev/docs/api/class-credentials#credentials-install) is
18983+
* called, no interception is in place and the page sees the platform's native (or absent) WebAuthn behaviour. Seeding
18984+
* credentials with
1897818985
* [credentials.create(rpId[, options])](https://playwright.dev/docs/api/class-credentials#credentials-create) without
18979-
* `install()` populates the authenticator, but the page will never see those credentials.
18986+
* installing populates the authenticator, but the page will never see those credentials.
1898018987
*/
1898118988
install(): Promise<void>;
1898218989
}
@@ -21677,13 +21684,14 @@ export interface WebStorage {
2167721684
clear(): Promise<void>;
2167821685

2167921686
/**
21680-
* Returns the value for the given `name`, or `null` if the key is not present.
21687+
* Returns the value for the given
21688+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-get-item-option-name) if present.
2168121689
* @param name Name of the item to retrieve.
2168221690
*/
2168321691
getItem(name: string): Promise<null|string>;
2168421692

2168521693
/**
21686-
* Returns all items in the storage as `name`/`value` pairs.
21694+
* Returns all items in the storage as name/value pairs.
2168721695
*/
2168821696
items(): Promise<Array<{
2168921697
name: string;
@@ -21692,13 +21700,17 @@ export interface WebStorage {
2169221700
}>>;
2169321701

2169421702
/**
21695-
* Removes the item with the given `name`. No-op if the item is absent.
21703+
* Removes the item with the given
21704+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-remove-item-option-name). No-op if the item
21705+
* is absent.
2169621706
* @param name Name of the item to remove.
2169721707
*/
2169821708
removeItem(name: string): Promise<void>;
2169921709

2170021710
/**
21701-
* Sets the value for the given `name`. Overwrites any existing value for that name.
21711+
* Sets the value for the given
21712+
* [`name`](https://playwright.dev/docs/api/class-webstorage#web-storage-set-item-option-name). Overwrites any
21713+
* existing value for that name.
2170221714
* @param name Name of the item to set.
2170321715
* @param value New value for the item.
2170421716
*/

packages/protocol/spec/electron.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ Electron:
9090
ElectronApplication:
9191
type: interface
9292

93-
extends: EventTarget
94-
9593
initializer:
9694
context: BrowserContext
9795

packages/protocol/src/channels.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2237,7 +2237,7 @@ export interface ElectronApplicationEventTarget {
22372237
on(event: 'close', callback: (params: ElectronApplicationCloseEvent) => void): this;
22382238
on(event: 'console', callback: (params: ElectronApplicationConsoleEvent) => void): this;
22392239
}
2240-
export interface ElectronApplicationChannel extends ElectronApplicationEventTarget, EventTargetChannel {
2240+
export interface ElectronApplicationChannel extends ElectronApplicationEventTarget, Channel {
22412241
_type_ElectronApplication: boolean;
22422242
browserWindow(params: ElectronApplicationBrowserWindowParams, progress?: Progress): Promise<ElectronApplicationBrowserWindowResult>;
22432243
evaluateExpression(params: ElectronApplicationEvaluateExpressionParams, progress?: Progress): Promise<ElectronApplicationEvaluateExpressionResult>;

tests/library/trace-viewer.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,26 @@ test('should capture iframe with srcdoc', async ({ page, server, runAndTrace })
25072507
await expect(frame.frameLocator('iframe').getByRole('button')).toHaveText('Hello iframe');
25082508
});
25092509

2510+
test('should render snapshots from the second chunk', async ({ context, page, server, showTraceViewer }, testInfo) => {
2511+
await context.tracing.start({ screenshots: true, snapshots: true });
2512+
await page.goto(server.EMPTY_PAGE);
2513+
await page.setContent('<button>Click</button>');
2514+
2515+
await context.tracing.startChunk();
2516+
await page.click('"Click"');
2517+
await context.tracing.stopChunk({ path: testInfo.outputPath('trace1.zip') });
2518+
2519+
await context.tracing.startChunk();
2520+
await page.hover('"Click"');
2521+
await context.tracing.stopChunk({ path: testInfo.outputPath('trace2.zip') });
2522+
2523+
// Snapshots in the second chunk must be self-contained and not reference
2524+
// snapshot state from the first chunk.
2525+
const traceViewer = await showTraceViewer(testInfo.outputPath('trace2.zip'));
2526+
const frame = await traceViewer.snapshotFrame('Hover');
2527+
await expect(frame.locator('button')).toHaveText('Click');
2528+
});
2529+
25102530
test('take trace paths via stdin', async ({ showTraceViewer }) => {
25112531
const traceViewer = await showTraceViewer(undefined, { stdin: true });
25122532
await expect(traceViewer.page).toHaveTitle('Playwright Trace Viewer');

0 commit comments

Comments
 (0)