Cypress · Method
cy.invoke
invoke() calls a function on the previous Cypress subject and yields its return value. It supports arguments, nested function paths, and array indexes, but repeated retries can call the function more than once.
Last updated
- Since
- 3.7.0
Syntax
.invoke(functionName)
.invoke(options, functionName)
.invoke(functionName, args...)
.invoke(options, functionName, args...)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
.as().its().then()cy.window()cy.wrap()