add check for selected time field option

This commit is contained in:
Joe Fleming 2015-11-24 14:32:24 -07:00
parent 43a5e2b838
commit b3f2d5bfed

View file

@ -47,12 +47,22 @@ define(function (require) {
selectTimeFieldOption: function (selection) {
var self = this;
// open dropdown
return self.getTimeFieldNameField().click()
.then(function () {
// close dropdown, keep focus
return self.getTimeFieldNameField().click();
})
.then(function () {
return self.getTimeFieldOption(selection);
return common.tryForTime(defaultTimeout, function () {
return self.getTimeFieldOption(selection).click()
.then(function () {
return self.getTimeFieldOption(selection).isSelected();
})
.then(function (selected) {
if (!selected) throw new Error('option not selected: ' + selected);
});
});
});
},