Skip to content

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

feat(webkit): intercepted response body (#7229)

Yury Semikhatsky02ff213d4d5f
diff --git a/src/server/webkit/wkInterceptableRequest.ts b/src/server/webkit/wkInterceptableRequest.ts
index f3ad7ae2f3..5d7d4ce644 100644
--- a/src/server/webkit/wkInterceptableRequest.ts
+++ b/src/server/webkit/wkInterceptableRequest.ts
@@ -72,8 +72,8 @@ export class WKInterceptableRequest implements network.RouteDelegate {
// Empty buffer will result in the response being used.
if (forFulfill)
return Buffer.from('');
- const response = await this._session.send('Network.getResponseBody', { requestId: this._requestId });
- return Buffer.from(response.body, response.base64Encoded ? 'base64' : 'utf8');
+ const response = await this._session.send('Network.getInterceptedResponseBody', { requestId: this._requestId });
+ return Buffer.from(response.body, 'base64');
}
async abort(errorCode: string) {
diff --git a/tests/page/page-request-intercept.spec.ts b/tests/page/page-request-intercept.spec.ts
index da2178f716..b6dc17163d 100644
--- a/tests/page/page-request-intercept.spec.ts
+++ b/tests/page/page-request-intercept.spec.ts
@@ -122,7 +122,6 @@ it('should give access to the intercepted response', async ({page, server, brows
it('should give access to the intercepted response body', async ({page, server, browserName}) => {
it.fixme(browserName === 'firefox');
- it.fixme(browserName === 'webkit');
await page.goto(server.EMPTY_PAGE);