{"action":"created","issue":{"url":"https://api.github.com/repos/angular/protractor/issues/2532","labels_url":"https://api.github.com/repos/angular/protractor/issues/2532/labels{/name}","comments_url":"https://api.github.com/repos/angular/protractor/issues/2532/comments","events_url":"https://api.github.com/repos/angular/protractor/issues/2532/events","html_url":"https://github.com/angular/protractor/issues/2532","id":108101818,"number":2532,"title":"Strange behavior of ElementArrayFinder#isDisplayed","user":{"login":"stalniy","id":1159966,"avatar_url":"https://avatars.githubusercontent.com/u/1159966?v=3","gravatar_id":"","url":"https://api.github.com/users/stalniy","html_url":"https://github.com/stalniy","followers_url":"https://api.github.com/users/stalniy/followers","following_url":"https://api.github.com/users/stalniy/following{/other_user}","gists_url":"https://api.github.com/users/stalniy/gists{/gist_id}","starred_url":"https://api.github.com/users/stalniy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stalniy/subscriptions","organizations_url":"https://api.github.com/users/stalniy/orgs","repos_url":"https://api.github.com/users/stalniy/repos","events_url":"https://api.github.com/users/stalniy/events{/privacy}","received_events_url":"https://api.github.com/users/stalniy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/protractor/labels/type:%20feature%20request","name":"type: feature request","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-24T10:23:51Z","updated_at":"2015-09-24T22:44:54Z","closed_at":null,"body":"If I want to prevent a promise rejection I can't just write `thenCatch` as ElementArrayFinder doesn't have `thenCatch` or `thenFinally` as it actually is not a promise but promise-like:\r\n```js\r\nelement.all(by.repeater('item in items')).isDisplayed().thenCatch(function() {\r\n   return false;\r\n});\r\n// throws exception\r\n```\r\nInstead I'm forced to write:\r\n```js\r\nelement.all(by.repeater('item in items')).isDisplayed().then(null, function() {\r\n   return false;\r\n});\r\n\r\n// or\r\nelement.all(by.repeater('item in items')).isDisplayed().then().thenCatch(function() {\r\n   return false;\r\n});\r\n```\r\nThe same behavior with all methods \r\n```js\r\nvar WEB_ELEMENT_FUNCTIONS = [\r\n  'click', 'sendKeys', 'getTagName', 'getCssValue', 'getAttribute', 'getText',\r\n  'getSize', 'getLocation', 'isEnabled', 'isSelected', 'submit', 'clear',\r\n  'isDisplayed', 'getOuterHtml', 'getInnerHtml', 'getId', 'getRawId'];\r\n```\r\nthe same with `evaluate`. All these methods return promise of primitive value, wrapping them into `ElementArrayFinder` looks incorrect"},"comment":{"url":"https://api.github.com/repos/angular/protractor/issues/comments/143068886","html_url":"https://github.com/angular/protractor/issues/2532#issuecomment-143068886","issue_url":"https://api.github.com/repos/angular/protractor/issues/2532","id":143068886,"user":{"login":"stalniy","id":1159966,"avatar_url":"https://avatars.githubusercontent.com/u/1159966?v=3","gravatar_id":"","url":"https://api.github.com/users/stalniy","html_url":"https://github.com/stalniy","followers_url":"https://api.github.com/users/stalniy/followers","following_url":"https://api.github.com/users/stalniy/following{/other_user}","gists_url":"https://api.github.com/users/stalniy/gists{/gist_id}","starred_url":"https://api.github.com/users/stalniy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stalniy/subscriptions","organizations_url":"https://api.github.com/users/stalniy/orgs","repos_url":"https://api.github.com/users/stalniy/repos","events_url":"https://api.github.com/users/stalniy/events{/privacy}","received_events_url":"https://api.github.com/users/stalniy/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T22:44:54Z","updated_at":"2015-09-24T22:44:54Z","body":"One more thought about consistency. You can consider `jQuery` as the most chainable library and even they have methods that return primitive: `val`, `prop`, `data`, `is(':visible')`, etc"}}