From f49b85897d2eef02574ef5719cf0dccb12986446 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 23 Aug 2018 00:29:24 +0200 Subject: [PATCH] remove specific timeout for selectors as these are not hard sleeps, but timeouts, its better to put them a bit larger, as in the best case they'll return quickly anyway and in the worst case where they need a lot of time it's still better if the tests don't fail --- src/tests/accept-invite.js | 4 ++-- src/tests/consent.js | 2 +- src/tests/dialog.js | 4 ++-- src/tests/server-notices-consent.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tests/accept-invite.js b/src/tests/accept-invite.js index c83e0c02cc..8cc1a0b37d 100644 --- a/src/tests/accept-invite.js +++ b/src/tests/accept-invite.js @@ -20,7 +20,7 @@ const {acceptDialogMaybe} = require('./dialog'); module.exports = async function acceptInvite(session, name) { session.log.step(`accepts "${name}" invite`); //TODO: brittle selector - const invitesHandles = await session.waitAndQueryAll('.mx_RoomTile_name.mx_RoomTile_invite', 1000); + const invitesHandles = await session.waitAndQueryAll('.mx_RoomTile_name.mx_RoomTile_invite'); const invitesWithText = await Promise.all(invitesHandles.map(async (inviteHandle) => { const text = await session.innerText(inviteHandle); return {inviteHandle, text}; @@ -38,4 +38,4 @@ module.exports = async function acceptInvite(session, name) { acceptDialogMaybe(session, "encryption"); session.log.done(); -} \ No newline at end of file +} diff --git a/src/tests/consent.js b/src/tests/consent.js index 0b25eb06be..b4a6289fca 100644 --- a/src/tests/consent.js +++ b/src/tests/consent.js @@ -17,7 +17,7 @@ limitations under the License. const assert = require('assert'); module.exports = async function acceptTerms(session) { - const reviewTermsButton = await session.waitAndQuery('.mx_QuestionDialog button.mx_Dialog_primary', 5000); + const reviewTermsButton = await session.waitAndQuery('.mx_QuestionDialog button.mx_Dialog_primary'); const termsPagePromise = session.waitForNewPage(); await reviewTermsButton.click(); const termsPage = await termsPagePromise; diff --git a/src/tests/dialog.js b/src/tests/dialog.js index 8d9c798c45..89c70470d9 100644 --- a/src/tests/dialog.js +++ b/src/tests/dialog.js @@ -27,7 +27,7 @@ async function acceptDialog(session, expectedContent) { async function acceptDialogMaybe(session, expectedContent) { let dialog = null; try { - dialog = await session.waitAndQuery(".mx_QuestionDialog", 100); + dialog = await session.waitAndQuery(".mx_QuestionDialog"); } catch(err) { return false; } @@ -44,4 +44,4 @@ async function acceptDialogMaybe(session, expectedContent) { module.exports = { acceptDialog, acceptDialogMaybe, -}; \ No newline at end of file +}; diff --git a/src/tests/server-notices-consent.js b/src/tests/server-notices-consent.js index d0c91da7b1..25c3bb3bd5 100644 --- a/src/tests/server-notices-consent.js +++ b/src/tests/server-notices-consent.js @@ -19,7 +19,7 @@ const acceptInvite = require("./accept-invite") module.exports = async function acceptServerNoticesInviteAndConsent(session) { await acceptInvite(session, "Server Notices"); session.log.step(`accepts terms & conditions`); - const consentLink = await session.waitAndQuery(".mx_EventTile_body a", 1000); + const consentLink = await session.waitAndQuery(".mx_EventTile_body a"); const termsPagePromise = session.waitForNewPage(); await consentLink.click(); const termsPage = await termsPagePromise;