{"action":"created","issue":{"url":"https://api.github.com/repos/electron/spectron/issues/271","repository_url":"https://api.github.com/repos/electron/spectron","labels_url":"https://api.github.com/repos/electron/spectron/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/electron/spectron/issues/271/comments","events_url":"https://api.github.com/repos/electron/spectron/issues/271/events","html_url":"https://github.com/electron/spectron/issues/271","id":297999783,"number":271,"title":"How do one properly iterate over elements?","user":{"login":"negamaxi","id":16529171,"avatar_url":"https://avatars1.githubusercontent.com/u/16529171?v=4","gravatar_id":"","url":"https://api.github.com/users/negamaxi","html_url":"https://github.com/negamaxi","followers_url":"https://api.github.com/users/negamaxi/followers","following_url":"https://api.github.com/users/negamaxi/following{/other_user}","gists_url":"https://api.github.com/users/negamaxi/gists{/gist_id}","starred_url":"https://api.github.com/users/negamaxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/negamaxi/subscriptions","organizations_url":"https://api.github.com/users/negamaxi/orgs","repos_url":"https://api.github.com/users/negamaxi/repos","events_url":"https://api.github.com/users/negamaxi/events{/privacy}","received_events_url":"https://api.github.com/users/negamaxi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-17T11:59:50Z","updated_at":"2018-02-18T08:20:46Z","closed_at":null,"author_association":"NONE","body":"On webdriver homepage there is an example:\r\n```javascript\r\n        var results = $$('.commands.property a').filter(function (link) {\r\n            return link.isVisible();\r\n        });\r\n```\r\nSpectron is promised-based, therefore I adopt it to something like this:\r\n```javascript\r\n        var results = await app.client.$$('.commands.property a')\r\n        var filtered = results.filter(function (link) {\r\n            return link.isVisible();\r\n        });\r\n```\r\nBut it throws `TypeError: link.isVisible is not a function`. Same error occurs on this:\r\n```javascript\r\n      var results = await app.client.$$('..commands.property a')\r\n      var isVisible = results[0].isVisible()\r\n``` \r\nSo what is a proper way to iterate over array of dom elelements returned from `$$`?"},"comment":{"url":"https://api.github.com/repos/electron/spectron/issues/comments/366499936","html_url":"https://github.com/electron/spectron/issues/271#issuecomment-366499936","issue_url":"https://api.github.com/repos/electron/spectron/issues/271","id":366499936,"user":{"login":"negamaxi","id":16529171,"avatar_url":"https://avatars1.githubusercontent.com/u/16529171?v=4","gravatar_id":"","url":"https://api.github.com/users/negamaxi","html_url":"https://github.com/negamaxi","followers_url":"https://api.github.com/users/negamaxi/followers","following_url":"https://api.github.com/users/negamaxi/following{/other_user}","gists_url":"https://api.github.com/users/negamaxi/gists{/gist_id}","starred_url":"https://api.github.com/users/negamaxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/negamaxi/subscriptions","organizations_url":"https://api.github.com/users/negamaxi/orgs","repos_url":"https://api.github.com/users/negamaxi/repos","events_url":"https://api.github.com/users/negamaxi/events{/privacy}","received_events_url":"https://api.github.com/users/negamaxi/received_events","type":"User","site_admin":false},"created_at":"2018-02-18T08:20:46Z","updated_at":"2018-02-18T08:20:46Z","author_association":"NONE","body":"No luck, still the same `TypeError: link.isVisible is not a function`.\r\n```javascript\r\n  var results = await app.client.$$('.commands.property a')\r\n  var filtered = Array.from(results).filter(function (link) {\r\n    console.log(link)\r\n    return link.isVisible();\r\n  });\r\n```\r\nEach link looks like this:\r\n```bash\r\n{ ELEMENT: '0.5135845781967734-28',\r\n  'element-6066-11e4-a52e-4f735466cecf': '0.5135845781967734-28',\r\n  value: { ELEMENT: '0.5135845781967734-28' },\r\n  selector: '.commands.property a',\r\n  index: 0 }\r\n```"}}
{"actor":{"display_login":"negamaxi"}}