Skip to content

Commit 79c4777

Browse files
committed
fix test ??
1 parent 823f30f commit 79c4777

File tree

1 file changed

+9
-5
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageloadWithChildSpanTimeout

1 file changed

+9
-5
lines changed

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageloadWithChildSpanTimeout/test.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
32

43
import { sentryTest } from '../../../../utils/fixtures';
5-
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
4+
import {
5+
envelopeRequestParser,
6+
shouldSkipTracingTest,
7+
waitForTransactionRequestOnUrl,
8+
} from '../../../../utils/helpers';
69

710
// This tests asserts that the pageload span will finish itself after the child span timeout if it
811
// has a child span without adding any additional ones or finishing any of them finishing. All of the child spans that
912
// are still running should have the status "cancelled".
10-
sentryTest('should send a pageload span terminated via child span timeout', async ({ getLocalTestPath, page }) => {
13+
sentryTest('should send a pageload span terminated via child span timeout', async ({ getLocalTestUrl, page }) => {
1114
if (shouldSkipTracingTest()) {
1215
sentryTest.skip();
1316
}
1417

15-
const url = await getLocalTestPath({ testDir: __dirname });
18+
const url = await getLocalTestUrl({ testDir: __dirname });
19+
const req = await waitForTransactionRequestOnUrl(page, url);
1620

17-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
21+
const eventData = envelopeRequestParser(req);
1822

1923
expect(eventData.contexts?.trace?.op).toBe('pageload');
2024
expect(eventData.spans?.length).toBeGreaterThanOrEqual(1);

0 commit comments

Comments
 (0)