Fix more flaky tests

This commit is contained in:
Diego Mello 2023-03-01 18:01:57 -03:00
parent 91a4eeb9b9
commit 079206052c
2 changed files with 5 additions and 9 deletions

View File

@ -192,7 +192,7 @@ describe('Create room screen', () => {
.withTimeout(5000); .withTimeout(5000);
await element(by.id('selected-users-view-submit')).tap(); await element(by.id('selected-users-view-submit')).tap();
await waitFor(element(by.id('create-channel-view'))) await waitFor(element(by.id('create-channel-view')))
.toExist() .toBeVisible()
.withTimeout(5000); .withTimeout(5000);
await element(by.id('create-channel-name')).replaceText(room); await element(by.id('create-channel-name')).replaceText(room);
await element(by.id('create-channel-name')).tapReturnKey(); await element(by.id('create-channel-name')).tapReturnKey();

View File

@ -8,7 +8,8 @@ import {
navigateToRoom, navigateToRoom,
platformTypes, platformTypes,
mockMessage, mockMessage,
sleep sleep,
checkRoomTitle
} from '../../helpers/app'; } from '../../helpers/app';
import { createRandomRoom, createRandomUser, ITestUser } from '../../helpers/data_setup'; import { createRandomRoom, createRandomUser, ITestUser } from '../../helpers/data_setup';
import random from '../../helpers/random'; import random from '../../helpers/random';
@ -109,15 +110,10 @@ describe('Discussion', () => {
.withTimeout(2000); .withTimeout(2000);
await element(by[textMatcher]('Start a Discussion')).atIndex(0).tap(); await element(by[textMatcher]('Start a Discussion')).atIndex(0).tap();
await waitFor(element(by.id('create-discussion-view'))) await waitFor(element(by.id('create-discussion-view')))
.toExist() .toBeVisible()
.withTimeout(2000); .withTimeout(2000);
await element(by.id('create-discussion-submit')).tap(); await element(by.id('create-discussion-submit')).tap();
await waitFor(element(by.id('room-view'))) await checkRoomTitle(discussionFromActionSheet);
.toExist()
.withTimeout(10000);
await waitFor(element(by.id(`room-view-title-${discussionFromActionSheet}`)))
.toExist()
.withTimeout(5000);
}); });
}); });