Listen to the console events (ex. console.log event) and register callback to process the same.

Usage

.captureBrowserConsoleLogs(onEventCallback)

Example

Or run locally with:
git clone https://github.com/nightwatchjs/nightwatch-examples.git
cd nightwatch-examples
npm install
npx nightwatch tests/api/captureBrowserConsoleLogs.js

Parameters

Name Type description
onEventCallback function

Callback function called whenever a new console event is captured.

Recommended content