From f4a8b8ce54cdb8745a68585516987ff42e750c6f Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 27 Jan 2025 15:26:39 +0100 Subject: [PATCH] test(e2e): Unflake replay recording data optional e2e test (#15168) Relax the assertion for the replay recording data test so that we allow arbitrary order but still assert on the exact amount and contents of the received recording items. closes #15167 --- .../react-send-to-sentry/tests/send-to-sentry.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts b/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts index d9c3e09f2ad2..dc33d271bc18 100644 --- a/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts +++ b/dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/send-to-sentry.test.ts @@ -190,7 +190,7 @@ test('Sends a Replay recording to Sentry', async ({ browser }) => { if (response.ok) { const data = await response.json(); - return data[0]; + return { data: data[0], length: data[0].length }; } return response.status; @@ -199,5 +199,6 @@ test('Sends a Replay recording to Sentry', async ({ browser }) => { timeout: EVENT_POLLING_TIMEOUT, }, ) - .toEqual(ReplayRecordingData); + // Check that that all expected data is present but relax the order to avoid flakes + .toEqual({ data: expect.arrayContaining(ReplayRecordingData), length: ReplayRecordingData.length }); });