File tree Expand file tree Collapse file tree 6 files changed +27
-15
lines changed
dev-packages/browser-integration-tests
web-vitals/web-vitals-ttfb Expand file tree Collapse file tree 6 files changed +27
-15
lines changed Original file line number Diff line number Diff line change 11import { expect } from '@playwright/test' ;
22import { sentryTest } from '../../../utils/fixtures' ;
3- import { shouldSkipTracingTest } from '../../../utils/helpers' ;
3+ import { shouldSkipTracingTest , testingCdnBundle } from '../../../utils/helpers' ;
44import { getSpanOp , waitForV2Spans } from '../../../utils/spanFirstUtils' ;
55
66sentryTest ( 'ends pageload span when the page goes to background' , async ( { getLocalTestUrl, page } ) => {
7- if ( shouldSkipTracingTest ( ) ) {
7+ // for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
8+ if ( shouldSkipTracingTest ( ) || testingCdnBundle ( ) ) {
89 sentryTest . skip ( ) ;
910 }
11+
1012 const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
1113
1214 const spanPromise = waitForV2Spans ( page , spans => ! ! spans . find ( span => getSpanOp ( span ) === 'pageload' ) ) ;
Original file line number Diff line number Diff line change @@ -5,19 +5,17 @@ import {
55 envelopeRequestParser ,
66 runScriptInSandbox ,
77 shouldSkipTracingTest ,
8+ testingCdnBundle ,
89 waitForErrorRequest ,
910} from '../../../utils/helpers' ;
1011import { getSpanOp , waitForV2Spans } from '../../../utils/spanFirstUtils' ;
1112
1213sentryTest (
1314 'puts the pageload span name onto an error event caught during pageload' ,
1415 async ( { getLocalTestUrl, page, browserName } ) => {
15- if ( browserName === 'webkit' ) {
16- // This test fails on Webkit as errors thrown from `runScriptInSandbox` are Script Errors and skipped by Sentry
17- sentryTest . skip ( ) ;
18- }
19-
20- if ( shouldSkipTracingTest ( ) ) {
16+ // for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
17+ // This test fails on Webkit as errors thrown from `runScriptInSandbox` are Script Errors and skipped by Sentry
18+ if ( shouldSkipTracingTest ( ) || testingCdnBundle ( ) || browserName === 'webkit' ) {
2119 sentryTest . skip ( ) ;
2220 }
2321
Original file line number Diff line number Diff line change 11import { expect } from '@playwright/test' ;
22import { SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE } from '@sentry/core' ;
33import { sentryTest } from '../../../utils/fixtures' ;
4- import { shouldSkipTracingTest } from '../../../utils/helpers' ;
4+ import { shouldSkipTracingTest , testingCdnBundle } from '../../../utils/helpers' ;
55import { getSpanOp , waitForV2Spans } from '../../../utils/spanFirstUtils' ;
66
77sentryTest ( "navigation spans link back to previous trace's root span" , async ( { getLocalTestUrl, page } ) => {
8- if ( shouldSkipTracingTest ( ) ) {
8+ // for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
9+ if ( shouldSkipTracingTest ( ) || testingCdnBundle ( ) ) {
910 sentryTest . skip ( ) ;
1011 }
1112
@@ -77,7 +78,8 @@ sentryTest("navigation spans link back to previous trace's root span", async ({
7778} ) ;
7879
7980sentryTest ( "doesn't link between hard page reloads by default" , async ( { getLocalTestUrl, page } ) => {
80- if ( shouldSkipTracingTest ( ) ) {
81+ // for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
82+ if ( shouldSkipTracingTest ( ) || testingCdnBundle ( ) ) {
8183 sentryTest . skip ( ) ;
8284 }
8385
Original file line number Diff line number Diff line change 11import { expect } from '@playwright/test' ;
22import { sentryTest } from '../../../utils/fixtures' ;
3- import { shouldSkipTracingTest } from '../../../utils/helpers' ;
3+ import { shouldSkipTracingTest , testingCdnBundle } from '../../../utils/helpers' ;
44import { getSpanOp , waitForSpanV2Envelope } from '../../../utils/spanFirstUtils' ;
55
66sentryTest ( 'sends a span v2 envelope for the pageload' , async ( { getLocalTestUrl, page } ) => {
7- if ( shouldSkipTracingTest ( ) ) {
7+ // for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
8+ if ( shouldSkipTracingTest ( ) || testingCdnBundle ( ) ) {
89 sentryTest . skip ( ) ;
910 }
1011
Original file line number Diff line number Diff line change 11import { expect } from '@playwright/test' ;
22import { sentryTest } from '../../../../utils/fixtures' ;
3- import { shouldSkipTracingTest } from '../../../../utils/helpers' ;
3+ import { shouldSkipTracingTest , testingCdnBundle } from '../../../../utils/helpers' ;
44import { getSpanOp , waitForV2Spans } from '../../../../utils/spanFirstUtils' ;
55
66sentryTest ( 'captures TTFB web vital' , async ( { getLocalTestUrl, page } ) => {
7- if ( shouldSkipTracingTest ( ) ) {
7+ // for now, spanStreamingIntegration is only exported in the NPM package, so we skip the test for bundles.
8+ if ( shouldSkipTracingTest ( ) || testingCdnBundle ( ) ) {
89 sentryTest . skip ( ) ;
910 }
1011 const pageloadSpansPromise = waitForV2Spans ( page , spans => ! ! spans . find ( span => getSpanOp ( span ) === 'pageload' ) ) ;
Original file line number Diff line number Diff line change @@ -314,6 +314,14 @@ export function shouldSkipTracingTest(): boolean {
314314 return bundle != null && ! bundle . includes ( 'tracing' ) && ! bundle . includes ( 'esm' ) && ! bundle . includes ( 'cjs' ) ;
315315}
316316
317+ /**
318+ * @returns `true` if we are testing a CDN bundle
319+ */
320+ export function testingCdnBundle ( ) : boolean {
321+ const bundle = process . env . PW_BUNDLE ;
322+ return bundle != null ;
323+ }
324+
317325/**
318326 * Today we always run feedback tests, but this can be used to guard this if we ever need to.
319327 */
You can’t perform that action at this time.
0 commit comments