-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathtest.ts
More file actions
31 lines (25 loc) · 1.22 KB
/
test.ts
File metadata and controls
31 lines (25 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
import { shouldSkipTracingTest } from '../../../../utils/helpers';
import { shouldSkipReplayTest } from '../../../../utils/replayHelpers';
sentryTest('should handle custom added integrations & default integrations', async ({ getLocalTestUrl, page }) => {
const shouldHaveReplay = !shouldSkipReplayTest();
const shouldHaveBrowserTracing = !shouldSkipTracingTest();
const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
await page.waitForFunction(() => {
return (window as any).__sentryLoaded;
});
const hasCustomIntegration = await page.evaluate(() => {
return !!(window as any).Sentry.getClient().getIntegrationByName('CustomIntegration');
});
const hasReplay = await page.evaluate(() => {
return !!(window as any).Sentry.getClient().getIntegrationByName('Replay');
});
const hasBrowserTracing = await page.evaluate(() => {
return !!(window as any).Sentry.getClient().getIntegrationByName('BrowserTracing');
});
expect(hasCustomIntegration).toEqual(true);
expect(hasReplay).toEqual(shouldHaveReplay);
expect(hasBrowserTracing).toEqual(shouldHaveBrowserTracing);
});