Revert ES6ification of end-to-end tests and add instructions for Windows

Because the tests are run directly by node, we have to use the CommonJS module syntax. We could run the thing through babel, but then we just have another babel.

Windows instructions are from experience and may not be optimized.
This commit is contained in:
Travis Ralston 2020-01-10 10:13:41 -07:00
parent 9f04f94c65
commit e66f2a6c3f
24 changed files with 103 additions and 52 deletions

View file

@ -17,7 +17,7 @@ limitations under the License.
const assert = require('assert');
export async function openMemberInfo(session, name) {
async function openMemberInfo(session, name) {
const membersAndNames = await getMembersInMemberlist(session);
const matchingLabel = membersAndNames.filter((m) => {
return m.displayName === name;
@ -25,7 +25,9 @@ export async function openMemberInfo(session, name) {
await matchingLabel.click();
}
export async function verifyDeviceForUser(session, name, expectedDevice) {
module.exports.openMemberInfo = openMemberInfo;
module.exports.verifyDeviceForUser = async function(session, name, expectedDevice) {
session.log.step(`verifies e2e device for ${name}`);
const membersAndNames = await getMembersInMemberlist(session);
const matchingLabel = membersAndNames.filter((m) => {
@ -58,9 +60,9 @@ export async function verifyDeviceForUser(session, name, expectedDevice) {
const closeMemberInfo = await session.query(".mx_MemberInfo_cancel");
await closeMemberInfo.click();
session.log.done();
}
};
export async function getMembersInMemberlist(session) {
async function getMembersInMemberlist(session) {
const memberPanelButton = await session.query(".mx_RightPanel_membersButton");
try {
await session.query(".mx_RightPanel_headerButton_highlight", 500);
@ -77,3 +79,5 @@ export async function getMembersInMemberlist(session) {
return {label: el, displayName: await session.innerText(el)};
}));
}
module.exports.getMembersInMemberlist = getMembersInMemberlist;