【发布时间】:2014-07-11 22:00:23
【问题描述】:
我正在使用量角器编写功能测试,并尝试在桌面上使用 chrome 模拟移动设备。我已成功设置用户代理:
config.capabilities = {
browserName: 'chrome',
chromeOptions: {
args: ['--user-agent="Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53"']
}
};
现在,我想更改 DPI 以反映移动设备(通常 DPI 为 2)。我探索了其他 args 并遇到了 --ash-host-window-bounds (http://peter.sh/experiments/chromium-command-line-switches/#ash-host-window-bounds)。我试过了:
chromeOptions: { args: ['--ash-host-window-bounds="1024x768*2"'] }
该参数似乎不适用于量角器,因为在删除 DPI 参数时它不会影响窗口尺寸。
如何设置 DPI?或者,如何通过 chromeOptions 启用 Chrome 移动仿真?
【问题讨论】:
标签: angularjs functional-testing protractor