Skip to content

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

fix(protocol): annotate file buffer as binary (#4272)

Pavel Feldmanece84eccd795
diff --git a/src/protocol/channels.ts b/src/protocol/channels.ts
index e40c252b33..215e9952e1 100644
--- a/src/protocol/channels.ts
+++ b/src/protocol/channels.ts
@@ -1490,7 +1490,7 @@ export type FrameSetInputFilesParams = {
files: {
name: string,
mimeType: string,
- buffer: string,
+ buffer: Binary,
}[],
timeout?: number,
noWaitAfter?: boolean,
@@ -1982,7 +1982,7 @@ export type ElementHandleSetInputFilesParams = {
files: {
name: string,
mimeType: string,
- buffer: string,
+ buffer: Binary,
}[],
timeout?: number,
noWaitAfter?: boolean,
diff --git a/src/protocol/protocol.yml b/src/protocol/protocol.yml
index eb344adb15..3c03397add 100644
--- a/src/protocol/protocol.yml
+++ b/src/protocol/protocol.yml
@@ -1243,7 +1243,7 @@ Frame:
properties:
name: string
mimeType: string
- buffer: string
+ buffer: binary
timeout: number?
noWaitAfter: boolean?
@@ -1660,7 +1660,7 @@ ElementHandle:
properties:
name: string
mimeType: string
- buffer: string
+ buffer: binary
timeout: number?
noWaitAfter: boolean?
diff --git a/src/protocol/validator.ts b/src/protocol/validator.ts
index f07d9d45fa..8f07d900ea 100644
--- a/src/protocol/validator.ts
+++ b/src/protocol/validator.ts
@@ -592,7 +592,7 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
files: tArray(tObject({
name: tString,
mimeType: tString,
- buffer: tString,
+ buffer: tBinary,
})),
timeout: tOptional(tNumber),
noWaitAfter: tOptional(tBoolean),
@@ -781,7 +781,7 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
files: tArray(tObject({
name: tString,
mimeType: tString,
- buffer: tString,
+ buffer: tBinary,
})),
timeout: tOptional(tNumber),
noWaitAfter: tOptional(tBoolean),