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
test: newContext works when both screen and viewport specified (#9520)
Yury Semikhatsky3d14c1ff51a2
diff --git a/tests/browsercontext-viewport.spec.ts b/tests/browsercontext-viewport.spec.tsindex 2b430dca89..620bb6b110 100644--- a/tests/browsercontext-viewport.spec.ts+++ b/tests/browsercontext-viewport.spec.ts@@ -105,6 +105,19 @@ browserTest('should support touch with null viewport', async ({ browser, serverawait context.close();});+it('should set both screen and viewport options', async ({ contextFactory, browserName }) => {+ it.fail(browserName === 'firefox', 'Screen size is reset to viewport');+ const context = await contextFactory({+ screen: { 'width': 1280, 'height': 720 },+ viewport: { 'width': 1000, 'height': 600 },+ });+ const page = await context.newPage();+ const screen = await page.evaluate(() => ({ w: screen.width, h: screen.height }));+ expect(screen).toEqual({ w: 1280, h: 720 });+ const inner = await page.evaluate(() => ({ w: window.innerWidth, h: window.innerHeight }));+ expect(inner).toEqual({ w: 1000, h: 600 });+});+browserTest('should report null viewportSize when given null viewport', async ({ browser, server }) => {const context = await browser.newContext({ viewport: null });const page = await context.newPage();