{"action":"opened","issue":{"url":"https://api.github.com/repos/puneet0191/codeceptjs-resemblehelper/issues/1","repository_url":"https://api.github.com/repos/puneet0191/codeceptjs-resemblehelper","labels_url":"https://api.github.com/repos/puneet0191/codeceptjs-resemblehelper/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/puneet0191/codeceptjs-resemblehelper/issues/1/comments","events_url":"https://api.github.com/repos/puneet0191/codeceptjs-resemblehelper/issues/1/events","html_url":"https://github.com/puneet0191/codeceptjs-resemblehelper/issues/1","id":395896910,"node_id":"MDU6SXNzdWUzOTU4OTY5MTA=","number":1,"title":"API suggestions","user":{"login":"DavertMik","id":220264,"node_id":"MDQ6VXNlcjIyMDI2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/220264?v=4","gravatar_id":"","url":"https://api.github.com/users/DavertMik","html_url":"https://github.com/DavertMik","followers_url":"https://api.github.com/users/DavertMik/followers","following_url":"https://api.github.com/users/DavertMik/following{/other_user}","gists_url":"https://api.github.com/users/DavertMik/gists{/gist_id}","starred_url":"https://api.github.com/users/DavertMik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavertMik/subscriptions","organizations_url":"https://api.github.com/users/DavertMik/orgs","repos_url":"https://api.github.com/users/DavertMik/repos","events_url":"https://api.github.com/users/DavertMik/events{/privacy}","received_events_url":"https://api.github.com/users/DavertMik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-04T11:39:04Z","updated_at":"2019-01-04T11:39:04Z","closed_at":null,"author_association":"NONE","body":"I was looking through and I got some ideas how to improve codeceptjs-resemblehelper.\r\n\r\nhttps://github.com/puneet0191/codeceptjs-resemblehelper/blob/master/index.js#L87\r\n\r\n## verifyMisMatchPercentage\r\n\r\nAt first, the function name is complicated. \r\n\r\n**How about renaming it to `seeVisualDiff`?**\r\n\r\nThis function takes too many parameters. Is there a way to hide them?\r\nFrom your own example in docs the parameter is the following:\r\n\r\n```js\r\nI.verifyMisMatchPercentage(\"System_Overview_CPU_Usage.png\", \"System_Overview_CPU_Usage.png\", \"DiffImage_SystemOverview_CPU_USAGE_Dashboard\", 10, true);\r\n```\r\n\r\nArgument 1 is the same as argument 2 and argument 3 is a like of parameter 1.\r\n\r\n**How about using only argument 1 here?**\r\n\r\nBut we still got a lot of parameters to handle. One of them is `selector`. \r\n**Let's have 2 functions here**\r\n\r\n* I.seeVisualDiff(image, ...)\r\n* I.seeVisualDiffForElement(selector, image, ...)\r\n\r\nNext are the options and `prepareBaseImage` args. Please avoid using boolean arguments in CodeceptJS helpers. Just make prepareBaseImage to be the part of `options`.\r\n\r\nBy following this suggestions you can end up with this clean nice function:\r\n\r\n```js\r\nI.seeVisualDiff('System_Overview_CPU_Usage', { prepareBaseImage: true });\r\n```\r\n\r\n---\r\n\r\nAlso please make `getBoundingBox` and `prepareBaseImage` private.\r\n"}}
{"actor":{"display_login":"DavertMik"}}