fix: Reverse Lumia 550 and Lumia 550 Landscape viewports (#34548)
This commit is contained in:
parent
1936cfa6c3
commit
4fa1d39c80
|
@ -1122,8 +1122,8 @@
|
||||||
"Microsoft Lumia 550": {
|
"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",
|
"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": {
|
"viewport": {
|
||||||
"width": 640,
|
"width": 360,
|
||||||
"height": 360
|
"height": 640
|
||||||
},
|
},
|
||||||
"deviceScaleFactor": 2,
|
"deviceScaleFactor": 2,
|
||||||
"isMobile": true,
|
"isMobile": true,
|
||||||
|
@ -1133,8 +1133,8 @@
|
||||||
"Microsoft Lumia 550 landscape": {
|
"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",
|
"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": {
|
"viewport": {
|
||||||
"width": 360,
|
"width": 640,
|
||||||
"height": 640
|
"height": 360
|
||||||
},
|
},
|
||||||
"deviceScaleFactor": 2,
|
"deviceScaleFactor": 2,
|
||||||
"isMobile": true,
|
"isMobile": true,
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { devices } from '@playwright/test';
|
||||||
import { contextTest as it, expect } from '../config/browserTest';
|
import { contextTest as it, expect } from '../config/browserTest';
|
||||||
import { browserTest } from '../config/browserTest';
|
import { browserTest } from '../config/browserTest';
|
||||||
import { verifyViewport } from '../config/utils';
|
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 }) => {
|
it('should get the proper default viewport size', async ({ page, server }) => {
|
||||||
await verifyViewport(page, 1280, 720);
|
await verifyViewport(page, 1280, 720);
|
||||||
|
@ -46,6 +47,14 @@ it('should return correct outerWidth and outerHeight', async ({ page }) => {
|
||||||
expect(size.outerHeight >= size.innerHeight).toBeTruthy();
|
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 }) => {
|
it('should emulate device width', async ({ page, server }) => {
|
||||||
expect(page.viewportSize()).toEqual({ width: 1280, height: 720 });
|
expect(page.viewportSize()).toEqual({ width: 1280, height: 720 });
|
||||||
await page.setViewportSize({ width: 300, height: 300 });
|
await page.setViewportSize({ width: 300, height: 300 });
|
||||||
|
|
Loading…
Reference in New Issue