From 2a7438e9fbdb3ab4afbc2f722b1536dd5ab946c3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 7 Aug 2018 18:23:02 +0200 Subject: [PATCH] no need to double select here, might speed things up slightly --- src/session.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/session.js b/src/session.js index d82c90d4d9..e5e16400b8 100644 --- a/src/session.js +++ b/src/session.js @@ -133,9 +133,8 @@ module.exports = class RiotSession { return this.page.$(selector); } - async waitAndQuery(selector, timeout = 500) { - await this.page.waitForSelector(selector, {visible: true, timeout}); - return await this.query(selector); + waitAndQuery(selector, timeout = 500) { + return this.page.waitForSelector(selector, {visible: true, timeout}); } queryAll(selector) { @@ -143,7 +142,7 @@ module.exports = class RiotSession { } async waitAndQueryAll(selector, timeout = 500) { - await this.page.waitForSelector(selector, {visible: true, timeout}); + await this.waitAndQuery(selector, timeout); return await this.queryAll(selector); }