From 1d81df002c15895f32bba2d5ea3bded06d1549c4 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 22 Jan 2024 21:13:30 -0300 Subject: [PATCH] test: fix messaging flaky test (#31512) --- apps/meteor/tests/e2e/messaging.spec.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/meteor/tests/e2e/messaging.spec.ts b/apps/meteor/tests/e2e/messaging.spec.ts index 20620b79e093..c5099c52b9f1 100644 --- a/apps/meteor/tests/e2e/messaging.spec.ts +++ b/apps/meteor/tests/e2e/messaging.spec.ts @@ -29,8 +29,10 @@ test.describe.serial('Messaging', () => { await poHomeChannel.content.sendMessage('hello world'); - await expect(auxContext.poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); - await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); + await expect(async () => { + await expect(auxContext.poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); + }).toPass(); await auxContext.page.close(); }); @@ -43,8 +45,10 @@ test.describe.serial('Messaging', () => { await poHomeChannel.content.sendMessage('hello world'); - await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); - await expect(auxContext.poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); + await expect(async () => { + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); + await expect(auxContext.poHomeChannel.content.lastUserMessageBody).toHaveText('hello world'); + }).toPass(); await auxContext.page.close(); });