From 9000888013f27f75b106719832eeb88f571414dc Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 7 Jul 2020 16:38:24 -0600 Subject: [PATCH] Pass the session through --- test/end-to-end-tests/src/usecases/accept-invite.js | 2 +- test/end-to-end-tests/src/usecases/create-room.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/end-to-end-tests/src/usecases/accept-invite.js b/test/end-to-end-tests/src/usecases/accept-invite.js index a61aaec64c..27992e16df 100644 --- a/test/end-to-end-tests/src/usecases/accept-invite.js +++ b/test/end-to-end-tests/src/usecases/accept-invite.js @@ -19,7 +19,7 @@ const {findSublist} = require("./create-room"); module.exports = async function acceptInvite(session, name) { session.log.step(`accepts "${name}" invite`); - const inviteSublist = await findSublist("invites"); + const inviteSublist = await findSublist(session, "invites"); const invitesHandles = await inviteSublist.$(".mx_RoomTile2_name"); const invitesWithText = await Promise.all(invitesHandles.map(async (inviteHandle) => { const text = await session.innerText(inviteHandle); diff --git a/test/end-to-end-tests/src/usecases/create-room.js b/test/end-to-end-tests/src/usecases/create-room.js index 50cb1e02f3..24e42b92dd 100644 --- a/test/end-to-end-tests/src/usecases/create-room.js +++ b/test/end-to-end-tests/src/usecases/create-room.js @@ -20,7 +20,7 @@ async function openRoomDirectory(session) { await roomDirectoryButton.click(); } -async function findSublist(name) { +async function findSublist(session, name) { const sublists = await session.queryAll('.mx_RoomSublist2'); for (const sublist of sublists) { const header = await sublist.$('.mx_RoomSublist2_headerText'); @@ -35,7 +35,7 @@ async function findSublist(name) { async function createRoom(session, roomName, encrypted=false) { session.log.step(`creates room "${roomName}"`); - const roomsSublist = await findSublist("rooms"); + const roomsSublist = await findSublist(session, "rooms"); const addRoomButton = await roomsSublist.$(".mx_RoomSublist2_auxButton"); await addRoomButton.click(); @@ -57,7 +57,7 @@ async function createRoom(session, roomName, encrypted=false) { async function createDm(session, invitees) { session.log.step(`creates DM with ${JSON.stringify(invitees)}`); - const dmsSublist = await findSublist("people"); + const dmsSublist = await findSublist(session, "people"); const startChatButton = await dmsSublist.$(".mx_RoomSublist2_auxButton"); await startChatButton.click();