JSPM

  • Created
  • Published
  • Downloads 508912
  • Score
    100M100P100Q189323F
  • License MIT

Better terminal output for failed cypress tests.

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

Build Status

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.

demo

Install

  1. Install npm package.
    npm i --save-dev cypress-terminal-report
  2. Register the output plugin in cypress/plugins/index.js
    module.exports = (on) => {
       require('cypress-terminal-report').installPlugin(on);
    };
  3. 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 true console.log() and console.info() logs will also be printed to the terminal, besides warn and error.

Release notes

1.1.0

1.0.0

  • Added tests and CI to repository.
  • Added support for showing logs even for successful tests. in issue by @zhex900
  • Fixed issue with incorrectly labeled failed commands. in issue by @zhex900
  • Fixed issue with logs from cy.route breaking tests on XHR API type of requests. merge-request by @zhex900