-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathtest.ts
28 lines (21 loc) · 1.01 KB
/
test.ts
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
import { expect } from '@playwright/test';
import { sentryTest } from '../../../utils/fixtures';
import { shouldSkipFeedbackTest } from '../../../utils/helpers';
/**
* This test is mostly relevant for ensuring that the logger works in all combinations of CDN bundles.
* Even if feedback is included via the CDN, this test ensures that the logger is working correctly.
*/
sentryTest('should log error correctly', async ({ getLocalTestUrl, page }) => {
// In minified bundles we do not have logger messages, so we skip the test
if (shouldSkipFeedbackTest() || (process.env.PW_BUNDLE || '').includes('_min')) {
sentryTest.skip();
}
const messages: string[] = [];
page.on('console', message => {
messages.push(message.text());
});
const url = await getLocalTestUrl({ testDir: __dirname });
await page.goto(url);
expect(messages).toContain('Sentry Logger [log]: Integration installed: Feedback');
expect(messages).toContain('Sentry Logger [error]: [Feedback] Unable to attach to target element');
});