mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-21 07:38:53 -05:00
91bb010fd6
- go into more detail on trigger vs action commands - explain actionability further - better format notes + examples - consistent no arg / arg examples - es6 all the functions - remove duplicated intractability content - remove simulated events garbage - go into more detail on pseudo action commands - much better cy.contains usage
1.6 KiB
1.6 KiB
title, comments
| title | comments |
|---|---|
| log | false |
Print a message to the Cypress Command Log.
Syntax
cy.log(message)
cy.log(message, args...)
Usage
{% fa fa-check-circle green %} Correct Usage
cy.log('created new user')
Arguments
{% fa fa-angle-right %} message (String)
Message to be printed to Cypress Command Log.
{% 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 {% helper_icon yields %}
{% yields null cy.log %}
Examples
Message
Print a message to the Command Log.
cy.click('Login')
cy.url().should('not.include', 'login')
cy.log('Login successful')
Args
Print a message with arguments to the Command Log.
cy.log('events triggered', events)
Rules
Requirements {% helper_icon requirements %}
{% requirements parent cy.log %}
Assertions {% helper_icon assertions %}
{% assertions none cy.log %}
Timeouts {% helper_icon timeout %}
{% timeouts none cy.log %}
Command Log
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:
See also
- {% url
cy.exec()exec %}

