Commit 07353bcd authored by Sam Saccone's avatar Sam Saccone

🐐 Reduce clear complete flake

parent 87d177de
...@@ -94,7 +94,7 @@ module.exports = function Page(browser) { ...@@ -94,7 +94,7 @@ module.exports = function Page(browser) {
}; };
this.tryGetClearCompleteButton = function () { this.tryGetClearCompleteButton = function () {
return this.tryFindByXpath(this.getCompletedButtonXpath()); return this.findByXpath(this.getCompletedButtonXpath());
}; };
this.tryGetToggleForItemAtIndex = function (index) { this.tryGetToggleForItemAtIndex = function (index) {
...@@ -226,10 +226,7 @@ module.exports = function Page(browser) { ...@@ -226,10 +226,7 @@ module.exports = function Page(browser) {
}; };
this.clickClearCompleteButton = function () { this.clickClearCompleteButton = function () {
return this.tryGetClearCompleteButton().then(function (elements) { return this.tryGetClearCompleteButton().click();
var button = elements[0];
button.click();
});
}; };
this.enterItem = function (itemText) { this.enterItem = function (itemText) {
......
...@@ -35,7 +35,7 @@ function TestOperations(page) { ...@@ -35,7 +35,7 @@ function TestOperations(page) {
this.assertClearCompleteButtonIsVisible = function () { this.assertClearCompleteButtonIsVisible = function () {
page.tryGetClearCompleteButton().then(function (element) { page.tryGetClearCompleteButton().then(function (element) {
testIsVisible(element, 'clear completed items button'); testIsVisible([element], 'clear completed items button');
}); });
}; };
...@@ -47,12 +47,10 @@ function TestOperations(page) { ...@@ -47,12 +47,10 @@ function TestOperations(page) {
}; };
this.assertClearCompleteButtonText = function (buttonText) { this.assertClearCompleteButtonText = function (buttonText) {
page.tryGetClearCompleteButton().then(function (elements) { return page.tryGetClearCompleteButton()
var button = elements[0]; .getText().then(function (text) {
button.getText().then(function (text) {
assert.equal(buttonText, text); assert.equal(buttonText, text);
}); });
});
}; };
this.assertMainSectionIsHidden = function () { this.assertMainSectionIsHidden = function () {
......
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