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

822 B

title: wrap comments: true

Return the object passed into cy.wrap.

Returns the object passed into cy.wrap
Timeout cannot timeout

cy.wrap( object )

Return the object passed into cy.wrap.

Options

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

cy.wrap( object, options )

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

Usage

Invokes the function on the subject in wrap and returns the new value.

var fn = function(){
  return "bar"
}

cy.wrap({foo: fn}).invoke("foo").should("eq", "bar") // true

Related