0

我们正在使用量角器进行 angularjs 应用程序 e2e 测试。我们有一个功能可以检查devicePixelRatiowindow然后生成不同的图像 url 以便为视网膜屏幕提供高质量的图像。

但是如何用量角器测试呢?我找不到任何选项可以使用量角器 API 指定它。

4

1 回答 1

2

尝试通过设置window.devicePixelRatiousing executeScriptor的值来伪造它executeAsyncScript

https://github.com/angular/protractor/blob/master/docs/api.md#api-webdriver-webdriver-prototype-executescript

browser.executeScript('window.devicePixelRatio = 2');
于 2014-08-16T17:03:51.057 回答