Skip to main content
Version: 1.x

Function: collectPageDiagnostics()

collectPageDiagnostics(page): Promise<PageDiagnostics>

Collects console output, page errors, and network requests from a page.

Parameters​

page​

Page

The Playwright page to inspect.

Returns​

Promise<PageDiagnostics>

Capped, JSON-serialisable diagnostics. Never throws.

Capability​

ui5Diagnostics.collect

Example​

const diagnostics = await collectPageDiagnostics(page);
await testInfo.attach('ui5-diagnostics', {
contentType: 'application/json',
body: Buffer.from(JSON.stringify(diagnostics, null, 2), 'utf8'),
});