{"action":"closed","issue":{"url":"https://api.github.com/repos/koola/pix-diff/issues/28","repository_url":"https://api.github.com/repos/koola/pix-diff","labels_url":"https://api.github.com/repos/koola/pix-diff/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/koola/pix-diff/issues/28/comments","events_url":"https://api.github.com/repos/koola/pix-diff/issues/28/events","html_url":"https://github.com/koola/pix-diff/issues/28","id":176321037,"number":28,"title":"this.checkImageExists(...).catch is not a function","user":{"login":"scaljeri","id":1078741,"avatar_url":"https://avatars.githubusercontent.com/u/1078741?v=3","gravatar_id":"","url":"https://api.github.com/users/scaljeri","html_url":"https://github.com/scaljeri","followers_url":"https://api.github.com/users/scaljeri/followers","following_url":"https://api.github.com/users/scaljeri/following{/other_user}","gists_url":"https://api.github.com/users/scaljeri/gists{/gist_id}","starred_url":"https://api.github.com/users/scaljeri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaljeri/subscriptions","organizations_url":"https://api.github.com/users/scaljeri/orgs","repos_url":"https://api.github.com/users/scaljeri/repos","events_url":"https://api.github.com/users/scaljeri/events{/privacy}","received_events_url":"https://api.github.com/users/scaljeri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/koola/pix-diff/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"koola","id":4948196,"avatar_url":"https://avatars.githubusercontent.com/u/4948196?v=3","gravatar_id":"","url":"https://api.github.com/users/koola","html_url":"https://github.com/koola","followers_url":"https://api.github.com/users/koola/followers","following_url":"https://api.github.com/users/koola/following{/other_user}","gists_url":"https://api.github.com/users/koola/gists{/gist_id}","starred_url":"https://api.github.com/users/koola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koola/subscriptions","organizations_url":"https://api.github.com/users/koola/orgs","repos_url":"https://api.github.com/users/koola/repos","events_url":"https://api.github.com/users/koola/events{/privacy}","received_events_url":"https://api.github.com/users/koola/received_events","type":"User","site_admin":false},"assignees":[{"login":"koola","id":4948196,"avatar_url":"https://avatars.githubusercontent.com/u/4948196?v=3","gravatar_id":"","url":"https://api.github.com/users/koola","html_url":"https://github.com/koola","followers_url":"https://api.github.com/users/koola/followers","following_url":"https://api.github.com/users/koola/following{/other_user}","gists_url":"https://api.github.com/users/koola/gists{/gist_id}","starred_url":"https://api.github.com/users/koola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koola/subscriptions","organizations_url":"https://api.github.com/users/koola/orgs","repos_url":"https://api.github.com/users/koola/repos","events_url":"https://api.github.com/users/koola/events{/privacy}","received_events_url":"https://api.github.com/users/koola/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-09-12T08:33:59Z","updated_at":"2016-09-13T07:41:36Z","closed_at":"2016-09-13T07:41:36Z","body":"When I run pix-diff I always get the following error:\r\n\r\n     Message:\r\n        Failed: this.checkImageExists(...).catch is not a function\r\n      Stack:\r\n        TypeError: this.checkImageExists(...).catch is not a function\r\n        ...\r\n\r\nIt seems to go wrong here:\r\n\r\n        checkScreen: function (tag, options) {\r\n            var defaults;\r\n\r\n            return this.flow.execute(function () {\r\n                return this.checkImageExists(tag)\r\n                    .catch(function (err) {  ...  }\r\n             ...\r\n\r\nNow the `checkImageExists` returns a promise\r\n\r\n     var deferred = protractor.promise.defer();\r\n     ...\r\n     return deferred.promise;\r\n\r\nI've checked this promise and it doesn't have a `catch` method\r\n\r\nMy node version is v6.5.0 and I'm using protractor v4.0.5\r\n\r\nFor now I've fixed it as follows:\r\n\r\n    checkScreen: function (tag, options) {\r\n        var defaults;\r\n\r\n        return this.flow.execute(function () {\r\n            return this.checkImageExists(tag)\r\n                .then(function () {\r\n                    return browser.takeScreenshot();\r\n                }, function (err) {\r\n                    if (this.baseline) {\r\n                        this.saveScreen(tag);\r\n                    }\r\n                    else {\r\n                        throw err;\r\n                    }\r\n                }.bind(this))\r\n                .then(function (image) {\r\n                    tag = this.format(this.formatString, tag);\r\n                    defaults = {\r\n                        imageAPath: path.join(this.basePath, tag),\r\n                        imageB: new Buffer(image, 'base64'),\r\n                        imageOutputPath: path.join(this.basePath, 'diff', path.basename(tag)),\r\n                        imageOutputLimit: BlinkDiff.OUTPUT_DIFFERENT\r\n                    };\r\n                    return new BlinkDiff(this.mergeDefaultOptions(defaults, options)).runWithPromise();\r\n                }.bind(this))\r\n                .then(function (result) {\r\n                    return result;\r\n                });\r\n        }.bind(this));\r\n    },\r\n   \r\n"}}
{"actor":{"display_login":"koola"}}