diff --git a/test/end-to-end-tests/src/usecases/invite.js b/test/end-to-end-tests/src/usecases/invite.js index 838b632ddd..814ecd30a6 100644 --- a/test/end-to-end-tests/src/usecases/invite.js +++ b/test/end-to-end-tests/src/usecases/invite.js @@ -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"); diff --git a/test/end-to-end-tests/src/usecases/memberlist.js b/test/end-to-end-tests/src/usecases/memberlist.js index f6b07b3500..42601b6610 100644 --- a/test/end-to-end-tests/src/usecases/memberlist.js +++ b/test/end-to-end-tests/src/usecases/memberlist.js @@ -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)};