| title | log |
|---|
Print a message to the Cypress Command Log.
cy.log(message)
cy.log(message, args...){% fa fa-check-circle green %} Correct Usage
cy.log('created new user'){% fa fa-angle-right %} message (String)
Message to be printed to Cypress Command Log. Accepts a Markdown formatted message.
{% fa fa-angle-right %} args...
Additional arguments to be printed to the Cypress Command Log. There is no limit to the number of arguments.
{% yields null cy.log %}
cy.click('Login')
cy.url().should('not.include', 'login')
cy.log('Login successful')cy.log('events triggered', events){% requirements parent cy.log %}
{% assertions none cy.log %}
{% timeouts none cy.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:
{% imgTag /img/api/log/custom-command-log-with-any-message.png "Command Log log" %}
When clicking on log within the command log, the console outputs the following:
{% imgTag /img/api/log/console-shows-logs-message-and-any-arguments.png "Console Log log" %}
- {% url
cy.exec()exec %} - {% url
Cypress.logcypress-log %} - {% url
cy.task()task %}