Skip to content

Latest commit

 

History

History
110 lines (88 loc) · 2.65 KB

logFunctions.md

File metadata and controls

110 lines (88 loc) · 2.65 KB

Log functions

What are log function ?

It is a new way to write text/data to your live report created by Cypress

for example:

If I don't like to search in the entire report scrolling up and down

to find that specific log message that represents what I'm searching for

this is exactly where log messages do that work for me

Installation

To install the plugin to your project please use:

npm install cypress-extender

in order to also add it to your package.json file so you can use:

npm install --save-prod cypress-extender

Manual

Once cypress-extender is installed you can use:

        import { INFO } from 'cypress-extender';
        INFO("hi how are you");

Or Use:

        import { initCypressWithLogger } from 'cypress-extender';
        initCypressWithLogger();

        cy.Info("hi how are you");

Which will display a nice INFO line in you report (instead of the old log line).

Such as:

INFO example

Supported log functions

function what is it
Info displays INFO message in the Cypress report
INFO displays INFO message in the Cypress report
Message displays MESSAGE message in the Cypress report
MESSAGE displays MESSAGE message in the Cypress report
Debug displays DEBUG message in the Cypress report
DEBUG displays DEBUG message in the Cypress report
Warn displays WARN message in the Cypress report
WARN displays WARN message in the Cypress report
Custom Allows you to decide what message you want to be printed in the report
CUSTOM Allows you to decide what message you want to be printed in the report

Example to the custom command

        import { CUSTOM } from 'cypress-extender';
        CUSTOM("YourFuncName", "My data is", someDataObjectOrArray);