Gathering detailed insights and metrics for cypress-log-to-output-with-json-stringify
Gathering detailed insights and metrics for cypress-log-to-output-with-json-stringify
Gathering detailed insights and metrics for cypress-log-to-output-with-json-stringify
Gathering detailed insights and metrics for cypress-log-to-output-with-json-stringify
A Cypress plugin that sends all logs that occur in the browser to stdout in the terminal.
npm install cypress-log-to-output-with-json-stringify
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
26 Commits
2 Branches
1 Contributors
Updated on Oct 30, 2020
Latest Version
1.1.4
Package Id
cypress-log-to-output-with-json-stringify@1.1.4
Unpacked Size
9.11 kB
Size
3.32 kB
File Count
4
NPM Version
6.14.7
Node Version
12.11.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
This is a Cypress plugin that sends all console logs that occur in the browser to stdout in the terminal. This means that you can see any kind of console.log
, console.info
or console.error
that occurs in the browser, even if your tests are running in the terminal.
npm install --save-dev cypress-log-to-output
In your cypress/plugins/index.js
, add this to your module.exports
:
1module.exports = (on, config) => { 2 /** the rest of your plugins... **/ 3 require('cypress-log-to-output').install(on) 4 // or, if there is already a before:browser:launch handler, use .browserLaunchHandler inside of it 5 // @see https://github.com/flotwig/cypress-log-to-output/issues/5 6}
You'll now see all browser console logs in your terminal output.
1cypress run --browser=chrome
Works in Chrome, Chromium, or Canary browsers during cypress run
and cypress open
.
Electron is not currently supported. I can't find a way to attach the Chrome Debugging Protocol to the Electron browser spawned by Cypress.
If you want to filter events, you can use a custom filtering callback:
1module.exports = (on, config) => { 2 /** the rest of your plugins... **/ 3 require('cypress-log-to-output').install(on, (type, event) => { 4 // return true or false from this plugin to control if the event is logged 5 // `type` is either `console` or `browser` 6 // if `type` is `browser`, `event` is an object of the type `LogEntry`: 7 // https://chromedevtools.github.io/devtools-protocol/tot/Log#type-LogEntry 8 // if `type` is `console`, `event` is an object of the type passed to `Runtime.consoleAPICalled`: 9 // https://chromedevtools.github.io/devtools-protocol/tot/Runtime#event-consoleAPICalled 10 11 // for example, to only show error events: 12 13 if (event.level === 'error' || event.type === 'error') { 14 return true 15 } 16 17 return false 18 }) 19}
If you want to record the logs internally, you can use the recordLogs
option:
1module.exports = (on, config) => { 2 /** the rest of your plugins... **/ 3 const options = { recordLogs: true }; 4 require('cypress-log-to-output').install(on, filterCallback, options) 5}
The logs will be stored in an internal buffer. They can be accessed using the getLogs
exported function.
The buffer can be cleared using the clearLogs
exported function.
You can remove the lines beginning with [cypress-log-to-output]
by passing -cypress-log-to-output
in the DEBUG
environment variable.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/26 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More