[functionalTests] implement common.findAllTestSubjects() helper

This commit is contained in:
spalger 2016-09-19 18:44:48 -07:00
parent 69fb068d55
commit 6b220cfc2b

View file

@ -1,6 +1,7 @@
import bluebird, {
promisify
promisify,
filter as filterAsync
} from 'bluebird';
import fs from 'fs';
import _ from 'lodash';
@ -309,4 +310,11 @@ export default class Common {
.findDisplayedByCssSelector(testSubjSelector(selector));
}
async findAllTestSubjects(selector) {
this.debug('in findAllTestSubjects: ' + testSubjSelector(selector));
const remote = this.remote.setFindTimeout(defaultFindTimeout);
const all = await remote.findAllByCssSelector(testSubjSelector(selector));
return await filterAsync(all, el => el.isDisplayed());
}
}