Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cypress return value from command

// Adding the command
function foo() {
  return cy.wrap('foo');
}
Cypress.Commands.add('foo', foo);

//Using the command
cy.foo().then(value => console.log(value)); // foo
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cypress #return #command
ADD COMMENT
Topic
Name
9+8 =