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
This commit is contained in:
Bruno Windels 2018-08-23 00:29:24 +02:00
parent fd67ace078
commit f49b85897d
4 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ const {acceptDialogMaybe} = require('./dialog');
module.exports = async function acceptInvite(session, name) { module.exports = async function acceptInvite(session, name) {
session.log.step(`accepts "${name}" invite`); session.log.step(`accepts "${name}" invite`);
//TODO: brittle selector //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 invitesWithText = await Promise.all(invitesHandles.map(async (inviteHandle) => {
const text = await session.innerText(inviteHandle); const text = await session.innerText(inviteHandle);
return {inviteHandle, text}; return {inviteHandle, text};

View file

@ -17,7 +17,7 @@ limitations under the License.
const assert = require('assert'); const assert = require('assert');
module.exports = async function acceptTerms(session) { 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(); const termsPagePromise = session.waitForNewPage();
await reviewTermsButton.click(); await reviewTermsButton.click();
const termsPage = await termsPagePromise; const termsPage = await termsPagePromise;

View file

@ -27,7 +27,7 @@ async function acceptDialog(session, expectedContent) {
async function acceptDialogMaybe(session, expectedContent) { async function acceptDialogMaybe(session, expectedContent) {
let dialog = null; let dialog = null;
try { try {
dialog = await session.waitAndQuery(".mx_QuestionDialog", 100); dialog = await session.waitAndQuery(".mx_QuestionDialog");
} catch(err) { } catch(err) {
return false; return false;
} }

View file

@ -19,7 +19,7 @@ const acceptInvite = require("./accept-invite")
module.exports = async function acceptServerNoticesInviteAndConsent(session) { module.exports = async function acceptServerNoticesInviteAndConsent(session) {
await acceptInvite(session, "Server Notices"); await acceptInvite(session, "Server Notices");
session.log.step(`accepts terms & conditions`); 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(); const termsPagePromise = session.waitForNewPage();
await consentLink.click(); await consentLink.click();
const termsPage = await termsPagePromise; const termsPage = await termsPagePromise;