From f66f5bedb676c5191c732d7b086937c7b3349eda Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 10 Sep 2019 16:27:02 +0200 Subject: [PATCH] Adjust how room directory and create room dialog should be opened --- src/usecases/create-room.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/usecases/create-room.js b/src/usecases/create-room.js index 4578dbaf0a..132a4bd782 100644 --- a/src/usecases/create-room.js +++ b/src/usecases/create-room.js @@ -17,6 +17,13 @@ limitations under the License. const assert = require('assert'); async function openRoomDirectory(session) { + const roomDirectoryButton = await session.query('.mx_LeftPanel_explore .mx_AccessibleButton'); + await roomDirectoryButton.click(); +} + +async function createRoom(session, roomName) { + session.log.step(`creates room "${roomName}"`); + const roomListHeaders = await session.queryAll('.mx_RoomSubList_labelContainer'); const roomListHeaderLabels = await Promise.all(roomListHeaders.map(h => session.innerText(h))); const roomsIndex = roomListHeaderLabels.findIndex(l => l.toLowerCase().includes("rooms")); @@ -26,13 +33,7 @@ async function openRoomDirectory(session) { const roomsHeader = roomListHeaders[roomsIndex]; const addRoomButton = await roomsHeader.$(".mx_RoomSubList_addRoom"); await addRoomButton.click(); -} -async function createRoom(session, roomName) { - session.log.step(`creates room "${roomName}"`); - await openRoomDirectory(session); - const createRoomButton = await session.query('.mx_RoomDirectory_createRoom'); - await createRoomButton.click(); const roomNameInput = await session.query('.mx_CreateRoomDialog_input'); await session.replaceInputText(roomNameInput, roomName);