Skip to content

Commit c25dece

Browse files
authored
test(browser-integration): Skip "browsertracing/backgroundtab-pageload" test for firefox (#7475)
1 parent b278429 commit c25dece

File tree

1 file changed

+18
-11
lines changed
  • packages/browser-integration-tests/suites/tracing/browsertracing/backgroundtab-pageload

1 file changed

+18
-11
lines changed

packages/browser-integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@ import type { Event } from '@sentry/types';
44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
66

7-
sentryTest('should finish pageload transaction when the page goes background', async ({ getLocalTestPath, page }) => {
8-
const url = await getLocalTestPath({ testDir: __dirname });
7+
sentryTest(
8+
'should finish pageload transaction when the page goes background',
9+
async ({ browserName, getLocalTestPath, page }) => {
10+
// TODO: This is flakey on firefox... trace.status is sometimes undefined
11+
if (['firefox'].includes(browserName)) {
12+
sentryTest.skip();
13+
}
14+
const url = await getLocalTestPath({ testDir: __dirname });
915

10-
await page.goto(url);
11-
await page.click('#go-background');
16+
await page.goto(url);
17+
await page.click('#go-background');
1218

13-
const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page);
19+
const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page);
1420

15-
expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload');
16-
expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled');
17-
expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({
18-
visibilitychange: 'document.hidden',
19-
});
20-
});
21+
expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload');
22+
expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled');
23+
expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({
24+
visibilitychange: 'document.hidden',
25+
});
26+
},
27+
);

0 commit comments

Comments
 (0)