{"action":"opened","issue":{"url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/87","repository_url":"https://api.github.com/repos/zinserjan/wdio-screenshot","labels_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/87/comments","events_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/87/events","html_url":"https://github.com/zinserjan/wdio-screenshot/issues/87","id":328304148,"node_id":"MDU6SXNzdWUzMjgzMDQxNDg=","number":87,"title":"Add \"Offset\" Option for Element Scrolling when Making a Screenshot","user":{"login":"emilyrohrbough","id":14099737,"node_id":"MDQ6VXNlcjE0MDk5NzM3","avatar_url":"https://avatars1.githubusercontent.com/u/14099737?v=4","gravatar_id":"","url":"https://api.github.com/users/emilyrohrbough","html_url":"https://github.com/emilyrohrbough","followers_url":"https://api.github.com/users/emilyrohrbough/followers","following_url":"https://api.github.com/users/emilyrohrbough/following{/other_user}","gists_url":"https://api.github.com/users/emilyrohrbough/gists{/gist_id}","starred_url":"https://api.github.com/users/emilyrohrbough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilyrohrbough/subscriptions","organizations_url":"https://api.github.com/users/emilyrohrbough/orgs","repos_url":"https://api.github.com/users/emilyrohrbough/repos","events_url":"https://api.github.com/users/emilyrohrbough/events{/privacy}","received_events_url":"https://api.github.com/users/emilyrohrbough/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T21:29:10Z","updated_at":"2018-05-31T21:29:10Z","closed_at":null,"author_association":"NONE","body":"### Summary\r\nI would like to be able to pass a `cropElement` option (maybe a better name 😄) to the `makeElementScreenshot()`, such that when an element is larger than the viewport, a screenshot is taken of the visible portion of the element.  \r\n\r\nCurrently, when using the wdio-visual-regression service, when using `checkElement()` and an element is larger than the viewport, the screenshot fails because the BaseStrategy attempts to scroll the element in view. The error outputs are a bit unclear as to why until digging through code.\r\n\r\nOutputs typically received:\r\n> endX is out of range\r\n\r\nor \r\n> endY is out of range\r\n\r\n### Use Cases\r\nThere are instances \"chopping\" the visible element is desired. For example, when creating a [slide-panel React component(https://github.com/cerner/terra-framework/tree/master/packages/terra-slide-panel), we close the panel, it is placed off-screen using css using `transform: translate3d(100%, 0, 0);` and then is set to `visibility: hidden;`. Using `checkElement()`, we cannot take a screenshot. \r\n\r\n### Solution\r\nAdd a screenshot option to [return the the `documentX` and `documentY` values](https://github.com/zinserjan/wdio-screenshot/blob/master/src/utils/strategies/BaseStrategy.js#L30) if the start/end x/y values are too large.\r\n\r\n"}}
{"actor":{"display_login":"emilyrohrbough"}}