Decrease threads flakiness

This commit is contained in:
Diego Mello 2023-02-27 09:43:17 -03:00
parent d06c59518c
commit 22b485994a
2 changed files with 7 additions and 2 deletions

View File

@ -129,13 +129,13 @@ async function mockRandomMessage(message: string, isThread = false) {
try {
await matchMessage();
} catch {
// TODO: Create a proper test for this elsewhere.
await dismissReviewNag();
await matchMessage();
}
return message;
}
// TODO: Create a proper test for this elsewhere.
async function dismissReviewNag() {
const deviceType = device.getPlatform();
const { textMatcher } = platformTypes[deviceType];

View File

@ -156,7 +156,12 @@ describe('Threads', () => {
it('should navigate to thread from thread name', async () => {
const messageText = 'navthreadname';
await mockRandomMessage('dummymessagebetweenthethread');
await element(by.id(`message-thread-button-${thread}`)).tap();
try {
await element(by.id(`message-thread-button-${thread}`)).tap();
} catch {
await dismissReviewNag();
await element(by.id(`message-thread-button-${thread}`)).tap();
}
await waitFor(element(by.id('messagebox-input-thread')))
.toExist()
.withTimeout(5000);