mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-19 14:49:43 -05:00
cbec33d637
- Updated some existing api docs to reflect structure changes - Added missing ‘pause’ command to sidebar and .yml english.
1.6 KiB
1.6 KiB
title, comments, description
| title | comments | description |
|---|---|---|
| log | true |
Print a message to the Cypress Command Log.
Syntax
.log(message)
.log(message, args...)
Usage
.log() cannot be chained off any other cy commands, so should be chained off of cy for clarity.
{% fa fa-check-circle green %} Valid 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
.log() yields null.
Timeout
Examples
Message
Print a message to the Command Log.
cy.click('Login')
cy.url().should('not.include', 'login')
cy.log('Login successful')
Arguments
Print a message with arguments 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:
When clicking on log within the command log, the console outputs the following: