mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-22 23:20:35 -06:00
1.3 KiB
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:
When clicking on title within the command log, the console outputs the following: