From 3c8fac95e31de3d7e459f6f7833229cb2fc5a9d5 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Mon, 5 Aug 2024 21:56:37 +0200 Subject: [PATCH] e2e replay test --- test/e2e/test/e2e.test.ts | 5 +++++ test/react-native/rn.patch.app.js | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/test/e2e/test/e2e.test.ts b/test/e2e/test/e2e.test.ts index 5b61c3f1a..cf9b3c1c1 100644 --- a/test/e2e/test/e2e.test.ts +++ b/test/e2e/test/e2e.test.ts @@ -129,6 +129,11 @@ describe('End to end tests for common events', () => { const eventId = await waitForEventId(); const sentryEvent = await fetchEvent(eventId); expect(sentryEvent.eventID).toMatch(eventId); + + expect(sentryEvent.contexts).toBeDefined(); + const replay = sentryEvent.contexts!['replay'] as any; + expect(replay).toBeDefined(); + expect(replay.replay_id.length).toBe(32); }); test('unhandledPromiseRejection', async () => { diff --git a/test/react-native/rn.patch.app.js b/test/react-native/rn.patch.app.js index c32274bfa..614e31ef7 100755 --- a/test/react-native/rn.patch.app.js +++ b/test/react-native/rn.patch.app.js @@ -26,6 +26,16 @@ Sentry.init({ release: '${SENTRY_RELEASE}', dist: '${SENTRY_DIST}', dsn: 'https://1df17bd4e543fdb31351dee1768bb679@o447951.ingest.sentry.io/5428561', + _experiments: { + replaysSessionSampleRate: 1.0, + replaysOnErrorSampleRate: 1.0, + }, + integrations: [ + Sentry.mobileReplayIntegration({ + maskAllText: true, + maskAllImages: true, + }), + ], }); `; const e2eComponentPatch = '';