Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
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.29.0",
"@supabase/supabase-js": "2.49.3",
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 @@ -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
16 changes: 14 additions & 2 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ export const countEnvelopes = async (
});

if (options?.url) {
await page.goto(options.url);
// Retry navigation once if it fails due to route handler timing issues
try {
await page.goto(options.url);
} catch (e) {
// Retry once for flaky navigation errors (e.g., route handler not ready in time)
await page.goto(options.url);
}
}

return countPromise;
Expand Down Expand Up @@ -404,7 +410,13 @@ async function getMultipleRequests<T>(
});

if (options?.url) {
await page.goto(options.url);
// Retry navigation once if it fails due to route handler timing issues
try {
await page.goto(options.url);
} catch (e) {
// Retry once for flaky navigation errors (e.g., route handler not ready in time)
await page.goto(options.url);
}
}

return requests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"zone.js": "~0.14.3"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "latest || *",
"@angular-devkit/build-angular": "^17.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"zone.js": "~0.14.3"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "latest || *",
"@angular-devkit/build-angular": "^18.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@angular-devkit/build-angular": "^19.0.0",
"@angular/cli": "^19.0.0",
"@angular/compiler-cli": "^19.0.0",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "latest || *",
"@types/jasmine": "~5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular-devkit/build-angular": "^20.0.0",
"@angular/cli": "^20.0.0",
"@angular/compiler-cli": "^20.0.0",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "latest || *",
"@types/jasmine": "~5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular-devkit/build-angular": "^21.0.0",
"@angular/cli": "^21.0.0",
"@angular/compiler-cli": "^21.0.0",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "latest || *",
"@types/jasmine": "~5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/check": "0.9.2",
"@astrojs/node": "8.3.4",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry/astro": "* || latest",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@spotlightjs/astro": "2.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ test.describe('server-side errors', () => {
return transactionEvent.transaction === 'GET /ssr-error';
});

await page.goto('/ssr-error');
// This page returns an error status code, so we need to catch the navigation error
await page.goto('/ssr-error').catch(() => {
// Expected to fail with net::ERR_HTTP_RESPONSE_CODE_FAILURE in newer Chromium versions
});

Comment on lines +14 to 18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: does playwright throw for requests with errors now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a Chromium behavior change in version 141 (bundled with Playwright 1.56). When navigating to a page that returns an HTTP error status code (4xx/5xx), Chromium now throws net::ERR_HTTP_RESPONSE_CODE_FAILURE.

This affects tests that intentionally navigate to error pages. The workaround is to catch the navigation error since we're testing the error handling behavior, not the navigation itself.

You can also use page.goto(url, { failOnStatusCode: false }) to suppress the error, but .catch() is more explicit about what's expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for explaining. .catch sounds good to me then.

const errorEvent = await errorEventPromise;
const transactionEvent = await transactionEventPromise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@astrojs/internal-helpers": "^0.4.2",
"@astrojs/node": "^9.0.0",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "latest || *",
"astro": "^5.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ test.describe('server-side errors', () => {
return transactionEvent.transaction === 'GET /ssr-error';
});

await page.goto('/ssr-error');
// This page returns an error status code, so we need to catch the navigation error
await page.goto('/ssr-error').catch(() => {
// Expected to fail with net::ERR_HTTP_RESPONSE_CODE_FAILURE in newer Chromium versions
});

const errorEvent = await errorEventPromise;
const transactionEvent = await transactionEventPromise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"//": "We just need the @sentry/aws-serverless layer zip file, not the NPM package",
"devDependencies": {
"@aws-sdk/client-lambda": "^3.863.0",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/aws-serverless": "link:../../../../packages/aws-serverless/build/aws/dist-serverless/",
"@types/tmp": "^0.2.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:assert": "pnpm test"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "~5.8.3",
"vite": "^7.0.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.8.19",
"@cloudflare/workers-types": "^4.20240725.0",
"@playwright/test": "~1.50.0",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
"vitest": "~3.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@sentry/cloudflare": "latest || *"
},
"devDependencies": {
"@playwright/test": "~1.50.0",
"@playwright/test": "~1.56.0",
"@cloudflare/vitest-pool-workers": "^0.8.19",
"@cloudflare/workers-types": "^4.20240725.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"typescript": "~5.0.0"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils"
},
"volta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@remix-run/dev": "^2.7.2",
"@types/compression": "^1.7.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"source-map-support": "^0.5.21"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@remix-run/dev": "^2.7.2",
"@types/compression": "^1.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@remix-run/dev": "2.7.2",
"@remix-run/eslint-config": "2.7.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@remix-run/dev": "2.16.7",
"@remix-run/eslint-config": "2.16.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
]
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"webpack": "^5.91.0",
"serve": "14.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@ember/optional-features": "~2.0.0",
"@glimmer/component": "~1.1.2",
"@glimmer/tracking": "~1.1.2",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@ember/string": "~3.1.1",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/ember": "latest || *",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"loader.js": "^4.7.0",
"tracked-built-ins": "^3.3.0",
"webpack": "^5.91.0",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry/ember": "latest || *",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@tsconfig/ember": "^3.0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.2",
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@react-router/dev": "7.9.6",
"@react-router/fs-routes": "7.9.6",
"@sentry-internal/test-utils": "link:../../../test-utils",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^11.0.0",
"@nestjs/schematics": "^11.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"fastify": "^4.28.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"typescript": "~5.0.0"
},
"devDependencies": {
"@playwright/test": "~1.53.2",
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils"
},
"volta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ test('should create a pageload transaction with correct name when an error occur
);
});

await page.goto(`/something/error-getServerSideProps`, { waitUntil: 'networkidle' });
// This page returns an error status code, so we need to catch the navigation error
await page.goto(`/something/error-getServerSideProps`, { waitUntil: 'networkidle' }).catch(() => {
// Expected to fail with net::ERR_HTTP_RESPONSE_CODE_FAILURE in newer Chromium versions
});

const transaction = await transactionPromise;

Expand Down
Loading
Loading