{"action":"created","issue":{"url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher/issues/72","repository_url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher","labels_url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher/issues/72/comments","events_url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher/issues/72/events","html_url":"https://github.com/karma-runner/karma-browserstack-launcher/issues/72","id":169295843,"number":72,"title":"Send session status back to Browserstack","user":{"login":"bengummer","id":1089897,"avatar_url":"https://avatars.githubusercontent.com/u/1089897?v=3","gravatar_id":"","url":"https://api.github.com/users/bengummer","html_url":"https://github.com/bengummer","followers_url":"https://api.github.com/users/bengummer/followers","following_url":"https://api.github.com/users/bengummer/following{/other_user}","gists_url":"https://api.github.com/users/bengummer/gists{/gist_id}","starred_url":"https://api.github.com/users/bengummer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengummer/subscriptions","organizations_url":"https://api.github.com/users/bengummer/orgs","repos_url":"https://api.github.com/users/bengummer/repos","events_url":"https://api.github.com/users/bengummer/events{/privacy}","received_events_url":"https://api.github.com/users/bengummer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-04T05:44:25Z","updated_at":"2016-08-04T07:03:33Z","closed_at":null,"body":"Similar to [karma-sauce-reporter](https://github.com/karma-runner/karma-sauce-launcher/blob/master/index.js#L9), it would be nice if Browserstack sessions with test errors appear red in the Browserstack web UI. At the moment all sessions appear green.\r\n\r\nThe Browserstack [session API](https://www.browserstack.com/automate/rest-api#rest-api-sessions) could be used to send the session status to Browserstack.\r\n\r\nI've attempted to do this, but it seems that the Browserstack session URL (required to send the status back via the API) in not exposed to the reporter:\r\n\r\n```json\r\n{\r\n  \"id\": \"703600...\",\r\n  \"fullName\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36\",\r\n  \"name\": \"Chrome 52.0.2743 (Mac OS X 10.11.4)\",\r\n  \"state\": 1,\r\n  \"lastResult\": {\r\n    \"success\": 0,\r\n    \"failed\": 0,\r\n    \"skipped\": 0,\r\n    \"total\": 0,\r\n    \"totalTime\": 249808,\r\n    \"netTime\": 0,\r\n    \"error\": true,\r\n    \"disconnected\": false\r\n  },\r\n  \"disconnectsCount\": 1\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher/issues/comments/237470044","html_url":"https://github.com/karma-runner/karma-browserstack-launcher/issues/72#issuecomment-237470044","issue_url":"https://api.github.com/repos/karma-runner/karma-browserstack-launcher/issues/72","id":237470044,"user":{"login":"bengummer","id":1089897,"avatar_url":"https://avatars.githubusercontent.com/u/1089897?v=3","gravatar_id":"","url":"https://api.github.com/users/bengummer","html_url":"https://github.com/bengummer","followers_url":"https://api.github.com/users/bengummer/followers","following_url":"https://api.github.com/users/bengummer/following{/other_user}","gists_url":"https://api.github.com/users/bengummer/gists{/gist_id}","starred_url":"https://api.github.com/users/bengummer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengummer/subscriptions","organizations_url":"https://api.github.com/users/bengummer/orgs","repos_url":"https://api.github.com/users/bengummer/repos","events_url":"https://api.github.com/users/bengummer/events{/privacy}","received_events_url":"https://api.github.com/users/bengummer/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T07:03:33Z","updated_at":"2016-08-04T07:03:33Z","body":"Worked it out, please take a look at the linked PR"}}
{"actor":{"display_login":"bengummer"}}