-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
18 lines (15 loc) · 904 Bytes
/
test.ts
File metadata and controls
18 lines (15 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import { shouldSkipTracingTest, testingCdnBundle } from '../../../../utils/helpers';
import { getSpanOp, waitForStreamedSpan } from '../../../../utils/spanUtils';
sentryTest('finishes streamed pageload span when the page goes background', async ({ getLocalTestUrl, page }) => {
sentryTest.skip(shouldSkipTracingTest() || testingCdnBundle());
const url = await getLocalTestUrl({ testDir: __dirname });
const pageloadSpanPromise = waitForStreamedSpan(page, span => getSpanOp(span) === 'pageload');
await page.goto(url);
await page.locator('#go-background').click();
const pageloadSpan = await pageloadSpanPromise;
// TODO: Is this what we want?
expect(pageloadSpan.status).toBe('ok');
expect(pageloadSpan.attributes?.['sentry.cancellation_reason']?.value).toBe('document.hidden');
});