JS/Cypress.io: How to iterate over 2 corresponding sets of data
问题 JS/Cypress.io: How to iterate over 2 corresponding sets of data This is what I have currently and it works, but I want to make it more DRY (do not repeat yourself): Using Cypress.io: var states1 = [ "NE", "MO", "KS", "IA", "OK", "OR", "WA", "AZ", "NM", "NC", "SC", "GA", "FL" ]; cy.get('[data-popup-text="26% to 50% of People"]').within(() => { cy.wrap(states1).each(state => { cy.get(`[data-state="${state}"]`).trigger("mouseover", { force: true }); cy.get(`[data-state="${state}"]`).click({