From 66166d4a1383d5efa23f1fd86cb63c4898a0a3fd Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Tue, 11 Jun 2024 13:09:40 +0200 Subject: [PATCH] chore(e2e): Reduce solid e2e tests flakines by waiting for more specific errors --- .../test-applications/solid/tests/errorboundary.test.ts | 6 +++--- .../e2e-tests/test-applications/solid/tests/errors.test.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts b/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts index 279eec70c059..287642424850 100644 --- a/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts +++ b/dev-packages/e2e-tests/test-applications/solid/tests/errorboundary.test.ts @@ -3,7 +3,7 @@ import { waitForError } from '@sentry-internal/test-utils'; test('captures an exception', async ({ page }) => { const errorEventPromise = waitForError('solid', errorEvent => { - return !errorEvent.type; + return !errorEvent.type && errorEvent.transaction === '/error-boundary-example'; }); const [, errorEvent] = await Promise.all([page.goto('/error-boundary-example'), errorEventPromise]); @@ -27,7 +27,7 @@ test('captures an exception', async ({ page }) => { test('captures a second exception after resetting the boundary', async ({ page }) => { const firstErrorEventPromise = waitForError('solid', errorEvent => { - return !errorEvent.type; + return !errorEvent.type && errorEvent.transaction === '/error-boundary-example'; }); const [, firstErrorEvent] = await Promise.all([page.goto('/error-boundary-example'), firstErrorEventPromise]); @@ -49,7 +49,7 @@ test('captures a second exception after resetting the boundary', async ({ page } }); const secondErrorEventPromise = waitForError('solid', errorEvent => { - return !errorEvent.type; + return !errorEvent.type && errorEvent.transaction === '/error-boundary-example'; }); const [, secondErrorEvent] = await Promise.all([ diff --git a/dev-packages/e2e-tests/test-applications/solid/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/solid/tests/errors.test.ts index b55a9192ab1c..8fb9d3d2513a 100644 --- a/dev-packages/e2e-tests/test-applications/solid/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/solid/tests/errors.test.ts @@ -3,7 +3,7 @@ import { waitForError } from '@sentry-internal/test-utils'; test('sends an error', async ({ page }) => { const errorPromise = waitForError('solid', async errorEvent => { - return !errorEvent.type; + return !errorEvent.type && errorEvent.transaction === '/'; }); await Promise.all([page.goto(`/`), page.locator('#errorBtn').click()]);