mirror of https://github.com/vector-im/riot-web
Fix member list not being open for end-to-end tests
parent
94ae06db4d
commit
405b3f6be6
|
@ -18,7 +18,16 @@ module.exports = async function invite(session, userId) {
|
|||
session.log.step(`invites "${userId}" to room`);
|
||||
await session.delay(1000);
|
||||
const memberPanelButton = await session.query(".mx_RightPanel_membersButton");
|
||||
await memberPanelButton.click();
|
||||
try {
|
||||
await session.query(".mx_RightPanel_headerButton_highlight", 500);
|
||||
// Right panel is open - toggle it to ensure it's the member list
|
||||
// Sometimes our tests have this opened to MemberInfo
|
||||
await memberPanelButton.click();
|
||||
await memberPanelButton.click();
|
||||
} catch (e) {
|
||||
// Member list is closed - open it
|
||||
await memberPanelButton.click();
|
||||
}
|
||||
const inviteButton = await session.query(".mx_MemberList_invite");
|
||||
await inviteButton.click();
|
||||
const inviteTextArea = await session.query(".mx_AddressPickerDialog textarea");
|
||||
|
|
|
@ -62,6 +62,17 @@ module.exports.verifyDeviceForUser = async function(session, name, expectedDevic
|
|||
};
|
||||
|
||||
async function getMembersInMemberlist(session) {
|
||||
const memberPanelButton = await session.query(".mx_RightPanel_membersButton");
|
||||
try {
|
||||
await session.query(".mx_RightPanel_headerButton_highlight", 500);
|
||||
// Right panel is open - toggle it to ensure it's the member list
|
||||
// Sometimes our tests have this opened to MemberInfo
|
||||
await memberPanelButton.click();
|
||||
await memberPanelButton.click();
|
||||
} catch (e) {
|
||||
// Member list is closed - open it
|
||||
await memberPanelButton.click();
|
||||
}
|
||||
const memberNameElements = await session.queryAll(".mx_MemberList .mx_EntityTile_name");
|
||||
return Promise.all(memberNameElements.map(async (el) => {
|
||||
return {label: el, displayName: await session.innerText(el)};
|
||||
|
|
Loading…
Reference in New Issue