mirror of https://github.com/vector-im/riot-web
Merge pull request #57 from matrix-org/bwindels/fix-open-directory
Adjust how room directory and create room dialog should be openedpull/21833/head
commit
e3f7246c37
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue