From 71a3e13ea5a07e84373cf593df1e91bad29c5aa3 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 17 May 2022 14:34:25 +1000 Subject: [PATCH] test: fix new contact test to use waitForMatchingText --- ts/test/automation/new_contact_test.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ts/test/automation/new_contact_test.spec.ts b/ts/test/automation/new_contact_test.spec.ts index dd7efb23e..7a4a6abff 100644 --- a/ts/test/automation/new_contact_test.spec.ts +++ b/ts/test/automation/new_contact_test.spec.ts @@ -1,9 +1,9 @@ -import { _electron, expect, Page, test } from '@playwright/test'; +import { _electron, Page, test } from '@playwright/test'; import { cleanUpOtherTest, forceCloseAllWindows } from './setup/beforeEach'; import { sendNewMessage } from './send_message'; import { openAppsAndNewUsers } from './setup/new_user'; -import { clickOnTestIdWithText } from './utils'; +import { clickOnTestIdWithText, waitForTestIdWithText } from './utils'; const testMessage = 'A -> B'; const testReply = 'B -> A'; @@ -27,7 +27,8 @@ test('Send message to new contact', async () => { await clickOnTestIdWithText(windowA, 'contact-section'); await windowA.waitForTimeout(2000); - expect(await windowB.innerText('.module-conversation__user__profile-name')).toBe(userA.userName); + await waitForTestIdWithText(windowB, 'module-conversation__user__profile-name', userA.userName); + // Navigate to contacts tab in User A's window await clickOnTestIdWithText(windowA, 'contact-section'); });