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() yields null . cy.log() cannot be chained further. cy.click('Login')
cy.url().should('not.include', 'login')
cy.log('Login successful')
cy.log('events triggered', events)
cy.log() requires being chained off of cy . cy.log() cannot have any assertions chained. cy.log() cannot time out. 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:
© 2017 Cypress.io
Licensed under the MIT License.
https://docs.cypress.io/api/commands/log