{"action":"created","issue":{"url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/80","repository_url":"https://api.github.com/repos/zinserjan/wdio-screenshot","labels_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/80/comments","events_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/80/events","html_url":"https://github.com/zinserjan/wdio-screenshot/issues/80","id":262905989,"number":80,"title":"\"value\" argument is out of bounds when scrolling at bottom","user":{"login":"KenzoM","id":10217112,"avatar_url":"https://avatars1.githubusercontent.com/u/10217112?v=4","gravatar_id":"","url":"https://api.github.com/users/KenzoM","html_url":"https://github.com/KenzoM","followers_url":"https://api.github.com/users/KenzoM/followers","following_url":"https://api.github.com/users/KenzoM/following{/other_user}","gists_url":"https://api.github.com/users/KenzoM/gists{/gist_id}","starred_url":"https://api.github.com/users/KenzoM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KenzoM/subscriptions","organizations_url":"https://api.github.com/users/KenzoM/orgs","repos_url":"https://api.github.com/users/KenzoM/repos","events_url":"https://api.github.com/users/KenzoM/events{/privacy}","received_events_url":"https://api.github.com/users/KenzoM/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-04T19:39:21Z","updated_at":"2017-10-11T16:12:56Z","closed_at":null,"author_association":"NONE","body":"## The problem\r\n### [Pertain the same issue in wdio-visual-regression](https://github.com/zinserjan/wdio-visual-regression-service/issues/52)\r\n\r\nI'm facing issues when I am trying to take screenshots and applying visual regression (with multiple different viewports to check desktop and mobile view) at the bottom of a page.\r\n\r\nThis is the error I am faced with: `TypeError: \"value\" argument is out of bounds`\r\n\r\n**test.js**\r\n\r\n\r\n```\r\ndescribe('bottom scroll', () => {\r\n\tbeforeEach(() => {\r\n\t\tbrowser.url('http://webdriver.io/')\r\n\t\tbrowser.scroll('footer')\r\n\t})\r\n\r\n\tit('should take visual regression test at footer', () => {\r\n\t\tconst fileName = './myscreenshots/test.png'\r\n\t\tbrowser.saveViewportScreenshot(fileName);\r\n\t})\r\n\r\n})\r\n\r\n```\r\n**wdio.js**\r\n\r\n    var path = require('path');\r\n    var VisualRegressionCompare = require('wdio-visual-regression-service/compare');\r\n    \r\n    function getScreenshotName(basePath) {\r\n      return function(context) {\r\n        var type = context.type;\r\n        var testName = context.test.title;\r\n        var browserVersion = parseInt(context.browser.version, 10);\r\n        var browserName = context.browser.name;\r\n        var browserViewport = context.meta.viewport;\r\n        var browserWidth = browserViewport.width;\r\n        var browserHeight = browserViewport.height;\r\n    \r\n        return path.join(basePath, `${testName}_${type}_${browserName}_v${browserVersion}_${browserWidth}x${browserHeight}.png`);\r\n      };\r\n    }\r\n    \r\n    \r\n    exports.config = {\r\n    \r\n        specs: [\r\n            './test/specs/**/*.js'\r\n        ],\r\n    \r\n        exclude: [\r\n    \r\n        ],\r\n    \r\n        maxInstances: 10,\r\n    \r\n        capabilities: [{\r\n            maxInstances: 5,\r\n            browserName: 'chrome',\r\n        }],\r\n        sync: true,\r\n    \r\n        logLevel: 'silent',\r\n    \r\n        coloredLogs: true,\r\n    \r\n        bail: 0,\r\n    \r\n        screenshotPath: './errorShots/',\r\n    \r\n        baseUrl: '/',\r\n    \r\n        waitforTimeout: 10000,\r\n    \r\n        connectionRetryTimeout: 90000,\r\n    \r\n        connectionRetryCount: 3,\r\n    \r\n        services: ['visual-regression'],\r\n        visualRegression: {\r\n            compare: new VisualRegressionCompare.LocalCompare({\r\n                referenceName: getScreenshotName(path.join(process.cwd(), 'screenshots/reference')),\r\n                screenshotName: getScreenshotName(path.join(process.cwd(), 'screenshots/screen')),\r\n                diffName: getScreenshotName(path.join(process.cwd(), 'screenshots/diff')),\r\n                misMatchTolerance: 0.01,\r\n            }),\r\n            viewportChangePause: 300,\r\n            viewports: [{ width: 320, height: 480 }, { width: 480, height: 320 }, { width: 1024, height: 768 }],\r\n        },\r\n    \r\n        framework: 'jasmine',\r\n    \r\n        reporters: ['dot','spec'],\r\n    \r\n        // Options to be passed to Jasmine.\r\n        jasmineNodeOpts: {\r\n            //\r\n            // Jasmine default timeout\r\n            defaultTimeoutInterval: 1000000,\r\n            //\r\n            // The Jasmine framework allows interception of each assertion in order to log the state of the application\r\n            // or website depending on the result. For example, it is pretty handy to take a screenshot every time\r\n            // an assertion fails.\r\n            expectationResultHandler: function(passed, assertion) {\r\n                // do something\r\n            }\r\n        },\r\n    \r\n        port: '9515',\r\n        path: '/',\r\n        \r\n    }\r\n\r\nIt seems to work fine when I use visual regression at the top of the page, but when I scroll to the bottom it breaks.\r\n\r\nI've managed to take screenshot with `saveScreenShot()` API, and that worked fine, but not much luck on the `checkViewPort()`\r\n\r\n\r\n\r\n## Environment\r\n\r\n* WebdriverIO version: 4.8.0\r\n* Node.js version: 6.6\r\n* [Standalone mode or wdio testrunner](http://webdriver.io/guide/getstarted/modes.html): chromedriver\r\n* if wdio testrunner, running synchronous or asynchronous tests:\r\n* Additional wdio packages used (if applicable):  wdio-visual-regression-service\r\n\r\n## Link to Selenium/WebdriverIO logs\r\n\r\n```\r\n1) mobile view bottom scrollsuite1 should take visual regression test at footer:\r\nTypeError: \"value\" argument is out of bounds\r\nrunning chrome\r\nTypeError: \"value\" argument is out of bounds\r\n    at checkInt (buffer.js:1011:11)\r\n    at Buffer.writeUInt32BE (buffer.js:1104:5)\r\n    at _combinedTickCallback (internal/process/next_tick.js:67:7)\r\n    at process._tickDomainCallback (internal/process/next_tick.js:122:9)\r\n```\r\n\r\n\r\nPlease remember that, with sample code; it's easier to reproduce bug and much faster to fix it.\r\n"},"comment":{"url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/comments/335863321","html_url":"https://github.com/zinserjan/wdio-screenshot/issues/80#issuecomment-335863321","issue_url":"https://api.github.com/repos/zinserjan/wdio-screenshot/issues/80","id":335863321,"user":{"login":"KenzoM","id":10217112,"avatar_url":"https://avatars1.githubusercontent.com/u/10217112?v=4","gravatar_id":"","url":"https://api.github.com/users/KenzoM","html_url":"https://github.com/KenzoM","followers_url":"https://api.github.com/users/KenzoM/followers","following_url":"https://api.github.com/users/KenzoM/following{/other_user}","gists_url":"https://api.github.com/users/KenzoM/gists{/gist_id}","starred_url":"https://api.github.com/users/KenzoM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KenzoM/subscriptions","organizations_url":"https://api.github.com/users/KenzoM/orgs","repos_url":"https://api.github.com/users/KenzoM/repos","events_url":"https://api.github.com/users/KenzoM/events{/privacy}","received_events_url":"https://api.github.com/users/KenzoM/received_events","type":"User","site_admin":false},"created_at":"2017-10-11T16:12:56Z","updated_at":"2017-10-11T16:12:56Z","author_association":"NONE","body":"Just wondering, any progress in this issue?"}}
{"actor":{"display_login":"KenzoM"}}