diff --git a/browser-tests/testOperations.js b/browser-tests/testOperations.js index 0a48f730b3eb63ffa3b108be62cb94da4bed0be6..0d8d35d93c07c0f923846b06103070de4fd19ae1 100644 --- a/browser-tests/testOperations.js +++ b/browser-tests/testOperations.js @@ -113,18 +113,13 @@ function TestOperations(page) { // obtain all the visible items var visibleLabels = []; - var tests = []; - for (var i = 0; i < labels.length; i++) { - (function (index) { - // suppressing JSHint - the loop variable is not being used in the function. - /* jshint -W083 */ - tests.push(labels[index].isDisplayed().then(function (isDisplayed) { + var tests = labels.map(function (label) { + return label.isDisplayed().then(function (isDisplayed) { if (isDisplayed) { - visibleLabels.push(labels[index]); + visibleLabels.push(label); } - })); - })(i); - } + }); + }); // check that they match the supplied text return Q.all(tests).then(function () {