Commit 2e4d3795 authored by Sam Saccone's avatar Sam Saccone

tests: Clear input before retry

parent 80725cb7
...@@ -148,7 +148,7 @@ module.exports = function Page(browser) { ...@@ -148,7 +148,7 @@ module.exports = function Page(browser) {
this.getVisibleLabelText = function () { this.getVisibleLabelText = function () {
var self = this; var self = this;
return this.getVisibileLabelIndicies () return this.getVisibileLabelIndicies()
.then(function (indicies) { .then(function (indicies) {
return webdriver.promise.map(indicies, function (elmIndex) { return webdriver.promise.map(indicies, function (elmIndex) {
var ret; var ret;
...@@ -234,11 +234,20 @@ module.exports = function Page(browser) { ...@@ -234,11 +234,20 @@ module.exports = function Page(browser) {
browser.wait(function () { browser.wait(function () {
return self.getItemInputField().then(function (textField) { return self.getItemInputField().then(function (textField) {
return textField.sendKeys(itemText, webdriver.Key.ENTER); return textField.sendKeys(itemText, webdriver.Key.ENTER)
}).then(function () { .then(function () {
return textField;
});
}).then(function (textField) {
return self.getVisibleLabelText() return self.getVisibleLabelText()
.then(function (labels) { .then(function (labels) {
return labels.indexOf(itemText.trim()) !== -1; if (labels.indexOf(itemText.trim()) !== -1) {
return true;
}
return textField.clear().then(function () {
return false;
});
}); });
}); });
}, 5000); }, 5000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment