Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test optimizations
  • Loading branch information
Lms24 committed Dec 18, 2025
commit 7911a2f3833f2a247cbfbe77c9d15b594bc035f3
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { expect } from '@playwright/test';
import type { LogEnvelope } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';
import {
getFirstSentryEnvelopeRequest,
properFullEnvelopeRequestParser,
testingCdnBundle,
} from '../../../../utils/helpers';

sentryTest('should capture console object calls', async ({ getLocalTestUrl, page }) => {
const bundle = process.env.PW_BUNDLE || '';
// Only run this for npm package exports
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
sentryTest.skip();
}
sentryTest.skip(testingCdnBundle());

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { expect } from '@playwright/test';
import type { LogEnvelope } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';
import {
getFirstSentryEnvelopeRequest,
properFullEnvelopeRequestParser,
testingCdnBundle,
} from '../../../../utils/helpers';

sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page }) => {
const bundle = process.env.PW_BUNDLE || '';
// Only run this for npm package exports
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
sentryTest.skip();
}
sentryTest.skip(testingCdnBundle());

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { expect } from '@playwright/test';
import type { LogEnvelope } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';
import {
getFirstSentryEnvelopeRequest,
properFullEnvelopeRequestParser,
testingCdnBundle,
} from '../../../../utils/helpers';

sentryTest('should capture all logging methods', async ({ getLocalTestUrl, page }) => {
const bundle = process.env.PW_BUNDLE || '';
// Only run this for npm package exports
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
sentryTest.skip();
}
sentryTest.skip(testingCdnBundle());

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

Expand Down
8 changes: 8 additions & 0 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ export function shouldSkipTracingTest(): boolean {
return bundle != null && !bundle.includes('tracing') && !bundle.includes('esm') && !bundle.includes('cjs');
}

/**
* @returns `true` if we are testing a CDN bundle
*/
export function testingCdnBundle(): boolean {
const bundle = process.env.PW_BUNDLE;
return bundle != null && (bundle.startsWith('bundle') || bundle.startsWith('loader'));
}

/**
* Today we always run feedback tests, but this can be used to guard this if we ever need to.
*/
Expand Down