From 9e676e049dff53f7ff6f018bc9f1210ed587422a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 29 Oct 2024 09:08:51 +0100 Subject: [PATCH] test(browser-integration): Add sentry DSN route handler by default (#14095) Instead of sprinkling this through tests, we can just generally handle this route, streamlining tests a bit and avoid unexpected errors/console warnings messing with things. So this PR basically inverses this - by default, we add a "success" route handler for the Sentry DSN, and if you want to have special handling you can opt-out of this. Supersedes https://github.com/getsentry/sentry-javascript/pull/14092/files --- .../loader/noOnLoad/replay/test.ts | 8 ---- .../loader/noOnLoad/replayError/test.ts | 8 ---- .../noOnLoad/sdkLoadedInMeanwhile/test.ts | 2 +- .../onLoad/captureExceptionInOnLoad/test.ts | 16 -------- .../loader/onLoad/customInit/test.ts | 8 ---- .../loader/onLoad/customIntegrations/test.ts | 8 ---- .../onLoad/customIntegrationsFunction/test.ts | 8 ---- .../loader/onLoad/customReplay/test.ts | 8 ---- .../loader/onLoad/keepSentryGlobal/test.ts | 8 ---- .../loader/onLoad/onLoadLate/test.ts | 8 ---- .../loader/onLoad/replay/test.ts | 8 ---- .../suites/feedback/attachTo/test.ts | 8 ---- .../suites/feedback/captureFeedback/test.ts | 8 ---- .../hasSampling/test.ts | 8 ---- .../feedback/captureFeedbackCsp/test.ts | 8 ---- .../suites/feedback/logger/test.ts | 8 ---- .../integrations/captureConsole/test.ts | 8 ---- .../skip-init-browser-extension/test.ts | 8 ---- .../skip-init-chrome-extension/test.ts | 8 ---- .../suites/metrics/metricsShim/test.ts | 2 +- .../suites/metrics/timing/test.ts | 16 -------- .../suites/replay/bufferModeManual/test.ts | 22 ++-------- .../suites/replay/bufferModeReload/test.ts | 8 ---- .../replay/canvas/manualSnapshot/test.ts | 8 ---- .../suites/replay/canvas/records/test.ts | 8 ---- .../canvas/withCanvasIntegrationFirst/test.ts | 8 ---- .../withCanvasIntegrationSecond/test.ts | 8 ---- .../canvas/withoutCanvasIntegration/test.ts | 8 ---- .../replay/captureComponentName/test.ts | 16 -------- .../suites/replay/captureConsoleLog/test.ts | 16 -------- .../suites/replay/captureReplay/test.ts | 8 ---- .../captureReplayFromReplayPackage/test.ts | 8 ---- .../replay/captureReplayOffline/test.ts | 8 ---- .../suites/replay/compressionDisabled/test.ts | 8 ---- .../suites/replay/compressionEnabled/test.ts | 8 ---- .../replay/compressionWorkerUrl/test.ts | 8 ---- .../suites/replay/customEvents/test.ts | 24 ----------- .../suites/replay/dsc/test.ts | 24 ----------- .../suites/replay/errorResponse/test.ts | 2 +- .../replay/errors/beforeErrorSampling/test.ts | 8 ---- .../suites/replay/errors/droppedError/test.ts | 2 +- .../suites/replay/errors/errorMode/test.ts | 2 +- .../suites/replay/errors/errorNotSent/test.ts | 2 +- .../replay/errors/errorsInSession/test.ts | 10 +---- .../replay/errors/immediateError/test.ts | 8 ---- .../suites/replay/eventBufferError/test.ts | 6 --- .../fetch/captureRequestBody/test.ts | 40 ------------------- .../fetch/captureRequestHeaders/test.ts | 34 ---------------- .../fetch/captureRequestSize/test.ts | 16 -------- .../fetch/captureResponseBody/test.ts | 32 --------------- .../fetch/captureResponseHeaders/test.ts | 24 ----------- .../fetch/captureResponseSize/test.ts | 24 ----------- .../fetch/captureTimestamps/test.ts | 2 +- .../xhr/captureRequestBody/test.ts | 40 ------------------- .../xhr/captureRequestHeaders/test.ts | 16 -------- .../xhr/captureRequestSize/test.ts | 16 -------- .../xhr/captureResponseBody/test.ts | 40 ------------------- .../xhr/captureResponseHeaders/test.ts | 16 -------- .../xhr/captureResponseSize/test.ts | 24 ----------- .../xhr/captureTimestamps/test.ts | 2 +- .../suites/replay/fileInput/test.ts | 8 ---- .../suites/replay/flushing/test.ts | 8 ---- .../suites/replay/keyboardEvents/test.ts | 8 ---- .../largeMutations/defaultOptions/test.ts | 8 ---- .../largeMutations/mutationLimit/test.ts | 8 ---- .../suites/replay/logger/test.ts | 8 ---- .../suites/replay/maxReplayDuration/test.ts | 8 ---- .../suites/replay/minReplayDuration/test.ts | 8 ---- .../suites/replay/multiple-pages/test.ts | 8 ---- .../suites/replay/privacyBlock/test.ts | 8 ---- .../suites/replay/privacyDefault/test.ts | 8 ---- .../suites/replay/privacyInput/test.ts | 16 -------- .../suites/replay/privacyInputMaskAll/test.ts | 16 -------- .../replay/replayIntegrationShim/test.ts | 2 +- .../suites/replay/replayShim/test.ts | 2 +- .../suites/replay/requests/test.ts | 16 -------- .../suites/replay/sampling/test.ts | 2 +- .../suites/replay/sessionExpiry/test.ts | 8 ---- .../suites/replay/sessionInactive/test.ts | 8 ---- .../suites/replay/sessionMaxAge/test.ts | 8 ---- .../replay/slowClick/clickTargets/test.ts | 16 -------- .../suites/replay/slowClick/disable/test.ts | 8 ---- .../suites/replay/slowClick/error/test.ts | 16 -------- .../suites/replay/slowClick/ignore/test.ts | 16 -------- .../replay/slowClick/multiClick/test.ts | 16 -------- .../suites/replay/slowClick/mutation/test.ts | 40 ------------------- .../suites/replay/slowClick/scroll/test.ts | 16 -------- .../suites/replay/slowClick/timeout/test.ts | 16 -------- .../replay/slowClick/windowOpen/test.ts | 8 ---- .../suites/replay/throttleBreadcrumbs/test.ts | 8 ---- .../suites/replay/unicode/compressed/test.ts | 8 ---- .../replay/unicode/uncompressed/test.ts | 8 ---- .../suites/sessions/initial-scope/test.ts | 8 ---- .../suites/sessions/start-session/test.ts | 8 ---- .../sessions/v7-hub-start-session/test.ts | 8 ---- .../browserTracingIntegrationShim/test.ts | 2 +- .../metrics/web-vitals-inp-late/test.ts | 8 ---- .../web-vitals-inp-parametrized-late/test.ts | 8 ---- .../web-vitals-inp-parametrized/test.ts | 8 ---- .../tracing/metrics/web-vitals-inp/test.ts | 16 -------- .../tracing/trace-lifetime/navigation/test.ts | 8 ---- .../utils/fixtures.ts | 34 +++++++++++++--- 102 files changed, 45 insertions(+), 1141 deletions(-) diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replay/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replay/test.ts index 25bcebcd074c..b690ebb36baa 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replay/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replay/test.ts @@ -11,14 +11,6 @@ sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => { sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const req = waitForReplayRequest(page); const url = await getLocalTestUrl({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replayError/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replayError/test.ts index 379697881165..87d0f7ff3db4 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replayError/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/replayError/test.ts @@ -9,14 +9,6 @@ sentryTest('should capture a replay & attach an error', async ({ getLocalTestUrl sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const req = waitForReplayRequest(page); const url = await getLocalTestUrl({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts index 62456093a9a6..8a1f1a7c721f 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/noOnLoad/sdkLoadedInMeanwhile/test.ts @@ -28,7 +28,7 @@ sentryTest('it does not download the SDK if the SDK was loaded in the meanwhile' }); }); - const tmpDir = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true }); + const tmpDir = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true, skipDsnRouteHandler: true }); await page.route(`${TEST_HOST}/*.*`, route => { const file = route.request().url().split('/').pop(); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/captureExceptionInOnLoad/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/captureExceptionInOnLoad/test.ts index 90868c3e2e8f..f5355ff765e9 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/captureExceptionInOnLoad/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/captureExceptionInOnLoad/test.ts @@ -4,14 +4,6 @@ import { sentryTest } from '../../../../utils/fixtures'; import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers'; sentryTest('captureException works inside of onLoad', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const req = await waitForErrorRequestOnUrl(page, url); @@ -21,14 +13,6 @@ sentryTest('captureException works inside of onLoad', async ({ getLocalTestUrl, }); sentryTest('should set SENTRY_SDK_SOURCE value', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const req = await waitForErrorRequestOnUrl(page, url); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customInit/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customInit/test.ts index 7171d2e0121f..689f6b88dd57 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customInit/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customInit/test.ts @@ -7,14 +7,6 @@ const bundle = process.env.PW_BUNDLE || ''; const isLazy = LOADER_CONFIGS[bundle]?.lazy; sentryTest('always calls onLoad init correctly', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrations/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrations/test.ts index bf08c3df2a0e..b8fc45402b76 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrations/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrations/test.ts @@ -8,14 +8,6 @@ sentryTest('should handle custom added integrations & default integrations', asy const shouldHaveReplay = !shouldSkipReplayTest(); const shouldHaveBrowserTracing = !shouldSkipTracingTest(); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrationsFunction/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrationsFunction/test.ts index 2b4685979e8c..038feb7c7652 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrationsFunction/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customIntegrationsFunction/test.ts @@ -5,14 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures'; sentryTest( 'should not add default integrations if integrations function is provided', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customReplay/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customReplay/test.ts index d53987b69385..07d877c00211 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customReplay/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customReplay/test.ts @@ -8,14 +8,6 @@ sentryTest('should handle custom added Replay integration', async ({ getLocalTes sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const req = waitForReplayRequest(page); const url = await getLocalTestUrl({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/keepSentryGlobal/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/keepSentryGlobal/test.ts index e4a2bf12e829..0f13098d7ae6 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/keepSentryGlobal/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/keepSentryGlobal/test.ts @@ -4,14 +4,6 @@ import { sentryTest } from '../../../../utils/fixtures'; import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers'; sentryTest('keeps data on window.Sentry intact', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const req = await waitForErrorRequestOnUrl(page, url); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/onLoadLate/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/onLoadLate/test.ts index 46bbf81f3c58..2aa720fd274e 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/onLoadLate/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/onLoadLate/test.ts @@ -4,14 +4,6 @@ import { sentryTest } from '../../../../utils/fixtures'; import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers'; sentryTest('late onLoad call is handled', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const req = await waitForErrorRequestOnUrl(page, url); diff --git a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/replay/test.ts b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/replay/test.ts index c162db40a9e5..afbfbeaba0b8 100644 --- a/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/replay/test.ts +++ b/dev-packages/browser-integration-tests/loader-suites/loader/onLoad/replay/test.ts @@ -8,14 +8,6 @@ sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => { sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const req = waitForReplayRequest(page); const url = await getLocalTestUrl({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts b/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts index 507b08685092..8c605597020d 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/attachTo/test.ts @@ -23,14 +23,6 @@ sentryTest('should capture feedback with custom button', async ({ getLocalTestUr } }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts b/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts index eb16cf1e1848..c553412d5933 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts @@ -23,14 +23,6 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => { } }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts index 5a88a429e53c..e42c42433de3 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/hasSampling/test.ts @@ -31,14 +31,6 @@ sentryTest('should capture feedback', async ({ forceFlushReplay, getLocalTestUrl } }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([page.goto(url), page.getByText('Report a Bug').click(), reqPromise0]); diff --git a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts index bca9b498fed0..a80fa4c2c6bf 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts @@ -23,14 +23,6 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => { } }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/feedback/logger/test.ts b/dev-packages/browser-integration-tests/suites/feedback/logger/test.ts index 34fadfc2503b..fe9fdf2e8065 100644 --- a/dev-packages/browser-integration-tests/suites/feedback/logger/test.ts +++ b/dev-packages/browser-integration-tests/suites/feedback/logger/test.ts @@ -19,14 +19,6 @@ sentryTest('should log error correctly', async ({ getLocalTestUrl, page }) => { messages.push(message.text()); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts b/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts index c704725822e7..606ef8925afd 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts @@ -7,14 +7,6 @@ import { getMultipleSentryEnvelopeRequests } from '../../../utils/helpers'; sentryTest('it captures console messages correctly', async ({ getLocalTestUrl, page }) => { const url = await getLocalTestUrl({ testDir: __dirname }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const [, events] = await Promise.all([page.goto(url), getMultipleSentryEnvelopeRequests(page, 7)]); expect(events).toHaveLength(7); diff --git a/dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts b/dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts index aeac53b9957a..7da78e3c1434 100644 --- a/dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts +++ b/dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts @@ -4,14 +4,6 @@ import { sentryTest } from '../../../utils/fixtures'; sentryTest( 'should not initialize when inside a Firefox/Safari browser extension', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const errorLogs: string[] = []; page.on('console', message => { diff --git a/dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts b/dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts index 3c5cc9c7648b..df0d70d779d2 100644 --- a/dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts +++ b/dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts @@ -2,14 +2,6 @@ import { expect } from '@playwright/test'; import { sentryTest } from '../../../utils/fixtures'; sentryTest('should not initialize when inside a Chrome browser extension', async ({ getLocalTestUrl, page }) => { - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const errorLogs: string[] = []; page.on('console', message => { diff --git a/dev-packages/browser-integration-tests/suites/metrics/metricsShim/test.ts b/dev-packages/browser-integration-tests/suites/metrics/metricsShim/test.ts index ba86f0a991f5..d95633393eda 100644 --- a/dev-packages/browser-integration-tests/suites/metrics/metricsShim/test.ts +++ b/dev-packages/browser-integration-tests/suites/metrics/metricsShim/test.ts @@ -22,7 +22,7 @@ sentryTest('exports shim metrics integration for non-tracing bundles', async ({ }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/metrics/timing/test.ts b/dev-packages/browser-integration-tests/suites/metrics/timing/test.ts index c6b369025c7a..215f042dcdf7 100644 --- a/dev-packages/browser-integration-tests/suites/metrics/timing/test.ts +++ b/dev-packages/browser-integration-tests/suites/metrics/timing/test.ts @@ -13,14 +13,6 @@ sentryTest('allows to wrap sync methods with a timing metric', async ({ getLocal sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const beforeTime = Math.floor(Date.now() / 1000); @@ -96,14 +88,6 @@ sentryTest('allows to wrap async methods with a timing metric', async ({ getLoca sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const beforeTime = Math.floor(Date.now() / 1000); diff --git a/dev-packages/browser-integration-tests/suites/replay/bufferModeManual/test.ts b/dev-packages/browser-integration-tests/suites/replay/bufferModeManual/test.ts index 4ac7b9ea9cf1..8d6d87e40d36 100644 --- a/dev-packages/browser-integration-tests/suites/replay/bufferModeManual/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/bufferModeManual/test.ts @@ -45,7 +45,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await page.locator('#go-background').click(); @@ -190,7 +190,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await page.locator('#go-background').click(); @@ -297,14 +297,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); @@ -359,14 +351,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); page.goto(url); @@ -440,7 +424,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); // Start buffering and assert that it is enabled diff --git a/dev-packages/browser-integration-tests/suites/replay/bufferModeReload/test.ts b/dev-packages/browser-integration-tests/suites/replay/bufferModeReload/test.ts index 79fc60497ccc..89c4f4d4f369 100644 --- a/dev-packages/browser-integration-tests/suites/replay/bufferModeReload/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/bufferModeReload/test.ts @@ -15,14 +15,6 @@ sentryTest('continues buffer session in session mode after error & reload', asyn const reqPromise1 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/test.ts b/dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/test.ts index 60a0864b71ee..affa6d2f90c5 100644 --- a/dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/test.ts @@ -13,14 +13,6 @@ sentryTest('can manually snapshot canvas', async ({ getLocalTestUrl, page, brows const reqPromise2 = waitForReplayRequest(page, 2); const reqPromise3 = waitForReplayRequest(page, 3); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/canvas/records/test.ts b/dev-packages/browser-integration-tests/suites/replay/canvas/records/test.ts index e2beb0afc2df..c6ba950978cd 100644 --- a/dev-packages/browser-integration-tests/suites/replay/canvas/records/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/canvas/records/test.ts @@ -12,14 +12,6 @@ sentryTest('can record canvas', async ({ getLocalTestUrl, page, browserName }) = const reqPromise1 = waitForReplayRequest(page, 1); const reqPromise2 = waitForReplayRequest(page, 2); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/test.ts b/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/test.ts index 104098eed2cf..514b22af6d5c 100644 --- a/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/test.ts @@ -10,14 +10,6 @@ sentryTest('sets up canvas when adding ReplayCanvas integration first', async ({ const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/test.ts b/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/test.ts index d25066dc065b..a36fc86bcdbe 100644 --- a/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/test.ts @@ -10,14 +10,6 @@ sentryTest('sets up canvas when adding ReplayCanvas integration after Replay', a const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/test.ts b/dev-packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/test.ts index af3ec4a4bc97..8eac849408a7 100644 --- a/dev-packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/test.ts @@ -8,14 +8,6 @@ sentryTest('does not setup up canvas without ReplayCanvas integration', async ({ sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/captureComponentName/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureComponentName/test.ts index 9ad1a99c32aa..29c400f4288d 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureComponentName/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureComponentName/test.ts @@ -10,14 +10,6 @@ sentryTest('captures component name attribute when available', async ({ forceFlu const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -95,14 +87,6 @@ sentryTest('sets element name to component name attribute', async ({ forceFlushR const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/captureConsoleLog/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureConsoleLog/test.ts index 8ea7d10bd158..b55b23c10f04 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureConsoleLog/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureConsoleLog/test.ts @@ -8,14 +8,6 @@ sentryTest('should capture console messages in replay', async ({ getLocalTestPat sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const reqPromise0 = waitForReplayRequest(page, 0); const url = await getLocalTestPath({ testDir: __dirname }); @@ -59,14 +51,6 @@ sentryTest('should capture very large console logs', async ({ getLocalTestPath, sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const reqPromise0 = waitForReplayRequest(page, 0); const url = await getLocalTestPath({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts index b2a7fa6dc3ac..b2cd4196643b 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureReplay/test.ts @@ -12,14 +12,6 @@ sentryTest('should capture replays (@sentry/browser export)', async ({ getLocalT const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts index 6267413ff84e..e9db4c92343c 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/test.ts @@ -12,14 +12,6 @@ sentryTest('should capture replays (@sentry-internal/replay export)', async ({ g const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/captureReplayOffline/test.ts b/dev-packages/browser-integration-tests/suites/replay/captureReplayOffline/test.ts index a74a2c891fad..f22abf0e3451 100644 --- a/dev-packages/browser-integration-tests/suites/replay/captureReplayOffline/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/captureReplayOffline/test.ts @@ -12,14 +12,6 @@ sentryTest('should capture replays offline', async ({ getLocalTestPath, page }) const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); // This would be the obvious way to test offline support but it doesn't appear to work! diff --git a/dev-packages/browser-integration-tests/suites/replay/compressionDisabled/test.ts b/dev-packages/browser-integration-tests/suites/replay/compressionDisabled/test.ts index 31ad7fc22991..a719bcd1d844 100644 --- a/dev-packages/browser-integration-tests/suites/replay/compressionDisabled/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/compressionDisabled/test.ts @@ -19,14 +19,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/compressionEnabled/test.ts b/dev-packages/browser-integration-tests/suites/replay/compressionEnabled/test.ts index a080b2de5bdf..753fe57a0c01 100644 --- a/dev-packages/browser-integration-tests/suites/replay/compressionEnabled/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/compressionEnabled/test.ts @@ -17,14 +17,6 @@ sentryTest('replay recording should be compressed by default', async ({ getLocal const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts b/dev-packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts index 0b34803e3b7a..0c5710c0dfb7 100644 --- a/dev-packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/compressionWorkerUrl/test.ts @@ -21,14 +21,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); let customCompressCalled = 0; diff --git a/dev-packages/browser-integration-tests/suites/replay/customEvents/test.ts b/dev-packages/browser-integration-tests/suites/replay/customEvents/test.ts index 053c31c3881e..5c93870d0937 100644 --- a/dev-packages/browser-integration-tests/suites/replay/customEvents/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/customEvents/test.ts @@ -33,14 +33,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -95,14 +87,6 @@ sentryTest( const reqPromise2 = waitForReplayRequest(page, 2); const reqPromise3 = waitForReplayRequest(page, 3); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -198,14 +182,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts b/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts index b6bb4da00abb..62961caef062 100644 --- a/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/dsc/test.ts @@ -120,14 +120,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -181,14 +173,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -229,14 +213,6 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({ const hasTracing = !shouldSkipTracingTest(); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/errorResponse/test.ts b/dev-packages/browser-integration-tests/suites/replay/errorResponse/test.ts index 67f1d1d12d6d..048ca898d892 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errorResponse/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errorResponse/test.ts @@ -22,7 +22,7 @@ sentryTest('should stop recording after receiving an error response', async ({ g }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await Promise.all([page.goto(url), waitForReplayRequest(page)]); await page.locator('button').click(); diff --git a/dev-packages/browser-integration-tests/suites/replay/errors/beforeErrorSampling/test.ts b/dev-packages/browser-integration-tests/suites/replay/errors/beforeErrorSampling/test.ts index cbb4826df195..71cea051ce94 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errors/beforeErrorSampling/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errors/beforeErrorSampling/test.ts @@ -11,14 +11,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/errors/droppedError/test.ts b/dev-packages/browser-integration-tests/suites/replay/errors/droppedError/test.ts index 04503ca52cb7..2ae046bf6c58 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errors/droppedError/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errors/droppedError/test.ts @@ -28,7 +28,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await forceFlushReplay(); diff --git a/dev-packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts b/dev-packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts index b2f7e067e969..8eeb544d06ef 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts @@ -48,7 +48,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await Promise.all([ page.goto(url), diff --git a/dev-packages/browser-integration-tests/suites/replay/errors/errorNotSent/test.ts b/dev-packages/browser-integration-tests/suites/replay/errors/errorNotSent/test.ts index c47f4bf4e105..123ec1609a04 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errors/errorNotSent/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errors/errorNotSent/test.ts @@ -21,7 +21,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await forceFlushReplay(); diff --git a/dev-packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts b/dev-packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts index 5fb1e7b4e340..bc9453f58135 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts @@ -37,7 +37,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); const req0 = await reqPromise0; @@ -94,14 +94,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/errors/immediateError/test.ts b/dev-packages/browser-integration-tests/suites/replay/errors/immediateError/test.ts index 7c82f29256d9..8ce1af848952 100644 --- a/dev-packages/browser-integration-tests/suites/replay/errors/immediateError/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/errors/immediateError/test.ts @@ -11,14 +11,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const req = waitForReplayRequest(page); const url = await getLocalTestUrl({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/suites/replay/eventBufferError/test.ts b/dev-packages/browser-integration-tests/suites/replay/eventBufferError/test.ts index a6924bdda3c9..0502cf8fdcc7 100644 --- a/dev-packages/browser-integration-tests/suites/replay/eventBufferError/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/eventBufferError/test.ts @@ -19,12 +19,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestBody/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestBody/test.ts index f8b48ffec598..b7fd02bc463c 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestBody/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestBody/test.ts @@ -21,14 +21,6 @@ sentryTest('captures text request body', async ({ getLocalTestUrl, page, browser }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -99,14 +91,6 @@ sentryTest('captures JSON request body', async ({ getLocalTestUrl, page, browser }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -177,14 +161,6 @@ sentryTest('captures non-text request body', async ({ getLocalTestUrl, page, bro }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -259,14 +235,6 @@ sentryTest('captures text request body when matching relative URL', async ({ get }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -335,14 +303,6 @@ sentryTest('does not capture request body when URL does not match', async ({ get }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestHeaders/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestHeaders/test.ts index f1952da08f0a..9bbd1f0c487e 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestHeaders/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestHeaders/test.ts @@ -21,12 +21,6 @@ sentryTest('handles empty/missing request headers', async ({ getLocalTestUrl, pa }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -92,14 +86,6 @@ sentryTest('captures request headers as POJO', async ({ getLocalTestUrl, page, b }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -179,12 +165,6 @@ sentryTest('captures request headers on Request', async ({ getLocalTestUrl, page }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -264,12 +244,6 @@ sentryTest('captures request headers as Headers instance', async ({ getLocalTest }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -347,14 +321,6 @@ sentryTest('does not captures request headers if URL does not match', async ({ g }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestSize/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestSize/test.ts index 4da3c7142996..2e7c22d29fbe 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestSize/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestSize/test.ts @@ -19,14 +19,6 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -104,14 +96,6 @@ sentryTest('captures request size from non-text request body', async ({ getLocal }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseBody/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseBody/test.ts index 7ce8ecb87748..1d727564a852 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseBody/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseBody/test.ts @@ -22,14 +22,6 @@ sentryTest('captures text response body', async ({ getLocalTestUrl, page, browse }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -102,14 +94,6 @@ sentryTest('captures JSON response body', async ({ getLocalTestUrl, page, browse }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -182,14 +166,6 @@ sentryTest('captures non-text response body', async ({ getLocalTestUrl, page, br }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -262,14 +238,6 @@ sentryTest.skip('does not capture response body when URL does not match', async }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts index ec4a26dd199f..7142a16dd174 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts @@ -21,14 +21,6 @@ sentryTest('handles empty headers', async ({ getLocalTestUrl, page, browserName }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -97,14 +89,6 @@ sentryTest('captures response headers', async ({ getLocalTestUrl, page }) => { }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); @@ -179,14 +163,6 @@ sentryTest('does not capture response headers if URL does not match', async ({ g }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts index 0191617d46da..805413f70884 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts @@ -26,14 +26,6 @@ sentryTest('captures response size from Content-Length header if available', asy }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { @@ -116,14 +108,6 @@ sentryTest('captures response size without Content-Length header', async ({ getL }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { @@ -203,14 +187,6 @@ sentryTest('captures response size from non-text response body', async ({ getLoc }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureTimestamps/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureTimestamps/test.ts index d77796f92fc2..e3acdb5dc6e0 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureTimestamps/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureTimestamps/test.ts @@ -34,7 +34,7 @@ sentryTest('captures correct timestamps', async ({ getLocalTestUrl, page, browse return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.fetch'); }); - const url = await getLocalTestUrl({ testDir: __dirname }); + const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await page.evaluate(() => { diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestBody/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestBody/test.ts index d12d74381fc2..7108bde5fc71 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestBody/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestBody/test.ts @@ -20,14 +20,6 @@ sentryTest('captures text request body', async ({ getLocalTestUrl, page, browser }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -100,14 +92,6 @@ sentryTest('captures JSON request body', async ({ getLocalTestUrl, page, browser }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -180,14 +164,6 @@ sentryTest('captures non-text request body', async ({ getLocalTestUrl, page, bro }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -264,14 +240,6 @@ sentryTest('captures text request body when matching relative URL', async ({ get }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -344,14 +312,6 @@ sentryTest('does not capture request body when URL does not match', async ({ get }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestHeaders/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestHeaders/test.ts index be6ac82d4b5c..8485a7078b38 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestHeaders/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestHeaders/test.ts @@ -20,14 +20,6 @@ sentryTest('captures request headers', async ({ getLocalTestUrl, page, browserNa }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -105,14 +97,6 @@ sentryTest('does not capture request headers if URL does not match', async ({ ge }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestSize/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestSize/test.ts index 73d063ea1b47..8f263b1d8349 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestSize/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureRequestSize/test.ts @@ -20,14 +20,6 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -110,14 +102,6 @@ sentryTest('captures request size from non-text request body', async ({ getLocal }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseBody/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseBody/test.ts index afa2c669f204..8975729b7c54 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseBody/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseBody/test.ts @@ -24,14 +24,6 @@ sentryTest('captures text response body', async ({ getLocalTestUrl, page, browse }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -108,14 +100,6 @@ sentryTest('captures JSON response body', async ({ getLocalTestUrl, page, browse }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -192,14 +176,6 @@ sentryTest('captures JSON response body when responseType=json', async ({ getLoc }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -278,14 +254,6 @@ sentryTest('captures non-text response body', async ({ getLocalTestUrl, page, br }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -362,14 +330,6 @@ sentryTest('does not capture response body when URL does not match', async ({ ge }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseHeaders/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseHeaders/test.ts index 4726f69c641d..68dcad0af664 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseHeaders/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseHeaders/test.ts @@ -27,14 +27,6 @@ sentryTest('captures response headers', async ({ getLocalTestUrl, page, browserN }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -117,14 +109,6 @@ sentryTest( }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseSize/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseSize/test.ts index dda9e4e642c1..6ffccfdbc47e 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseSize/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureResponseSize/test.ts @@ -25,14 +25,6 @@ sentryTest( }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -120,14 +112,6 @@ sentryTest('captures response size without Content-Length header', async ({ getL }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); @@ -212,14 +196,6 @@ sentryTest('captures response size for non-string bodies', async ({ getLocalTest }); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const requestPromise = waitForErrorRequest(page); const replayRequestPromise = collectReplayRequests(page, recordingEvents => { return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); diff --git a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureTimestamps/test.ts b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureTimestamps/test.ts index e89fa6e4a24e..19781d7312bb 100644 --- a/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureTimestamps/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/xhr/captureTimestamps/test.ts @@ -34,7 +34,7 @@ sentryTest('captures correct timestamps', async ({ getLocalTestUrl, page, browse return getReplayPerformanceSpans(recordingEvents).some(span => span.op === 'resource.xhr'); }); - const url = await getLocalTestUrl({ testDir: __dirname }); + const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); void page.evaluate(() => { diff --git a/dev-packages/browser-integration-tests/suites/replay/fileInput/test.ts b/dev-packages/browser-integration-tests/suites/replay/fileInput/test.ts index be8db2893a4f..153ec956fa4b 100644 --- a/dev-packages/browser-integration-tests/suites/replay/fileInput/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/fileInput/test.ts @@ -26,14 +26,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/flushing/test.ts b/dev-packages/browser-integration-tests/suites/replay/flushing/test.ts index 91308d7736c8..52d72fb9a58a 100644 --- a/dev-packages/browser-integration-tests/suites/replay/flushing/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/flushing/test.ts @@ -21,14 +21,6 @@ sentryTest('replay events are flushed after max flush delay was reached', async const reqPromise1 = waitForReplayRequest(page, 1); const reqPromise2 = waitForReplayRequest(page, 2); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/keyboardEvents/test.ts b/dev-packages/browser-integration-tests/suites/replay/keyboardEvents/test.ts index edeacb7f2db0..d23bfafea394 100644 --- a/dev-packages/browser-integration-tests/suites/replay/keyboardEvents/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/keyboardEvents/test.ts @@ -10,14 +10,6 @@ sentryTest('captures keyboard events', async ({ forceFlushReplay, getLocalTestPa const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts b/dev-packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts index 948c3bb4ea41..07f5362f4f7b 100644 --- a/dev-packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts @@ -10,14 +10,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); // We have to click in order to ensure the LCP is generated, leading to consistent results diff --git a/dev-packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts b/dev-packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts index 672190e2d0a0..d86617396cf6 100644 --- a/dev-packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts @@ -15,14 +15,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); // We have to click in order to ensure the LCP is generated, leading to consistent results diff --git a/dev-packages/browser-integration-tests/suites/replay/logger/test.ts b/dev-packages/browser-integration-tests/suites/replay/logger/test.ts index fa034a12b003..e194c80f05c4 100644 --- a/dev-packages/browser-integration-tests/suites/replay/logger/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/logger/test.ts @@ -15,14 +15,6 @@ sentryTest('should output logger messages', async ({ getLocalTestPath, page }) = messages.push(message.text()); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const reqPromise0 = waitForReplayRequest(page, 0); const url = await getLocalTestPath({ testDir: __dirname }); diff --git a/dev-packages/browser-integration-tests/suites/replay/maxReplayDuration/test.ts b/dev-packages/browser-integration-tests/suites/replay/maxReplayDuration/test.ts index a133f7ae77d9..538cc5f3aa20 100644 --- a/dev-packages/browser-integration-tests/suites/replay/maxReplayDuration/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/maxReplayDuration/test.ts @@ -11,14 +11,6 @@ sentryTest('keeps track of max duration across reloads', async ({ getLocalTestPa sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); diff --git a/dev-packages/browser-integration-tests/suites/replay/minReplayDuration/test.ts b/dev-packages/browser-integration-tests/suites/replay/minReplayDuration/test.ts index 1bdb0567de77..967de1ecfe0f 100644 --- a/dev-packages/browser-integration-tests/suites/replay/minReplayDuration/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/minReplayDuration/test.ts @@ -17,14 +17,6 @@ sentryTest('doest not send replay before min. duration', async ({ getLocalTestPa return true; }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts index 7bacf5a8ae17..3ee84086cc37 100644 --- a/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts @@ -37,14 +37,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); const reqPromise2 = waitForReplayRequest(page, 2); diff --git a/dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts b/dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts index 8b000b07e461..a6f40d884e8b 100644 --- a/dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/privacyBlock/test.ts @@ -15,14 +15,6 @@ sentryTest('should allow to manually block elements', async ({ getLocalTestPath, const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts b/dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts index 713431ca3063..75ba5d2831c6 100644 --- a/dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts @@ -15,14 +15,6 @@ sentryTest('should have the correct default privacy settings', async ({ getLocal const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/privacyInput/test.ts b/dev-packages/browser-integration-tests/suites/replay/privacyInput/test.ts index f2c506f90132..19dddd68ec0c 100644 --- a/dev-packages/browser-integration-tests/suites/replay/privacyInput/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/privacyInput/test.ts @@ -54,14 +54,6 @@ sentryTest( return inputMutationSegmentIds.length === 2 && inputMutationSegmentIds[1] < event.segment_id; }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -139,14 +131,6 @@ sentryTest( return check; }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts b/dev-packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts index 88bc531017d9..7d64cd839d22 100644 --- a/dev-packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts @@ -46,14 +46,6 @@ sentryTest( ); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -110,14 +102,6 @@ sentryTest( ); }); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/replayIntegrationShim/test.ts b/dev-packages/browser-integration-tests/suites/replay/replayIntegrationShim/test.ts index 952c841b253e..7eb84f7da310 100644 --- a/dev-packages/browser-integration-tests/suites/replay/replayIntegrationShim/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/replayIntegrationShim/test.ts @@ -24,7 +24,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await forceFlushReplay(); diff --git a/dev-packages/browser-integration-tests/suites/replay/replayShim/test.ts b/dev-packages/browser-integration-tests/suites/replay/replayShim/test.ts index b906deefb71b..8d3b7bab9aa0 100644 --- a/dev-packages/browser-integration-tests/suites/replay/replayShim/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/replayShim/test.ts @@ -24,7 +24,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await forceFlushReplay(); diff --git a/dev-packages/browser-integration-tests/suites/replay/requests/test.ts b/dev-packages/browser-integration-tests/suites/replay/requests/test.ts index a15665b357dc..eedfb5ae5fb2 100644 --- a/dev-packages/browser-integration-tests/suites/replay/requests/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/requests/test.ts @@ -10,14 +10,6 @@ sentryTest('replay recording should contain fetch request span', async ({ getLoc sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - await page.route('https://example.com', route => { return route.fulfill({ status: 200, @@ -48,14 +40,6 @@ sentryTest('replay recording should contain XHR request span', async ({ getLocal sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - await page.route('https://example.com', route => { return route.fulfill({ status: 200, diff --git a/dev-packages/browser-integration-tests/suites/replay/sampling/test.ts b/dev-packages/browser-integration-tests/suites/replay/sampling/test.ts index 92aa50ff3744..cc68be486749 100644 --- a/dev-packages/browser-integration-tests/suites/replay/sampling/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/sampling/test.ts @@ -19,7 +19,7 @@ sentryTest('should not send replays if both sample rates are 0', async ({ getLoc }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); await page.locator('button').click(); diff --git a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts b/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts index 05842705227e..49a95345fc43 100644 --- a/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts @@ -22,14 +22,6 @@ sentryTest('handles an expired session', async ({ browserName, forceFlushReplay, const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/sessionInactive/test.ts b/dev-packages/browser-integration-tests/suites/replay/sessionInactive/test.ts index 614f9a3d99d7..0ac765c3a969 100644 --- a/dev-packages/browser-integration-tests/suites/replay/sessionInactive/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/sessionInactive/test.ts @@ -23,14 +23,6 @@ sentryTest('handles an inactive session', async ({ getLocalTestPath, page, brows const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts b/dev-packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts index 0a253597f367..d658f407009c 100644 --- a/dev-packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts @@ -26,14 +26,6 @@ sentryTest('handles session that exceeds max age', async ({ forceFlushReplay, ge const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/clickTargets/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/clickTargets/test.ts index b5b8a5b24988..73910e1190e0 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/clickTargets/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/clickTargets/test.ts @@ -35,14 +35,6 @@ import { getCustomRecordingEvents, shouldSkipReplayTest, waitForReplayRequest } sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); @@ -91,14 +83,6 @@ import { getCustomRecordingEvents, shouldSkipReplayTest, waitForReplayRequest } sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/disable/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/disable/test.ts index c57b5d05b3f2..f5337f1feb63 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/disable/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/disable/test.ts @@ -8,14 +8,6 @@ sentryTest('does not capture slow click when slowClickTimeout === 0', async ({ g sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/error/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/error/test.ts index 570a633443d4..5d106fb9c0e9 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/error/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/error/test.ts @@ -13,14 +13,6 @@ sentryTest('slow click that triggers error is captured', async ({ getLocalTestUr sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); @@ -70,14 +62,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/ignore/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/ignore/test.ts index 9d6c49abc29d..1928bfcf2c2e 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/ignore/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/ignore/test.ts @@ -8,14 +8,6 @@ sentryTest('click is ignored on ignoreSelectors', async ({ getLocalTestUrl, page sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); @@ -58,14 +50,6 @@ sentryTest('click is ignored on div', async ({ getLocalTestUrl, page }) => { sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts index 16f3036a3cca..04ab9c059f34 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts @@ -13,14 +13,6 @@ sentryTest('captures multi click when not detecting slow click', async ({ getLoc sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); @@ -105,14 +97,6 @@ sentryTest('captures multiple multi clicks', async ({ getLocalTestUrl, page, for sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts index aafdced81505..1c5aab9f4183 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts @@ -8,14 +8,6 @@ sentryTest('mutation after threshold results in slow click', async ({ forceFlush sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const replayRequestPromise = waitForReplayRequest(page, 0); @@ -70,14 +62,6 @@ sentryTest('multiple clicks are counted', async ({ getLocalTestUrl, page }) => { sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const replayRequestPromise = waitForReplayRequest(page, 0); @@ -131,14 +115,6 @@ sentryTest('immediate mutation does not trigger slow click', async ({ forceFlush sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const replayRequestPromise = waitForReplayRequest(page, 0); @@ -198,14 +174,6 @@ sentryTest('inline click handler does not trigger slow click', async ({ forceFlu sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const replayRequestPromise = waitForReplayRequest(page, 0); @@ -250,14 +218,6 @@ sentryTest('mouseDown events are considered', async ({ getLocalTestUrl, page }) sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); const replayRequestPromise = waitForReplayRequest(page, 0); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/scroll/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/scroll/test.ts index a7101351061f..cb0e467de4f6 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/scroll/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/scroll/test.ts @@ -8,14 +8,6 @@ sentryTest('immediate scroll does not trigger slow click', async ({ getLocalTest sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); @@ -57,14 +49,6 @@ sentryTest('late scroll triggers slow click', async ({ getLocalTestUrl, page }) sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts index 8adf24302089..1bc8219d22ab 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts @@ -8,14 +8,6 @@ sentryTest('mutation after timeout results in slow click', async ({ getLocalTest sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); @@ -63,14 +55,6 @@ sentryTest('console.log results in slow click', async ({ getLocalTestUrl, page } sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]); diff --git a/dev-packages/browser-integration-tests/suites/replay/slowClick/windowOpen/test.ts b/dev-packages/browser-integration-tests/suites/replay/slowClick/windowOpen/test.ts index d68f27a5f45b..3a5187b0fc85 100644 --- a/dev-packages/browser-integration-tests/suites/replay/slowClick/windowOpen/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/slowClick/windowOpen/test.ts @@ -8,14 +8,6 @@ sentryTest('window.open() is considered for slow click', async ({ getLocalTestUr sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - await page.route('http://example.com/', route => { return route.fulfill({ status: 200, diff --git a/dev-packages/browser-integration-tests/suites/replay/throttleBreadcrumbs/test.ts b/dev-packages/browser-integration-tests/suites/replay/throttleBreadcrumbs/test.ts index 0eb0495eb1ea..62bfda2b0a8c 100644 --- a/dev-packages/browser-integration-tests/suites/replay/throttleBreadcrumbs/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/throttleBreadcrumbs/test.ts @@ -15,14 +15,6 @@ sentryTest( const reqPromise0 = waitForReplayRequest(page, 0); const reqPromise1 = waitForReplayRequest(page, 1); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/unicode/compressed/test.ts b/dev-packages/browser-integration-tests/suites/replay/unicode/compressed/test.ts index 741a702fbef9..fd8250fe86ad 100644 --- a/dev-packages/browser-integration-tests/suites/replay/unicode/compressed/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/unicode/compressed/test.ts @@ -15,14 +15,6 @@ sentryTest('replay should handle unicode characters', async ({ getLocalTestPath, const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/replay/unicode/uncompressed/test.ts b/dev-packages/browser-integration-tests/suites/replay/unicode/uncompressed/test.ts index 1ee9d73e5f57..782d44702c34 100644 --- a/dev-packages/browser-integration-tests/suites/replay/unicode/uncompressed/test.ts +++ b/dev-packages/browser-integration-tests/suites/replay/unicode/uncompressed/test.ts @@ -15,14 +15,6 @@ sentryTest('replay should handle unicode characters', async ({ getLocalTestPath, const reqPromise0 = waitForReplayRequest(page, 0); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts b/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts index 9d7b07f1cfd1..e140cf14ebea 100644 --- a/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts +++ b/dev-packages/browser-integration-tests/suites/sessions/initial-scope/test.ts @@ -21,14 +21,6 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestU await page.route('**/foo', (route: Route) => route.continue({ url })); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const initSession = await getFirstSentryEnvelopeRequest(page, url); await page.click('#navigate'); diff --git a/dev-packages/browser-integration-tests/suites/sessions/start-session/test.ts b/dev-packages/browser-integration-tests/suites/sessions/start-session/test.ts index 65f9eef8e9ae..6dffb1f85902 100644 --- a/dev-packages/browser-integration-tests/suites/sessions/start-session/test.ts +++ b/dev-packages/browser-integration-tests/suites/sessions/start-session/test.ts @@ -19,14 +19,6 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestU const url = await getLocalTestUrl({ testDir: __dirname }); await page.route('**/foo', (route: Route) => route.continue({ url })); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const initSession = await getFirstSentryEnvelopeRequest(page, url); await page.locator('#navigate').click(); diff --git a/dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/test.ts b/dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/test.ts index 65f9eef8e9ae..6dffb1f85902 100644 --- a/dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/test.ts +++ b/dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/test.ts @@ -19,14 +19,6 @@ sentryTest('should start a new session with navigation.', async ({ getLocalTestU const url = await getLocalTestUrl({ testDir: __dirname }); await page.route('**/foo', (route: Route) => route.continue({ url })); - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const initSession = await getFirstSentryEnvelopeRequest(page, url); await page.locator('#navigate').click(); diff --git a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegrationShim/test.ts b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegrationShim/test.ts index c52bf2a6b68c..b55a5fef4d98 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegrationShim/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegrationShim/test.ts @@ -24,7 +24,7 @@ sentryTest( }); }); - const url = await getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname, skipDsnRouteHandler: true }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/test.ts index 1b6bc5bc686d..1fee219c8e5b 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-late/test.ts @@ -16,14 +16,6 @@ sentryTest('should capture an INP click event span after pageload', async ({ bro sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/test.ts index a9d5191b5cf3..18be7b654140 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized-late/test.ts @@ -18,14 +18,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/test.ts index 87ba1fd8632c..bf5021250b42 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp-parametrized/test.ts @@ -17,14 +17,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/test.ts b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/test.ts index 594bd9904052..e42028f9dff1 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-inp/test.ts @@ -18,14 +18,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); @@ -109,14 +101,6 @@ sentryTest( sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestPath({ testDir: __dirname }); await page.goto(url); diff --git a/dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/navigation/test.ts b/dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/navigation/test.ts index 9d158ea5491e..b62923be0e9b 100644 --- a/dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/navigation/test.ts +++ b/dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/navigation/test.ts @@ -74,14 +74,6 @@ sentryTest('error after navigation has navigation traceId', async ({ getLocalTes sentryTest.skip(); } - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); - }); - const url = await getLocalTestUrl({ testDir: __dirname }); // ensure pageload transaction is finished diff --git a/dev-packages/browser-integration-tests/utils/fixtures.ts b/dev-packages/browser-integration-tests/utils/fixtures.ts index e154ddc25988..9455e8c8626c 100644 --- a/dev-packages/browser-integration-tests/utils/fixtures.ts +++ b/dev-packages/browser-integration-tests/utils/fixtures.ts @@ -31,8 +31,12 @@ const getAsset = (assetDir: string, asset: string): string => { export type TestFixtures = { _autoSnapshotSuffix: void; testDir: string; - getLocalTestPath: (options: { testDir: string }) => Promise; - getLocalTestUrl: (options: { testDir: string; skipRouteHandler?: boolean }) => Promise; + getLocalTestPath: (options: { testDir: string; skipDsnRouteHandler?: boolean }) => Promise; + getLocalTestUrl: (options: { + testDir: string; + skipRouteHandler?: boolean; + skipDsnRouteHandler?: boolean; + }) => Promise; forceFlushReplay: () => Promise; enableConsole: () => void; runInChromium: (fn: (...args: unknown[]) => unknown, args?: unknown[]) => unknown; @@ -55,7 +59,7 @@ const sentryTest = base.extend({ ], getLocalTestUrl: ({ page }, use) => { - return use(async ({ testDir, skipRouteHandler = false }) => { + return use(async ({ testDir, skipRouteHandler = false, skipDsnRouteHandler = false }) => { const pagePath = `${TEST_HOST}/index.html`; const tmpDir = path.join(testDir, 'dist', crypto.randomUUID()); @@ -68,6 +72,16 @@ const sentryTest = base.extend({ return tmpDir; } + if (!skipDsnRouteHandler) { + await page.route('https://dsn.ingest.sentry.io/**/*', route => { + return route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ id: 'test-id' }), + }); + }); + } + await page.route(`${TEST_HOST}/*.*`, route => { const file = route.request().url().split('/').pop(); const filePath = path.resolve(tmpDir, `./${file}`); @@ -96,13 +110,23 @@ const sentryTest = base.extend({ }); }, - getLocalTestPath: ({}, use) => { - return use(async ({ testDir }) => { + getLocalTestPath: ({ page }, use) => { + return use(async ({ testDir, skipDsnRouteHandler }) => { const tmpDir = path.join(testDir, 'dist', crypto.randomUUID()); const pagePath = `file:///${path.resolve(tmpDir, './index.html')}`; await build(testDir, tmpDir); + if (!skipDsnRouteHandler) { + await page.route('https://dsn.ingest.sentry.io/**/*', route => { + return route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ id: 'test-id' }), + }); + }); + } + return pagePath; }); },