【发布时间】:2014-09-03 01:41:04
【问题描述】:
我在量角器测试中有一个鼠标/键序列,该序列因操作系统而异(Mac 与其他一切)。我想根据操作系统或用户代理更改鼠标单击时按住哪个键。
根据我测试的位置(本地 Mac OSx + Chrome 或 Linux 上的无头 PhantomJS),需要 Command 键或 Ctrl 键。
当前测试如下:
describe('my test', function() {
//get elements with code not shown
ptor.actions()
.sendKeys(protractor.Key.CONTROL) //mac protrator.Key.COMMAND non mac protractor.Key.CONTROL
.mouseDown(trs[0])
.mouseUp(trs[0])
.sendKeys(protractor.Key.NULL)
.perform();
trs[0].evaluate('selectedItems.length')
.then(function(count) {
expect(count).toBe(0);
})
});
【问题讨论】:
标签: angularjs jasmine protractor karma-jasmine