{"action":"created","issue":{"url":"https://api.github.com/repos/percy/percy-webdriverio/issues/22","repository_url":"https://api.github.com/repos/percy/percy-webdriverio","labels_url":"https://api.github.com/repos/percy/percy-webdriverio/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/percy/percy-webdriverio/issues/22/comments","events_url":"https://api.github.com/repos/percy/percy-webdriverio/issues/22/events","html_url":"https://github.com/percy/percy-webdriverio/issues/22","id":259676322,"number":22,"title":"Standalone support","user":{"login":"selenium-tester","id":25379031,"avatar_url":"https://avatars2.githubusercontent.com/u/25379031?v=4","gravatar_id":"","url":"https://api.github.com/users/selenium-tester","html_url":"https://github.com/selenium-tester","followers_url":"https://api.github.com/users/selenium-tester/followers","following_url":"https://api.github.com/users/selenium-tester/following{/other_user}","gists_url":"https://api.github.com/users/selenium-tester/gists{/gist_id}","starred_url":"https://api.github.com/users/selenium-tester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selenium-tester/subscriptions","organizations_url":"https://api.github.com/users/selenium-tester/orgs","repos_url":"https://api.github.com/users/selenium-tester/repos","events_url":"https://api.github.com/users/selenium-tester/events{/privacy}","received_events_url":"https://api.github.com/users/selenium-tester/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-22T01:14:40Z","updated_at":"2017-09-27T08:34:59Z","closed_at":"2017-09-27T08:34:59Z","author_association":"NONE","body":"We use WebdriverIO in standalone mode for our browser tests, along with Spectron (which uses WebdriverIO underneath) for testing our Electron-based desktop apps. Is it on the road map to make this compatible with WDIO standalone? The idea behind Percy is great, and it would be nice to have the option of leveraging it as a drop-in module with config via CLI arguments, in addition to plugging into various tools directly.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/percy/percy-webdriverio/issues/comments/332450268","html_url":"https://github.com/percy/percy-webdriverio/issues/22#issuecomment-332450268","issue_url":"https://api.github.com/repos/percy/percy-webdriverio/issues/22","id":332450268,"user":{"login":"mfazekas","id":52435,"avatar_url":"https://avatars1.githubusercontent.com/u/52435?v=4","gravatar_id":"","url":"https://api.github.com/users/mfazekas","html_url":"https://github.com/mfazekas","followers_url":"https://api.github.com/users/mfazekas/followers","following_url":"https://api.github.com/users/mfazekas/following{/other_user}","gists_url":"https://api.github.com/users/mfazekas/gists{/gist_id}","starred_url":"https://api.github.com/users/mfazekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfazekas/subscriptions","organizations_url":"https://api.github.com/users/mfazekas/orgs","repos_url":"https://api.github.com/users/mfazekas/repos","events_url":"https://api.github.com/users/mfazekas/events{/privacy}","received_events_url":"https://api.github.com/users/mfazekas/received_events","type":"User","site_admin":false},"created_at":"2017-09-27T08:34:59Z","updated_at":"2017-09-27T08:34:59Z","author_association":"COLLABORATOR","body":"@selenium-tester `onPrepare` and `onComplete` is not magic. \r\n`onComplete` runs before any tests were started\r\n`onPrepare` runs after all tests were finished\r\n\r\nI'd expect all test frameworks to have hooks for that. So you need to call this before any test started:\r\n\r\n\r\n```\r\nvar percy = require('@percy-io/percy-webdriverio');\r\n```\r\n\r\nvar assetLoaders = [percy.assetLoader('filesystem', { buildDir: 'compiled-assets-dir', mountPath: '/assets' })];\r\nreturn percy.createBuild(assetLoaders);\r\n```\r\n\r\nand you need to call this after all tests ended\r\n\r\n```\r\nreturn percy.finalizeBuild();\r\n```\r\n\r\nOne thing you have to be carefull is that `percy.createBuild(assetLoaders)`  and `percy.finalizeBuild()` returns a promise, which you should wait for.\r\n\r\nI'm closing this now, as the above should solve the issue, let us know if it doesn't.\r\n"}}
{"actor":{"display_login":"mfazekas"}}