当我尝试使用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();
});
};
任何人都可以帮助我吗?