Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: add snapshots for page and elementHandle screenshots (#12411)

Andrey Lushnikov8d94ed134c0b
diff --git a/packages/playwright-core/src/protocol/channels.ts b/packages/playwright-core/src/protocol/channels.ts
index 6600c015b1..996f25857c 100644
--- a/packages/playwright-core/src/protocol/channels.ts
+++ b/packages/playwright-core/src/protocol/channels.ts
@@ -4034,6 +4034,7 @@ export const commandsWithTracingSnapshots = new Set([
'Page.goBack',
'Page.goForward',
'Page.reload',
+ 'Page.screenshot',
'Page.setViewportSize',
'Page.keyboardDown',
'Page.keyboardUp',
@@ -4105,6 +4106,7 @@ export const commandsWithTracingSnapshots = new Set([
'ElementHandle.isHidden',
'ElementHandle.isVisible',
'ElementHandle.press',
+ 'ElementHandle.screenshot',
'ElementHandle.scrollIntoViewIfNeeded',
'ElementHandle.selectOption',
'ElementHandle.selectText',
diff --git a/packages/playwright-core/src/protocol/protocol.yml b/packages/playwright-core/src/protocol/protocol.yml
index c1f162ce1b..910538a208 100644
--- a/packages/playwright-core/src/protocol/protocol.yml
+++ b/packages/playwright-core/src/protocol/protocol.yml
@@ -1012,6 +1012,8 @@ Page:
selector: string
returns:
binary: binary
+ tracing:
+ snapshot: true
setExtraHTTPHeaders:
parameters:
@@ -2171,6 +2173,8 @@ ElementHandle:
selector: string
returns:
binary: binary
+ tracing:
+ snapshot: true
scrollIntoViewIfNeeded:
parameters: