{"action":"created","issue":{"url":"https://api.github.com/repos/cypress-io/cypress/issues/156","repository_url":"https://api.github.com/repos/cypress-io/cypress","labels_url":"https://api.github.com/repos/cypress-io/cypress/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/cypress-io/cypress/issues/156/comments","events_url":"https://api.github.com/repos/cypress-io/cypress/issues/156/events","html_url":"https://github.com/cypress-io/cypress/issues/156","id":159409203,"number":156,"title":"Add cy.each method to the API","user":{"login":"bahmutov","id":2212006,"avatar_url":"https://avatars.githubusercontent.com/u/2212006?v=3","gravatar_id":"","url":"https://api.github.com/users/bahmutov","html_url":"https://github.com/bahmutov","followers_url":"https://api.github.com/users/bahmutov/followers","following_url":"https://api.github.com/users/bahmutov/following{/other_user}","gists_url":"https://api.github.com/users/bahmutov/gists{/gist_id}","starred_url":"https://api.github.com/users/bahmutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahmutov/subscriptions","organizations_url":"https://api.github.com/users/bahmutov/orgs","repos_url":"https://api.github.com/users/bahmutov/repos","events_url":"https://api.github.com/users/bahmutov/events{/privacy}","received_events_url":"https://api.github.com/users/bahmutov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-09T13:34:26Z","updated_at":"2016-06-09T14:31:03Z","closed_at":null,"body":"We wanted to validate / perform actions for a each element in the list, and for this we used the suggested manual code\r\n```js\r\ncy.get(\"li\").then(function($lis){\r\n  $lis.each(function(i, el){\r\n    cy.wrap(Cypress.$(el)).click()\r\n  })\r\n})\r\n```\r\nSeems, this has a little boilerplate that can be avoided if there was a built-in `cy.each` method. It would work on a list of objects returned by `cy.get()` or `cy.find()` and would automatically wrap each element\r\n```js\r\ncy.get(\"li\")\r\n  .each(function($el){\r\n    // $el is wrapped element\r\n    $el.click()\r\n  })\r\n```"},"comment":{"url":"https://api.github.com/repos/cypress-io/cypress/issues/comments/224912755","html_url":"https://github.com/cypress-io/cypress/issues/156#issuecomment-224912755","issue_url":"https://api.github.com/repos/cypress-io/cypress/issues/156","id":224912755,"user":{"login":"bahmutov","id":2212006,"avatar_url":"https://avatars.githubusercontent.com/u/2212006?v=3","gravatar_id":"","url":"https://api.github.com/users/bahmutov","html_url":"https://github.com/bahmutov","followers_url":"https://api.github.com/users/bahmutov/followers","following_url":"https://api.github.com/users/bahmutov/following{/other_user}","gists_url":"https://api.github.com/users/bahmutov/gists{/gist_id}","starred_url":"https://api.github.com/users/bahmutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahmutov/subscriptions","organizations_url":"https://api.github.com/users/bahmutov/orgs","repos_url":"https://api.github.com/users/bahmutov/repos","events_url":"https://api.github.com/users/bahmutov/events{/privacy}","received_events_url":"https://api.github.com/users/bahmutov/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T14:31:03Z","updated_at":"2016-06-09T14:31:03Z","body":"sure, it could be just jQuery wrapped element, not `cy.wrap`ped. In our case we do additional steps per element, so clicking is just example operator, agreed"}}
{"actor":{"display_login":"bahmutov"}}