fix writing in composer

pull/21833/head
Bruno Windels 2019-03-29 16:59:05 +01:00
parent fe6a273ba9
commit 5598214cd2
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,9 @@ module.exports = async function sendMessage(session, message) {
// this selector needs to be the element that has contenteditable=true, // this selector needs to be the element that has contenteditable=true,
// not any if its parents, otherwise it behaves flaky at best. // not any if its parents, otherwise it behaves flaky at best.
const composer = await session.waitAndQuery('.mx_MessageComposer_editor'); 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); await composer.type(message);
const text = await session.innerText(composer); const text = await session.innerText(composer);
assert.equal(text.trim(), message.trim()); assert.equal(text.trim(), message.trim());