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
fix: Reverse Lumia 550 and Lumia 550 Landscape viewports (#34548)
GeneratorX164fa1d39c80f8
diff --git a/packages/playwright-core/src/server/deviceDescriptorsSource.json b/packages/playwright-core/src/server/deviceDescriptorsSource.jsonindex 055d3c5944..7ebb050ebf 100644--- a/packages/playwright-core/src/server/deviceDescriptorsSource.json+++ b/packages/playwright-core/src/server/deviceDescriptorsSource.json@@ -1122,8 +1122,8 @@"Microsoft Lumia 550": {"userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.6943.27 Mobile Safari/537.36 Edge/14.14263","viewport": {- "width": 640,- "height": 360+ "width": 360,+ "height": 640},"deviceScaleFactor": 2,"isMobile": true,@@ -1133,8 +1133,8 @@"Microsoft Lumia 550 landscape": {"userAgent": "Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.6943.27 Mobile Safari/537.36 Edge/14.14263","viewport": {- "width": 360,- "height": 640+ "width": 640,+ "height": 360},"deviceScaleFactor": 2,"isMobile": true,diff --git a/tests/library/browsercontext-viewport.spec.ts b/tests/library/browsercontext-viewport.spec.tsindex 09fade8d91..1a9a1a27ba 100644--- a/tests/library/browsercontext-viewport.spec.ts+++ b/tests/library/browsercontext-viewport.spec.ts@@ -19,6 +19,7 @@ import { devices } from '@playwright/test';import { contextTest as it, expect } from '../config/browserTest';import { browserTest } from '../config/browserTest';import { verifyViewport } from '../config/utils';+import { deviceDescriptors } from 'packages/playwright-core/lib/server/deviceDescriptors';it('should get the proper default viewport size', async ({ page, server }) => {await verifyViewport(page, 1280, 720);@@ -46,6 +47,14 @@ it('should return correct outerWidth and outerHeight', async ({ page }) => {expect(size.outerHeight >= size.innerHeight).toBeTruthy();});+it('landscape viewport should have width larger than height', async () => {+ for (const device in deviceDescriptors) {+ const configuration = deviceDescriptors[device];+ if (device.includes('landscape') || device.includes('Landscape'))+ expect(configuration.viewport.width).toBeGreaterThan(configuration.viewport.height);+ }+});+it('should emulate device width', async ({ page, server }) => {expect(page.viewportSize()).toEqual({ width: 1280, height: 720 });await page.setViewportSize({ width: 300, height: 300 });