Files
cypress/docs/source/api/commands/end.md
T
2017-05-19 12:01:36 -04:00

1.1 KiB

title, comments, description
title comments description
end true

Ends the Cypress command chain and returns null. This is equivalent to the jQuery end() method.

Returns null
Timeout cannot timeout

cy.end()

End the command chain.

Usage

// cy.end is useful when you want to end a chain of commands
// and force Cypress to re-query from the root element
cy
  .contains("User: Cheryl").click().end() // ends the current chain and returns null

  // queries the entire document again
  .contains("User: Charles").click()

Command Log

end does not log in the command log

cy
  .contains(".modal-title", "Select Folder Type").end()
  .contains("li", "Maintenance").should("have.class", "active")

The commands above will display in the command log as:

screen shot 2016-01-21 at 11 28 39 am

Related