Skip to content

Conversation

@biinari
Copy link
Contributor

@biinari biinari commented Oct 12, 2025

Add assertNoConsoleMessages(array|string $levels)

Check page for console messages at specified levels:

'debug': console.debug() calls (not checked by default)
'error': console.error() calls
'info': console.info() calls
'warning': console.warn() calls (can also specify level as 'warn')

Usage:

// assert no console messages have been made at any level
$page->assertNoConsoleMessages(['debug', 'error', 'info', 'warning']);

// assert no console.warn() calls have been made
$page->assertNoConsoleMessages('warning');

// get list of console.warn() and console.error() calls made on page
$page->consoleMessages(['error', 'warning']);

Note: I have not added this assertion to assertNoSmoke() as it may not be desired by every project.

Check page for console messages at specified levels:

'debug': console.debug() calls (not checked by default)
'error': console.error() calls
'info': console.info() calls
'warning': console.warn() calls (can also specify level as 'warn')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant