Package Exports
- cypress-terminal-report
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cypress-terminal-report) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Cypress terminal report
Plugin for cypress that adds better terminal output when tests fail on the terminal for better debugging. Prints cy commands, console.warn, console.error and request response data captured with cy.route.
Note: If you want to display the logs when test succeed as well then check the options for the support install.
Note: Currently logs do not appear in the dashboard. If you want to see them go to your CI runner and check the pipeline logs there.
Install
- Install npm package.
npm i --save-dev cypress-terminal-report
- Register the output plugin in
cypress/plugins/index.js
module.exports = (on) => { require('cypress-terminal-report').installPlugin(on); };
- Register the log collector support in
cypress/support/index.js
require('cypress-terminal-report').installSupport();
Options
Options for the plugin install: .installPlugin(on, options)
:
options.defaultTrimLength
- default: 200; max length of cy.log and console.warn/console.error.options.commandTrimLength
- default: 600; max length of cy commands.options.routeTrimLength
- default: 5000; max length of cy.route request data.
Options for the support install: .installSupport(options)
:
options.printLogs
- default: null; possible values: null, 'always' - When set to always logs will be printed for successful test as well as failing ones.printConsoleInfo
- default: null; possible values: null, true - When trueconsole.log()
andconsole.info()
logs will also be printed to the terminal, besides warn and error.
Release notes
1.1.0
- Added notice for logs not appearing in dashboard. from issue
- Added support for logging console.info and console.log. in issue
- Added better logging of cy.requests. in issue by @zhex900