Files
cypress/docs/source/api/commands/log.md
T
2017-05-19 12:01:36 -04:00

1.3 KiB

title, comments, description
title comments description
log true

Print a message to the Command Log within Cypress.

Returns null
Timeout cannot timeout

cy.log( message )

Print the message to the Command Log.

cy.log( message, arguments )

Print the message to the Command Log, along with any arguments.

Usage

Log a message to the Command Log.

cy.log("Login successful")

Arguments Usage

Log a message with arguments to the Command Log.

// print previously saved variable 'events' to the Command Log.
cy.log("events triggered", events)

Command Log

Print messages with arguments to the Command Log.

cy
  .log("log out any message we want here")
  .log("another message", ["one", "two", "three"])

The commands above will display in the command log as:

command log with cy.log

When clicking on log within the command log, the console outputs the following:

console display of cy.log