Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
feat(screencast): autoscale to fit requested size (#3730)
Yury Semikhatsky1e64efcad1e4
diff --git a/browsers.json b/browsers.jsonindex 05e314c3e5..ded1c1245c 100644--- a/browsers.json+++ b/browsers.json@@ -8,12 +8,12 @@},{"name": "firefox",- "revision": "1167",+ "revision": "1169","download": true},{"name": "webkit",- "revision": "1334",+ "revision": "1337","download": true}]diff --git a/src/server/firefox/ffPage.ts b/src/server/firefox/ffPage.tsindex bff14546b2..2f3bf24998 100644--- a/src/server/firefox/ffPage.ts+++ b/src/server/firefox/ffPage.ts@@ -358,7 +358,6 @@ export class FFPage implements PageDelegate {file: options.outputFile,width: options.width,height: options.height,- scale: options.scale,});}diff --git a/src/server/types.ts b/src/server/types.tsindex 9e0ade0638..2ed0797217 100644--- a/src/server/types.ts+++ b/src/server/types.ts@@ -55,7 +55,6 @@ export type ScreenshotOptions = ElementScreenshotOptions & {export type ScreencastOptions = {width: number,height: number,- scale?: number,};export type PageScreencastOptions = ScreencastOptions & {diff --git a/src/server/webkit/wkPage.ts b/src/server/webkit/wkPage.tsindex 916578ad3d..37a3a7d0f7 100644--- a/src/server/webkit/wkPage.ts+++ b/src/server/webkit/wkPage.ts@@ -721,7 +721,6 @@ export class WKPage implements PageDelegate {file: options.outputFile,width: options.width,height: options.height,- scale: options.scale,}) as any;this._browserContext._browser._screencastStarted(screencastId, options.outputFile, this._page);} catch (e) {diff --git a/test/screencast.spec.ts b/test/screencast.spec.tsindex dfe4da5501..196658bb7c 100644--- a/test/screencast.spec.ts+++ b/test/screencast.spec.ts@@ -231,18 +231,10 @@ describe('screencast', suite => {test.flaky(options.WEBKIT && LINUX);}, async ({page, tmpDir, server, videoPlayer, toImpl}) => {const videoFile = path.join(tmpDir, 'v.webm');- // Chromium automatically fits all frames to fit specified size. To avoid- // unwanted transformations we set view port size equal to the screencast- // size.- // TODO: support explicit 'scale' parameter in CDP.- if (options.CHROMIUM)- await page.setViewportSize({width: 640, height: 480});+ // Set viewport equal to screencast frame size to avoid scaling.+ await page.setViewportSize({width: 640, height: 480});await page.goto(server.PREFIX + '/rotate-z.html');await toImpl(page)._delegate.startScreencast({outputFile: videoFile, width: 640, height: 480});- // TODO: in WebKit figure out why video size is not reported correctly for- // static pictures.- if (options.HEADLESS && options.WEBKIT)- await page.setViewportSize({width: 1270, height: 950});// 300 is not enough for Chromium headful.await new Promise(r => setTimeout(r, 500));await toImpl(page)._delegate.stopScreencast();