From 22b485994a4b959a89bddd503e7bc7656c8da2aa Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 27 Feb 2023 09:43:17 -0300 Subject: [PATCH] Decrease threads flakiness --- e2e/helpers/app.ts | 2 +- e2e/tests/room/05-threads.spec.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/e2e/helpers/app.ts b/e2e/helpers/app.ts index 54415a8a6..75a8535a0 100644 --- a/e2e/helpers/app.ts +++ b/e2e/helpers/app.ts @@ -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]; diff --git a/e2e/tests/room/05-threads.spec.ts b/e2e/tests/room/05-threads.spec.ts index 1e939d6d9..74da40abb 100644 --- a/e2e/tests/room/05-threads.spec.ts +++ b/e2e/tests/room/05-threads.spec.ts @@ -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);