Skip to content
Draft
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
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 @@ -58,7 +58,7 @@
"dependencies": {
"@babel/core": "^7.29.6",
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry/rrweb": "2.43.2",
"@sentry/browser": "10.67.0",
"@sentry/replay": "10.67.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
'http.request.same_origin': false,
'url.scheme': 'https',
'url.full': 'https://sentry-test-site.example/path/to/image.svg',
// WebKit reports `deliveryType` as of Playwright 1.63's build, but still no response status
// or render blocking status.
'http.response_delivery_type': '',
...(!isWebkitRun && {
'http.response.status_code': expect.any(Number),
'resource.render_blocking_status': 'non-blocking',
'http.response_delivery_type': '',
}),
},
description: 'https://sentry-test-site.example/path/to/image.svg',
Expand All @@ -119,10 +121,11 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
trace_id: traceId,
});

// range check: TTFB must be >0 (at least in this case) and it's reasonable to
// assume <10 seconds. This also tests that we're reporting TTFB in seconds.
// range check: TTFB is reasonably <10 seconds, which is really a check that we report it in
// seconds rather than milliseconds. WebKit resolves these intercepted routes without measurable
// delay, so only the other engines are held to a non-zero value.
const imgSpanTtfb = imgSpan?.data['http.request.time_to_first_byte'];
expect(imgSpanTtfb).toBeGreaterThan(0);
expect(imgSpanTtfb).toBeGreaterThan(isWebkitRun ? -1 : 0);
expect(imgSpanTtfb).toBeLessThan(10);

expect(linkSpan).toEqual({
Expand Down Expand Up @@ -152,10 +155,12 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
'http.request.same_origin': false,
'url.scheme': 'https',
'url.full': 'https://sentry-test-site.example/path/to/style.css',
// WebKit reports `deliveryType` as of Playwright 1.63's build, but still no response status
// or render blocking status.
'http.response_delivery_type': '',
...(!isWebkitRun && {
'http.response.status_code': expect.any(Number),
'resource.render_blocking_status': 'non-blocking',
'http.response_delivery_type': '',
}),
},
description: 'https://sentry-test-site.example/path/to/style.css',
Expand Down Expand Up @@ -196,10 +201,12 @@ sentryTest('adds resource spans to pageload transaction', async ({ getLocalTestU
'http.request.same_origin': false,
'url.scheme': 'https',
'url.full': 'https://sentry-test-site.example/path/to/script.js',
// WebKit reports `deliveryType` as of Playwright 1.63's build, but still no response status
// or render blocking status.
'http.response_delivery_type': '',
...(!isWebkitRun && {
'http.response.status_code': expect.any(Number),
'resource.render_blocking_status': 'non-blocking',
'http.response_delivery_type': '',
}),
},
description: 'https://sentry-test-site.example/path/to/script.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { simulateCLS } from '../../../../utils/web-vitals/cls.ts';
// Getting expected CLS parameter from URL hash
const expectedCLS = Number(location.hash.slice(1));

simulateCLS(expectedCLS).then(
// Triggering reload to make sure getCLS has its closure before we send the transaction
() => location.reload(),
);
// CLS lands on the pageload span when it ends on the idle timeout, so nothing has to force the
// page away to finalize it. Reloading here used to do that, but it raced the envelope: on a fast
// browser the reload cancelled the in-flight send before it left the page.
simulateCLS(expectedCLS);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import { hidePage, shouldSkipTracingTest } from '../../../../utils/helpers';
import { shouldSkipTracingTest } from '../../../../utils/helpers';
import { getSpanOp, waitForStreamedSpan } from '../../../../utils/spanUtils';

sentryTest.beforeEach(async ({ browserName, page }) => {
Expand Down Expand Up @@ -30,7 +30,10 @@ sentryTest('captures LCP as a streamed span with element attributes', async ({ g
// Wait for LCP to be captured
await page.waitForTimeout(1000);

await hidePage(page);
// LCP finalizes on the first trusted input or visibility change, and web-vitals checks
// `isTrusted`, so a synthetically dispatched `visibilitychange` does not finalize it. Click to
// finalize the way a real user would.
await page.click('body');

const lcpSpan = await lcpSpanPromise;
const pageloadSpan = await pageloadSpanPromise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import path from 'path';
import { sentryTest } from '../../../utils/fixtures';
import { shouldSkipWASMTests } from '../../../utils/wasmHelpers';

function serveWasmFixture(page: Page): Promise<void> {
return page.route('**/simple.wasm', (route: Route) => {
async function serveWasmFixture(page: Page): Promise<void> {
// `page.route` resolves with a `Disposable` as of Playwright 1.63, so it can't be returned directly.
await page.route('**/simple.wasm', (route: Route) => {
const wasmModule = fs.readFileSync(path.resolve(__dirname, '..', 'simple.wasm'));

return route.fulfill({
Expand Down
15 changes: 15 additions & 0 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,21 @@ export async function getFirstSentryEnvelopeRequest<T>(
}

export async function hidePage(page: Page): Promise<void> {
// web-vitals defers processing an interaction's event entries into
// `requestIdleCallback(..., { timeout: 1000 })`, and Chromium only reaches idle here once that
// timeout elapses. Hiding the page first forces a report while the metric is still unset, so no
// vital is emitted at all. Idle callbacks run in scheduling order, so waiting for one queued now
// means web-vitals' earlier callback has already run.
await page.evaluate(() => {
return new Promise<void>(resolve => {
if (typeof requestIdleCallback !== 'function') {
resolve();
return;
}
requestIdleCallback(() => resolve(), { timeout: 1000 });
});
});

await page.evaluate(() => {
Object.defineProperty(document, 'visibilityState', {
configurable: true,
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.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@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.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@angular-devkit/build-angular": "^18.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@angular-devkit/build-angular": "^19.0.0",
"@angular/cli": "^19.0.0",
"@angular/compiler-cli": "^19.0.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@types/jasmine": "~5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@angular-devkit/build-angular": "^20.0.0",
"@angular/cli": "^20.0.0",
"@angular/compiler-cli": "^20.0.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@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.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@types/jasmine": "~5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular/build": "^22.0.0",
"@angular/cli": "^22.0.0",
"@angular/compiler-cli": "^22.0.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/core": "file:../../packed/sentry-core-packed.tgz",
"@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.56.0",
"@playwright/test": "~1.63.0",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"@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,7 @@
},
"dependencies": {
"@astrojs/cloudflare": "^12.6.12",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz",
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.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"astro": "^5.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@astrojs/cloudflare": "^13.0.2",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^10.0.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"astro": "^6.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"//": "Need to use ioredis 5.10.1 because that's the last version before they support tracing channels",
"dependencies": {
"@astrojs/node": "^11.1.4",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"astro": "^7.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"//": "Need to use ioredis 5.10.1 because that's the last version before they support tracing channels",
"dependencies": {
"@astrojs/node": "^11.1.4",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/astro": "file:../../packed/sentry-astro-packed.tgz",
"astro": "^7.2.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/aws-serverless": "link:../../../../packages/aws-serverless/build/aws/dist-serverless/",
"aws-cdk-lib": "^2.210.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@aws-sdk/client-lambda": "^3.863.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@sentry/aws-serverless": "file:../../packed/sentry-aws-serverless-packed.tgz",
"aws-cdk-lib": "^2.210.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@sentry/browser": "file:../../packed/sentry-browser-packed.tgz"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "~5.8.3",
"vite": "^7.3.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:assert": "pnpm test"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"concurrently": "^8.2.2"
},
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.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "~5.8.3",
"vite": "^7.3.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"mysql": "2.18.1"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"bun-types": "^1.2.9"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"workers-ai-provider": "^3.3.1"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/vite-plugin": "^1.47.0",
"@cloudflare/workers-types": "^5.20260727.1",
"@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 @@
"@babel/plugin-proposal-decorators": "^8.0.2",
"@cloudflare/vite-plugin": "^1.47.0",
"@cloudflare/workers-types": "^5.20260727.1",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@types/node": "^26.1.2",
"@types/ws": "^8.18.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/workers-types": "^4.20240725.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20260426.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^6.0.3",
"wrangler": "^4.86.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240725.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
"wrangler": "^4.61.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.35.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/workers-types": "^4.20260629.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@types/node": "^24.12.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@cloudflare/vite-plugin": "1.52.0",
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/workers-types": "^4.20260426.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/workers-types": "^4.20240725.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/workers-types": "^4.20260303.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@playwright/test": "~1.63.0",
"@cloudflare/workers-types": "^4.20240725.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"typescript": "^5.5.2",
Expand Down
Loading
Loading