mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #8362 from spalger/implement/functional-tests/helpers
Implement functional test helpers
This commit is contained in:
commit
e20afd9b46
1 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
|
||||
import bluebird, {
|
||||
promisify
|
||||
promisify,
|
||||
filter as filterAsync
|
||||
} from 'bluebird';
|
||||
import fs from 'fs';
|
||||
import _ from 'lodash';
|
||||
|
@ -254,6 +255,10 @@ export default class Common {
|
|||
return Try.try(block);
|
||||
}
|
||||
|
||||
tryMethod(object, method, ...args) {
|
||||
return this.try(() => object[method](...args));
|
||||
}
|
||||
|
||||
log(...args) {
|
||||
Log.log(...args);
|
||||
}
|
||||
|
@ -305,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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue