fix writing in composer

This commit is contained in:
Bruno Windels 2019-03-29 16:59:05 +01:00
parent fe6a273ba9
commit 5598214cd2

View file

@ -21,6 +21,9 @@ module.exports = async function sendMessage(session, message) {
// this selector needs to be the element that has contenteditable=true,
// not any if its parents, otherwise it behaves flaky at best.
const composer = await session.waitAndQuery('.mx_MessageComposer_editor');
// sometimes the focus that type() does internally doesn't seem to work
// and calling click before seems to fix it 🤷
await composer.click();
await composer.type(message);
const text = await session.innerText(composer);
assert.equal(text.trim(), message.trim());