{"action":"created","issue":{"url":"https://api.github.com/repos/xolvio/chimp/issues/236","labels_url":"https://api.github.com/repos/xolvio/chimp/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/xolvio/chimp/issues/236/comments","events_url":"https://api.github.com/repos/xolvio/chimp/issues/236/events","html_url":"https://github.com/xolvio/chimp/issues/236","id":128042558,"number":236,"title":"Issues with WebdriverCSS and wrapAsync","user":{"login":"nichite","id":12077085,"avatar_url":"https://avatars.githubusercontent.com/u/12077085?v=3","gravatar_id":"","url":"https://api.github.com/users/nichite","html_url":"https://github.com/nichite","followers_url":"https://api.github.com/users/nichite/followers","following_url":"https://api.github.com/users/nichite/following{/other_user}","gists_url":"https://api.github.com/users/nichite/gists{/gist_id}","starred_url":"https://api.github.com/users/nichite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nichite/subscriptions","organizations_url":"https://api.github.com/users/nichite/orgs","repos_url":"https://api.github.com/users/nichite/repos","events_url":"https://api.github.com/users/nichite/events{/privacy}","received_events_url":"https://api.github.com/users/nichite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-21T23:06:12Z","updated_at":"2016-01-27T22:50:25Z","closed_at":null,"body":"The feature of wrapping asynchronous methods with wrapAsync doesn't seem to work properly on the webdrivercss command for taking css diff screenshots. The call to the function looks like this:\r\n\r\n```javascript\r\nbrowser.webdrivercss('body', {\r\n          name: 'body',\r\n          elem: 'body'\r\n        }, function (err, res){\r\n          assert.ifError(err);\r\n          assert.ok(res.body.isWithinMisMatchTolerance);\r\n        });\r\n```\r\nIt looks to be in the standard style where the last argument is a cb that takes err, res as arguments. According to what I've read, `wrapAsync` should be able to handle this.\r\n\r\nI've wrapped the function to be synchronous like this:\r\n\r\n```javascript\r\nvar cssSync = wrapAsync(browser.webdrivercss);\r\n\r\nvar res = cssSync('body', {\r\n    name: 'body',\r\n    elem: 'body'\r\n  });\r\n\r\nassert.ok(res.body.isWithinMisMatchTolerance);\r\n```\r\n\r\nStill, whenever I run this I get the error: `Can't wait without a fiber`.\r\n\r\nI've also tried passing in `browser` or `this` as contexts, just in case. No dice.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/xolvio/chimp/issues/comments/175900801","html_url":"https://github.com/xolvio/chimp/issues/236#issuecomment-175900801","issue_url":"https://api.github.com/repos/xolvio/chimp/issues/236","id":175900801,"user":{"login":"Sanjo","id":727955,"avatar_url":"https://avatars.githubusercontent.com/u/727955?v=3","gravatar_id":"","url":"https://api.github.com/users/Sanjo","html_url":"https://github.com/Sanjo","followers_url":"https://api.github.com/users/Sanjo/followers","following_url":"https://api.github.com/users/Sanjo/following{/other_user}","gists_url":"https://api.github.com/users/Sanjo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sanjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sanjo/subscriptions","organizations_url":"https://api.github.com/users/Sanjo/orgs","repos_url":"https://api.github.com/users/Sanjo/repos","events_url":"https://api.github.com/users/Sanjo/events{/privacy}","received_events_url":"https://api.github.com/users/Sanjo/received_events","type":"User","site_admin":false},"created_at":"2016-01-27T22:50:25Z","updated_at":"2016-01-27T22:50:25Z","body":"Ok. So probably some asynchronous code in webdrivercss that is not wrapped automatically with wrapAsync causes the callback to not be in the fiber. To fix that we need to create a sync-webdrivercss package that patches the webdrivercss package, to work with fibers. Like we did with webdriver already (https://github.com/xolvio/sync-webdriverio). Or a fork of webdrivercss, if the patching is too hard."}}