选择量角器js后意外警报打开

时间:2014-08-11 14:07:35

标签: angularjs testing protractor

当我尝试使用How to handle the "unexpected alert open"?处理警报时,它无效。实际上它在其他地方工作,但在选择删除选项

后它无法正常工作

测试用例:

  dropdown_helper = require('./select_dropdown.js'); 
  var delete_status = element(by.model('courses.single.status'));
  delete_status.sendKeys(dropdown_helper.selectDropdownByNumber('3'));
  ptor.sleep(1000);

  // <- clicking yes to delete
  ptor.driver.switchTo().alert().accept();

select_dropdown.js

exports.selectDropdownByNumber = function (index) {
 element.all(by.css('select option'))
  .then(function (options) {
      options[index].click();
  });
};

任何人都可以帮助我吗?

0 个答案:

没有答案