Merge pull request #60 from matrix-org/bwindels/somefixes
Attempt at making E2E tests on CI less flakypull/21833/head
commit
04f7514080
|
@ -108,6 +108,9 @@ module.exports = class RiotSession {
|
||||||
async replaceInputText(input, text) {
|
async replaceInputText(input, text) {
|
||||||
// click 3 times to select all text
|
// click 3 times to select all text
|
||||||
await input.click({clickCount: 3});
|
await input.click({clickCount: 3});
|
||||||
|
// waiting here solves not having selected all the text by the 3x click above,
|
||||||
|
// presumably because of the Field label animation.
|
||||||
|
await this.delay(300);
|
||||||
// then remove it with backspace
|
// then remove it with backspace
|
||||||
await input.press('Backspace');
|
await input.press('Backspace');
|
||||||
// and type the new text
|
// and type the new text
|
||||||
|
|
|
@ -20,14 +20,14 @@ module.exports.scrollToTimelineTop = async function(session) {
|
||||||
session.log.step(`scrolls to the top of the timeline`);
|
session.log.step(`scrolls to the top of the timeline`);
|
||||||
await session.page.evaluate(() => {
|
await session.page.evaluate(() => {
|
||||||
return Promise.resolve().then(async () => {
|
return Promise.resolve().then(async () => {
|
||||||
const timelineScrollView = document.querySelector(".mx_RoomView_timeline .mx_ScrollPanel");
|
|
||||||
let timedOut = false;
|
let timedOut = false;
|
||||||
let timeoutHandle = null;
|
let timeoutHandle = null;
|
||||||
// set scrollTop to 0 in a loop and check every 50ms
|
// set scrollTop to 0 in a loop and check every 50ms
|
||||||
// if content became available (scrollTop not being 0 anymore),
|
// if content became available (scrollTop not being 0 anymore),
|
||||||
// assume everything is loaded after 3s
|
// assume everything is loaded after 3s
|
||||||
do {
|
do {
|
||||||
if (timelineScrollView.scrollTop !== 0) {
|
const timelineScrollView = document.querySelector(".mx_RoomView_timeline .mx_ScrollPanel");
|
||||||
|
if (timelineScrollView && timelineScrollView.scrollTop !== 0) {
|
||||||
if (timeoutHandle) {
|
if (timeoutHandle) {
|
||||||
clearTimeout(timeoutHandle);
|
clearTimeout(timeoutHandle);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue