|
| 1 | +/* eslint-disable no-console */ |
| 2 | +import type { ConsoleMessage } from '@playwright/test'; |
| 3 | +import { expect } from '@playwright/test'; |
| 4 | + |
| 5 | +import { sentryTest } from '../../../utils/fixtures'; |
| 6 | + |
| 7 | +sentryTest('logs debug messages correctly', async ({ getLocalTestUrl, page }) => { |
| 8 | + const url = await getLocalTestUrl({ testDir: __dirname }); |
| 9 | + |
| 10 | + const consoleMessages: string[] = []; |
| 11 | + |
| 12 | + page.on('console', (msg: ConsoleMessage) => { |
| 13 | + consoleMessages.push(msg.text()); |
| 14 | + }); |
| 15 | + |
| 16 | + await page.goto(url); |
| 17 | + |
| 18 | + await page.evaluate(() => console.log('test log')); |
| 19 | + |
| 20 | + expect(consoleMessages).toEqual([ |
| 21 | + 'Sentry Logger [log]: Integration installed: InboundFilters', |
| 22 | + 'Sentry Logger [log]: Integration installed: FunctionToString', |
| 23 | + 'Sentry Logger [log]: Integration installed: TryCatch', |
| 24 | + 'Sentry Logger [log]: Integration installed: Breadcrumbs', |
| 25 | + 'Sentry Logger [log]: Global Handler attached: onerror', |
| 26 | + 'Sentry Logger [log]: Global Handler attached: onunhandledrejection', |
| 27 | + 'Sentry Logger [log]: Integration installed: GlobalHandlers', |
| 28 | + 'Sentry Logger [log]: Integration installed: LinkedErrors', |
| 29 | + 'Sentry Logger [log]: Integration installed: Dedupe', |
| 30 | + 'Sentry Logger [log]: Integration installed: HttpContext', |
| 31 | + 'Sentry Logger [warn]: Discarded session because of missing or non-string release', |
| 32 | + 'test log', |
| 33 | + ]); |
| 34 | +}); |
0 commit comments