Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sentryTest('it does not download the SDK if the SDK was loaded in the meanwhile'
let cdnLoadedCount = 0;
let sentryEventCount = 0;

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
sentryEventCount++;

return route.fulfill({
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@babel/core": "^7.27.7",
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/rrweb": "2.34.0",
"@sentry/browser": "10.30.0",
"@supabase/supabase-js": "2.49.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Basic test with eviction, update, and no async tasks', async ({ getL
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest("Feature flags are added to active span's attributes on span end.", a
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('GrowthBook onError: basic eviction/update and no async tasks', async
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ id: 'test-id' }) });
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('GrowthBook onError: forked scopes are isolated', async ({ getLocalTe
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ id: 'test-id' }) });
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sentryTest(
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({}) });
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Basic test with eviction, update, and no async tasks', async ({ getL
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest("Feature flags are added to active span's attributes on span end.", a
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Basic test with eviction, update, and no async tasks', async ({ getL
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Flag evaluation error hook', async ({ getLocalTestUrl, page }) => {
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest("Feature flags are added to active span's attributes on span end.", a
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Basic test with eviction, update, and no async tasks', async ({ getL
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest("Feature flags are added to active span's attributes on span end.", a
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sentryTest('Logs and returns if isEnabled does not match expected signature', as
const bundleKey = process.env.PW_BUNDLE || '';
const hasDebug = !bundleKey.includes('_min');

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Basic test with eviction, update, and no async tasks', async ({ getL
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('Flag evaluations in forked scopes are stored separately.', async ({
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest("Feature flags are added to active span's attributes on span end.", a
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
return route.fulfill({
status: 200,
contentType: 'application/json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '../../../../utils/helpers';

async function mockSupabaseAuthRoutesSuccess(page: Page) {
await page.route('**/auth/v1/token?grant_type=password**', route => {
await page.route(/\/auth\/v1\/token\?grant_type=password/, route => {
return route.fulfill({
status: 200,
body: JSON.stringify({
Expand Down Expand Up @@ -38,7 +38,7 @@ async function mockSupabaseAuthRoutesSuccess(page: Page) {
}

async function mockSupabaseAuthRoutesFailure(page: Page) {
await page.route('**/auth/v1/token?grant_type=password**', route => {
await page.route(/\/auth\/v1\/token\?grant_type=password/, route => {
return route.fulfill({
status: 400,
body: JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sentryTest(
const reqPromise1 = waitForReplayRequest(page, 1);
const reqErrorPromise = waitForErrorRequest(page);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const event = envelopeRequestParser(route.request());
// error events have no type field
if (event && !event.type && event.event_id) {
Expand Down Expand Up @@ -171,7 +171,7 @@ sentryTest(
const reqPromise0 = waitForReplayRequest(page, 0);
const reqErrorPromise = waitForErrorRequest(page);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const event = envelopeRequestParser(route.request());
// error events have no type field
if (event && !event.type && event.event_id) {
Expand Down Expand Up @@ -405,7 +405,7 @@ sentryTest(
const reqPromise0 = waitForReplayRequest(page, 0);
const reqErrorPromise0 = waitForErrorRequest(page);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const event = envelopeRequestParser(route.request());
// error events have no type field
if (event && !event.type && event.event_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sentryTest(

const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });

await page.route('https://dsn.ingest.sentry.io/**/*', async route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, async route => {
const event = envelopeRequestParser(route.request());

// Track error events
Expand Down Expand Up @@ -106,7 +106,7 @@ sentryTest('buffer mode remains after interrupting replay flush', async ({ getLo

const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });

await page.route('https://dsn.ingest.sentry.io/**/*', async route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, async route => {
const event = envelopeRequestParser(route.request());

// Track error events
Expand Down Expand Up @@ -186,7 +186,7 @@ sentryTest(

const url = await getLocalTestUrl({ testDir: __dirname, skipDsnRouteHandler: true });

await page.route('https://dsn.ingest.sentry.io/**/*', async route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, async route => {
const event = envelopeRequestParser(route.request());

// Track error events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sentryTest('should stop recording after receiving an error response', async ({ g
}
let called = 0;

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
called++;

return route.fulfill({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest(

let callsToSentry = 0;

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const req = route.request();
const event = envelopeRequestParser(req);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sentryTest(
const reqPromise2 = waitForReplayRequest(page, 2);
const reqErrorPromise = waitForErrorRequest(page);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const event = envelopeRequestParser(route.request());
// error events have no type field
if (event && !event.type && event.event_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sentryTest(

let callsToSentry = 0;

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
callsToSentry++;

return route.fulfill({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sentryTest(
const reqPromise0 = waitForReplayRequest(page, 0);
const reqPromise1 = waitForReplayRequest(page, 1);

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const event = envelopeRequestParser(route.request());
// error events have no type field
if (event && !event.type && event.event_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sentryTest(

let called = 0;

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
const event = envelopeRequestParser(route.request());

// We only want to count replays here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sentryTest('captures correct timestamps', async ({ getLocalTestUrl, page, browse
});
});

await page.route('https://dsn.ingest.sentry.io/**/*', async route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, async route => {
await new Promise(resolve => setTimeout(resolve, 10));
return route.fulfill({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sentryTest('captures correct timestamps', async ({ getLocalTestUrl, page, browse
});
});

await page.route('https://dsn.ingest.sentry.io/**/*', async route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, async route => {
await new Promise(resolve => setTimeout(resolve, 10));
return route.fulfill({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest(
page.on('console', msg => consoleMessages.push(msg.text()));

let requestCount = 0;
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
requestCount++;
return route.fulfill({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest(
page.on('console', msg => consoleMessages.push(msg.text()));

let requestCount = 0;
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
requestCount++;
return route.fulfill({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sentryTest('should not send replays if both sample rates are 0', async ({ getLoc
sentryTest.skip();
}

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
// This should never be called!
expect(true).toBe(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ sentryTest('should start a new session on pageload.', async ({ getLocalTestUrl,
sentryTest('should start a new session with navigation.', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

// Route must be set up before any navigation to avoid race conditions
await page.route('**/foo', (route: Route) => route.continue({ url }));

const initSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);

await page.click('#navigate');
await page.locator('#navigate').click();

const newSession = await getFirstSentryEnvelopeRequest<SessionContext>(page, url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sentryTest(
page.on('console', msg => consoleMessages.push(msg.text()));

let requestCount = 0;
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
await page.route(/^https:\/\/dsn\.ingest\.sentry\.io\//, route => {
requestCount++;
return route.fulfill({
status: 200,
Expand Down
Loading