Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

iterate cy.get(') elements

cy.get('ul>li').each(($el, index, $list) => {
  // $el is a wrapped jQuery element
  if ($el.someMethod() === 'something') {
    // wrap this element so we can
    // use cypress commands on it
    cy.wrap($el).click()
  } else {
    // do something else
  }
})
Source by docs.cypress.io #
 
PREVIOUS NEXT
Tagged: #iterate #elements
ADD COMMENT
Topic
Name
2+4 =