-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
21 lines (15 loc) · 1.02 KB
/
test.ts
File metadata and controls
21 lines (15 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { expect } from '@playwright/test';
import { sentryTest } from '../../../utils/fixtures';
import { getSpanOp, waitForStreamedSpans } from '../../../utils/spanUtils';
import { shouldSkipTracingTest } from '../../../utils/helpers';
sentryTest('cultureContextIntegration captures locale, timezone, and calendar', async ({ getLocalTestUrl, page }) => {
sentryTest.skip(shouldSkipTracingTest());
const url = await getLocalTestUrl({ testDir: __dirname });
const spansPromise = waitForStreamedSpans(page, spans => spans.some(s => getSpanOp(s) === 'pageload'));
await page.goto(url);
const spans = await spansPromise;
const pageloadSpan = spans.find(s => getSpanOp(s) === 'pageload');
expect(pageloadSpan!.attributes?.['culture.locale']).toEqual({ type: 'string', value: expect.any(String) });
expect(pageloadSpan!.attributes?.['culture.timezone']).toEqual({ type: 'string', value: expect.any(String) });
expect(pageloadSpan!.attributes?.['culture.calendar']).toEqual({ type: 'string', value: expect.any(String) });
});