1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-11 20:22:36 +03:00

no need to double select here, might speed things up slightly

This commit is contained in:
Bruno Windels
2018-08-07 18:23:02 +02:00
parent aaa5ee1a25
commit 2a7438e9fb

View File

@@ -133,9 +133,8 @@ module.exports = class RiotSession {
return this.page.$(selector); return this.page.$(selector);
} }
async waitAndQuery(selector, timeout = 500) { waitAndQuery(selector, timeout = 500) {
await this.page.waitForSelector(selector, {visible: true, timeout}); return this.page.waitForSelector(selector, {visible: true, timeout});
return await this.query(selector);
} }
queryAll(selector) { queryAll(selector) {
@@ -143,7 +142,7 @@ module.exports = class RiotSession {
} }
async waitAndQueryAll(selector, timeout = 500) { async waitAndQueryAll(selector, timeout = 500) {
await this.page.waitForSelector(selector, {visible: true, timeout}); await this.waitAndQuery(selector, timeout);
return await this.queryAll(selector); return await this.queryAll(selector);
} }