Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

cypress command return value into variable

beforeEach(() => {
  // alias the $btn.text() as 'text'
  cy.get('button').invoke('text').as('text')
})

it('has access to text', function () {
  this.text // is now available
})
Source by docs.cypress.io #
 
PREVIOUS NEXT
Tagged: #cypress #command #return #variable
ADD COMMENT
Topic
Name
1+8 =