{"action":"created","issue":{"url":"https://api.github.com/repos/DevExpress/testcafe/issues/2201","repository_url":"https://api.github.com/repos/DevExpress/testcafe","labels_url":"https://api.github.com/repos/DevExpress/testcafe/issues/2201/labels{/name}","comments_url":"https://api.github.com/repos/DevExpress/testcafe/issues/2201/comments","events_url":"https://api.github.com/repos/DevExpress/testcafe/issues/2201/events","html_url":"https://github.com/DevExpress/testcafe/issues/2201","id":303234243,"node_id":"MDU6SXNzdWUzMDMyMzQyNDM=","number":2201,"title":"Add a .map function","user":{"login":"dv297","id":5365325,"node_id":"MDQ6VXNlcjUzNjUzMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/5365325?v=4","gravatar_id":"","url":"https://api.github.com/users/dv297","html_url":"https://github.com/dv297","followers_url":"https://api.github.com/users/dv297/followers","following_url":"https://api.github.com/users/dv297/following{/other_user}","gists_url":"https://api.github.com/users/dv297/gists{/gist_id}","starred_url":"https://api.github.com/users/dv297/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dv297/subscriptions","organizations_url":"https://api.github.com/users/dv297/orgs","repos_url":"https://api.github.com/users/dv297/repos","events_url":"https://api.github.com/users/dv297/events{/privacy}","received_events_url":"https://api.github.com/users/dv297/received_events","type":"User","site_admin":false},"labels":[{"id":246571256,"node_id":"MDU6TGFiZWwyNDY1NzEyNTY=","url":"https://api.github.com/repos/DevExpress/testcafe/labels/TYPE:%20proposal","name":"TYPE: proposal","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-07T19:45:04Z","updated_at":"2018-08-23T23:52:34Z","closed_at":null,"author_association":"NONE","body":"### Are you requesting a feature or reporting a bug?\r\nFeature\r\n\r\n\r\n### What is the current behavior?\r\nN/A\r\n\r\n\r\n### What is the expected behavior?\r\nGeneric map function that allows you to map over a Selector. This could be useful with creating assertions that deal with predefined/ expected lists vs actual lists created by the DOM. Since there is already a .filter function, and people always talk about map/filter/reduce being together, this seems like a natural addition to the Selector API.\r\n\r\n\r\n### How would you reproduce the current behavior (if this is a bug)?\r\nN/A\r\n\r\n\r\n#### Provide the test code and the tested page URL (if applicable)\r\n\r\nTested page URL:\r\n\r\nTest code\r\n\r\n```js\r\nSelector('li').map((element) => element.innerText);\r\n```\r\n\r\n### Specify your\r\n\r\n* operating system: Windows 10\r\n* testcafe version: 0.18.1\r\n* node.js version: 8.8.1"},"comment":{"url":"https://api.github.com/repos/DevExpress/testcafe/issues/comments/415608515","html_url":"https://github.com/DevExpress/testcafe/issues/2201#issuecomment-415608515","issue_url":"https://api.github.com/repos/DevExpress/testcafe/issues/2201","id":415608515,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTYwODUxNQ==","user":{"login":"efleming969","id":27506,"node_id":"MDQ6VXNlcjI3NTA2","avatar_url":"https://avatars2.githubusercontent.com/u/27506?v=4","gravatar_id":"","url":"https://api.github.com/users/efleming969","html_url":"https://github.com/efleming969","followers_url":"https://api.github.com/users/efleming969/followers","following_url":"https://api.github.com/users/efleming969/following{/other_user}","gists_url":"https://api.github.com/users/efleming969/gists{/gist_id}","starred_url":"https://api.github.com/users/efleming969/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efleming969/subscriptions","organizations_url":"https://api.github.com/users/efleming969/orgs","repos_url":"https://api.github.com/users/efleming969/repos","events_url":"https://api.github.com/users/efleming969/events{/privacy}","received_events_url":"https://api.github.com/users/efleming969/received_events","type":"User","site_admin":false},"created_at":"2018-08-23T23:52:33Z","updated_at":"2018-08-23T23:52:33Z","author_association":"NONE","body":"The suggested code won't work because NodeList does not support \"map\"\r\n\r\n```javascript\r\nconst getInnerTextArr = ClientFunction( function ( selector ) {\r\n    const values = []\r\n    const elements = document.querySelectorAll( selector )\r\n\r\n    for ( let i = 0; i < elements.length; i++ ) {\r\n        values.push( elements[ i ].textContent )\r\n    }\r\n\r\n    return values\r\n} )\r\n```"}}
{"actor":{"display_login":"efleming969"}}