如何在移动模式切换的情况下在chrome中开始测试?我的意思不是这个设置:
chromeOptions: {
// args: ['headless', 'no-sandbox', 'disable-gpu', 'touch-events'],
mobileEmulation: {
deviceMetrics: { width: 360, height: 640, pixelRatio: 3 },
userAgent:
'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Mobile Safari/537.36 profi-autotest',
},
},
因为上述设置仅将视口调整为移动设备的大小,但不会在chrome开发工具中的设备工具栏中切换实际的“移动模式”
发现这对遇到相同问题的任何人(浏览器堆栈,现在都可以尝试一下。