mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Pass the session through
This commit is contained in:
parent
f12d951209
commit
9000888013
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue