Files
cypress/docs/source/api/commands/title.md
2017-05-19 11:51:03 -04:00

1.3 KiB

title: title comments: true

Get the title of the document.

Returns the document title as a string
Timeout cy.title will retry for the duration of the defaultCommandTimeout

cy.title()

Get the title of the document.

Options

Pass in an options object to change the default behavior of cy.click.

cy.title( options )

Option Default Notes
log true whether to display command in command log

Usage

Assert that the document's title contains "New User"

cy.title().should("contain", "New User")

Command Log

Assert that the document's title contains "New User"

cy.title().should("contain", "New User")

The commands above will display in the command log as:

screen shot 2015-11-29 at 2 12 54 pm

When clicking on title within the command log, the console outputs the following:

screen shot 2015-11-29 at 2 13 06 pm

Related