You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Randomly noticed that a few items didn't specify a "landscape" device:
Missing device for "iPhone 11 landscape"
Missing device for "iPhone 11 Pro landscape"
Missing device for "iPhone 11 Pro Max landscape"
Missing device for "Microsoft Lumia 550 landscape"
... So I hacked a quick linter to verify:
constdevices=require("playwright").devices;constdeviceMap=newMap();for(constdeviceofdevices){deviceMap.set(device.name,device);}for(constnameofdeviceMap.keys()){if(name.endsWith(" landscape"))continue;constlandscapeName=`${name} landscape`;if(!deviceMap.has(landscapeName)){constlandscapeDevice=deviceMap.get(name);const{width, height}=landscapeDevice.viewport;landscapeDevice.name=landscapeName;landscapeDevice.viewport.width=height;landscapeDevice.viewport.height=width;console.log(`Missing device for "${landscapeName}", expected: ${JSON.stringify(landscapeDevice,null,2)}`);}else{constportrait=deviceMap.get(name);constlandscape=deviceMap.get(landscapeName);if(!(portrait.width===landscape.height&&portrait.height===landscape.width)){console.log(`${name} viewport ({width:${portrait.viewport.width},height:${portrait.viewport.height}}) does not match ${landscapeName} viewport ({width:${landscape.viewport.width},height=${landscape.viewport.height}})`);}}}
OUTPUT
Missing device for "iPhone 11 landscape", expected:
{
"name": "iPhone 11 landscape",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1",
"viewport": {
"width": 896,
"height": 414,
"deviceScaleFactor": 2,
"isMobile": true
}
}
Missing device for "iPhone 11 Pro landscape", expected:
{
"name": "iPhone 11 Pro landscape",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1",
"viewport": {
"width": 812,
"height": 375,
"deviceScaleFactor": 3,
"isMobile": true
}
}
Missing device for "iPhone 11 Pro Max landscape", expected:
{
"name": "iPhone 11 Pro Max landscape",
"userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1",
"viewport": {
"width": 896,
"height": 414,
"deviceScaleFactor": 3,
"isMobile": true
}
}
Missing device for "Microsoft Lumia 550 landscape", expected:
{
"name": "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/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",
"viewport": {
"width": 360,
"height": 640,
"deviceScaleFactor": 2,
"isMobile": true
}
}
Although, that "Lumia 550" definition looks possibly suspicious.
'userAgent': 'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263',
'viewport': {
'width': 640,
'height': 360,
'deviceScaleFactor': 2,
'isMobile': true
}
},
It looks like the width > height, so it's possibly already the landscape definition, but incorrectly labeled (and we're missing the portrait definition).
The text was updated successfully, but these errors were encountered:
Randomly noticed that a few items didn't specify a "landscape" device:
Missing device for "iPhone 11 landscape"
Missing device for "iPhone 11 Pro landscape"
Missing device for "iPhone 11 Pro Max landscape"
Missing device for "Microsoft Lumia 550 landscape"
... So I hacked a quick linter to verify:
OUTPUT
Although, that "Lumia 550" definition looks possibly suspicious.
playwright/src/deviceDescriptors.ts
Lines 491 to 500 in b4209e9
It looks like the width > height, so it's possibly already the landscape definition, but incorrectly labeled (and we're missing the portrait definition).
The text was updated successfully, but these errors were encountered: