title | description | sidebar_label | slug |
---|---|---|---|
log | Cypress Documentation | Print a message to the Cypress Command Log. | log | /api/commands/log |
Print a message to the Cypress Command Log.
cy.log(message)cy.log(message,args...)
Correct Usage
cy.log('created new user')
message (String)
Message to be printed to Cypress Command Log. Accepts a Markdown formatted message.
args...
Additional arguments to be printed to the Cypress Command Log. There is no limit to the number of arguments.
cy.log()
yieldsnull
.
cy.click('Login')cy.log('Login successful')
cy.log('events triggered',events)
cy.log()
requires being chained off ofcy
.
cy.log()
cannot have any assertions chained.
cy.log()
cannot time out.
Print messages with arguments to the Command Log.
cy.log('log out any message we want here')cy.log('another message',['one','two','three'])
The commands above will display in the Command Log as:
When clicking on log
within the command log, the console outputs the following: