Commit 822b030d authored by Pascal Hartig's avatar Pascal Hartig

Browser tests: Flatten loop

parent a1e91120
......@@ -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 () {
......
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