document.title property of the page that is currently active.
cy.title() // Yields the documents title as a string
Pass in an options object to change the default behavior of
|Displays the command in the Command log|
|Time to wait for |
document.titleproperty of the current page.
cy.title()is a query, and it is safe to chain further commands.
Assert that the document's title is "My Awesome Application"
cy.title().should('eq', 'My Awesome Application')
cy.title()requires being chained off of
cy.title()will automatically retry until all chained assertions have passed
cy.title()can time out waiting for assertions you've added to pass.
Assert that the document's title includes 'New User'
cy.title().should('include', 'New User')
The commands above will display in the Command Log as:
When clicking on
title within the command log, the console outputs the