{"action":"created","comment":{"url":"https://api.github.com/repos/twolfson/google-music.js/pulls/comments/47543696","id":47543696,"diff_hunk":"@@ -30,32 +32,86 @@ exports.openMusic = function (options) {\n   // Execute many async steps\n   before(function startBrowser () {\n     this.browser = wd.remote();\n+    process.argv.forEach(function eachArgument (arg) {\n+      // Uniquely identify a browserstack build based on timeout\n+      if (arg === '40000') {\n+        this.browser = wd.remote('hub.browserstack.com', 80);\n+      }\n+    }.bind(this));\n     global.browser = this.browser;\n   });\n   before(function openBrowser (done) {\n-    this.browser.init({browserName: 'chrome'}, done);\n+    var that = this;\n+    this.browser.init({\n+      browserName: 'firefox',\n+      name: 'Google Music Core Test Suite',\n+      project: 'Google Music Core Test Suite',\n+      platform: 'WIN8',\n+      'browserstack.user': BS_USER,\n+      'browserstack.key': BS_KEY\n+    }, function () {\n+      that.browser.maximize();\n+      that.browser.setAsyncScriptTimeout(30000, done);\n+    });\n   });\n   before(function navigateToMusicBeforeLogin (done) {\n     this.browser.get(url, done);\n   });\n   before(function handleLoginViaCookies (done) {\n     var browser = this.browser;\n-    async.forEach(cookies, function setCookies (cookie, cb) {\n-      // If the cookie is not for .google.com, skip it\n-      // DEV: As discovered by Burp suite's repeater, we only need `SID`, `HSID`, `SSID` but this is simpler\n-      if (cookie.domain !== '.google.com') {\n-        process.nextTick(cb);\n-      // Otherwise, set it\n-      } else {\n-        browser.setCookie(cookie, cb);\n-      }\n-    }, done);\n+    browser.elementByCssSelector('[data-action=signin]', function (err, el) {\n+      if (err) { done(err); }\n+\n+      el.click(function (err) {\n+        if (err) { done(err); }\n+\n+        browser.elementById('Email', function (err, el) {\n+          if (err) { done(err); }\n+\n+          var emailSetCondition = 'document.getElementById(\"Email\").value == \"' + username + '\"';","path":"test/utils/browser.js","position":87,"original_position":87,"commit_id":"798c753f9255173f2677792d73e32b9b7a9bbb92","original_commit_id":"798c753f9255173f2677792d73e32b9b7a9bbb92","user":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"body":"The utility is a wrapper around `browser.execute` but allows us to extract the contents of a function:\r\n\r\nhttps://github.com/twolfson/google-music.js/blob/3.3.2/test/utils/browser.js#L85-L112","created_at":"2015-12-14T19:20:06Z","updated_at":"2015-12-14T19:20:06Z","html_url":"https://github.com/twolfson/google-music.js/pull/19#discussion_r47543696","pull_request_url":"https://api.github.com/repos/twolfson/google-music.js/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/twolfson/google-music.js/pulls/comments/47543696"},"html":{"href":"https://github.com/twolfson/google-music.js/pull/19#discussion_r47543696"},"pull_request":{"href":"https://api.github.com/repos/twolfson/google-music.js/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/twolfson/google-music.js/pulls/19","id":53554573,"html_url":"https://github.com/twolfson/google-music.js/pull/19","diff_url":"https://github.com/twolfson/google-music.js/pull/19.diff","patch_url":"https://github.com/twolfson/google-music.js/pull/19.patch","issue_url":"https://api.github.com/repos/twolfson/google-music.js/issues/19","number":19,"state":"open","locked":false,"title":"Modified the test suite to get CI working on travis","user":{"login":"MarshallOfSound","id":6634592,"avatar_url":"https://avatars.githubusercontent.com/u/6634592?v=3","gravatar_id":"","url":"https://api.github.com/users/MarshallOfSound","html_url":"https://github.com/MarshallOfSound","followers_url":"https://api.github.com/users/MarshallOfSound/followers","following_url":"https://api.github.com/users/MarshallOfSound/following{/other_user}","gists_url":"https://api.github.com/users/MarshallOfSound/gists{/gist_id}","starred_url":"https://api.github.com/users/MarshallOfSound/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarshallOfSound/subscriptions","organizations_url":"https://api.github.com/users/MarshallOfSound/orgs","repos_url":"https://api.github.com/users/MarshallOfSound/repos","events_url":"https://api.github.com/users/MarshallOfSound/events{/privacy}","received_events_url":"https://api.github.com/users/MarshallOfSound/received_events","type":"User","site_admin":false},"body":"The short version\r\n-------------------\r\n* Changed the tests to run off a GPM username and password instead of a set of cookies\r\n* Fixed broken rating tests\r\n* Fixed broken shuffle methods\r\n* Made some methods Firefox friendly (selenium runs better with Firefox)\r\n* Added browserstack as a selenium target\r\n* Added a travis config file to enable CI\r\n* Increases all the timeouts for the test suite to eliminate incorrect timeout errors from running selenium remotely\r\n\r\nBut really :)\r\n-----------------\r\nTravis build for this branch can be seen [here](https://travis-ci.org/MarshallOfSound/google-music.js/builds/96723799)\r\n\r\nApologies for the massive PR, it started out tiny but I found more and more broken things in the tests :cactus: \r\n\r\nFixes #18 \r\n\r\n/cc @twolfson @jacobwgillespie @chrismou","created_at":"2015-12-14T11:46:11Z","updated_at":"2015-12-14T19:20:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09db40db96b556187be03cd48820b9a4d64e564a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twolfson/google-music.js/pulls/19/commits","review_comments_url":"https://api.github.com/repos/twolfson/google-music.js/pulls/19/comments","review_comment_url":"https://api.github.com/repos/twolfson/google-music.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twolfson/google-music.js/issues/19/comments","statuses_url":"https://api.github.com/repos/twolfson/google-music.js/statuses/798c753f9255173f2677792d73e32b9b7a9bbb92","head":{"label":"MarshallOfSound:dev/improve.testing","ref":"dev/improve.testing","sha":"798c753f9255173f2677792d73e32b9b7a9bbb92","user":{"login":"MarshallOfSound","id":6634592,"avatar_url":"https://avatars.githubusercontent.com/u/6634592?v=3","gravatar_id":"","url":"https://api.github.com/users/MarshallOfSound","html_url":"https://github.com/MarshallOfSound","followers_url":"https://api.github.com/users/MarshallOfSound/followers","following_url":"https://api.github.com/users/MarshallOfSound/following{/other_user}","gists_url":"https://api.github.com/users/MarshallOfSound/gists{/gist_id}","starred_url":"https://api.github.com/users/MarshallOfSound/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarshallOfSound/subscriptions","organizations_url":"https://api.github.com/users/MarshallOfSound/orgs","repos_url":"https://api.github.com/users/MarshallOfSound/repos","events_url":"https://api.github.com/users/MarshallOfSound/events{/privacy}","received_events_url":"https://api.github.com/users/MarshallOfSound/received_events","type":"User","site_admin":false},"repo":{"id":46157759,"name":"google-music.js","full_name":"MarshallOfSound/google-music.js","owner":{"login":"MarshallOfSound","id":6634592,"avatar_url":"https://avatars.githubusercontent.com/u/6634592?v=3","gravatar_id":"","url":"https://api.github.com/users/MarshallOfSound","html_url":"https://github.com/MarshallOfSound","followers_url":"https://api.github.com/users/MarshallOfSound/followers","following_url":"https://api.github.com/users/MarshallOfSound/following{/other_user}","gists_url":"https://api.github.com/users/MarshallOfSound/gists{/gist_id}","starred_url":"https://api.github.com/users/MarshallOfSound/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarshallOfSound/subscriptions","organizations_url":"https://api.github.com/users/MarshallOfSound/orgs","repos_url":"https://api.github.com/users/MarshallOfSound/repos","events_url":"https://api.github.com/users/MarshallOfSound/events{/privacy}","received_events_url":"https://api.github.com/users/MarshallOfSound/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MarshallOfSound/google-music.js","description":"Browser-side JS library for controlling Google Music","fork":true,"url":"https://api.github.com/repos/MarshallOfSound/google-music.js","forks_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/forks","keys_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/teams","hooks_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/hooks","issue_events_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/issues/events{/number}","events_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/events","assignees_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/assignees{/user}","branches_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/branches{/branch}","tags_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/tags","blobs_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/statuses/{sha}","languages_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/languages","stargazers_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/stargazers","contributors_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/contributors","subscribers_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/subscribers","subscription_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/subscription","commits_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/contents/{+path}","compare_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/merges","archive_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/downloads","issues_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/issues{/number}","pulls_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/pulls{/number}","milestones_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/milestones{/number}","notifications_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/labels{/name}","releases_url":"https://api.github.com/repos/MarshallOfSound/google-music.js/releases{/id}","created_at":"2015-11-14T02:09:20Z","updated_at":"2015-11-14T02:09:20Z","pushed_at":"2015-12-14T11:39:21Z","git_url":"git://github.com/MarshallOfSound/google-music.js.git","ssh_url":"git@github.com:MarshallOfSound/google-music.js.git","clone_url":"https://github.com/MarshallOfSound/google-music.js.git","svn_url":"https://github.com/MarshallOfSound/google-music.js","homepage":"","size":1747,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"twolfson:master","ref":"master","sha":"f7f79a89ac78dbde3f9cfab913718259d8794af0","user":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"repo":{"id":28583816,"name":"google-music.js","full_name":"twolfson/google-music.js","owner":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/twolfson/google-music.js","description":"Browser-side JS library for controlling Google Music","fork":false,"url":"https://api.github.com/repos/twolfson/google-music.js","forks_url":"https://api.github.com/repos/twolfson/google-music.js/forks","keys_url":"https://api.github.com/repos/twolfson/google-music.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twolfson/google-music.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twolfson/google-music.js/teams","hooks_url":"https://api.github.com/repos/twolfson/google-music.js/hooks","issue_events_url":"https://api.github.com/repos/twolfson/google-music.js/issues/events{/number}","events_url":"https://api.github.com/repos/twolfson/google-music.js/events","assignees_url":"https://api.github.com/repos/twolfson/google-music.js/assignees{/user}","branches_url":"https://api.github.com/repos/twolfson/google-music.js/branches{/branch}","tags_url":"https://api.github.com/repos/twolfson/google-music.js/tags","blobs_url":"https://api.github.com/repos/twolfson/google-music.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twolfson/google-music.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twolfson/google-music.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/twolfson/google-music.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twolfson/google-music.js/statuses/{sha}","languages_url":"https://api.github.com/repos/twolfson/google-music.js/languages","stargazers_url":"https://api.github.com/repos/twolfson/google-music.js/stargazers","contributors_url":"https://api.github.com/repos/twolfson/google-music.js/contributors","subscribers_url":"https://api.github.com/repos/twolfson/google-music.js/subscribers","subscription_url":"https://api.github.com/repos/twolfson/google-music.js/subscription","commits_url":"https://api.github.com/repos/twolfson/google-music.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/twolfson/google-music.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/twolfson/google-music.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/twolfson/google-music.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/twolfson/google-music.js/contents/{+path}","compare_url":"https://api.github.com/repos/twolfson/google-music.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twolfson/google-music.js/merges","archive_url":"https://api.github.com/repos/twolfson/google-music.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twolfson/google-music.js/downloads","issues_url":"https://api.github.com/repos/twolfson/google-music.js/issues{/number}","pulls_url":"https://api.github.com/repos/twolfson/google-music.js/pulls{/number}","milestones_url":"https://api.github.com/repos/twolfson/google-music.js/milestones{/number}","notifications_url":"https://api.github.com/repos/twolfson/google-music.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twolfson/google-music.js/labels{/name}","releases_url":"https://api.github.com/repos/twolfson/google-music.js/releases{/id}","created_at":"2014-12-29T07:12:46Z","updated_at":"2015-12-03T01:48:06Z","pushed_at":"2015-12-14T11:46:11Z","git_url":"git://github.com/twolfson/google-music.js.git","ssh_url":"git@github.com:twolfson/google-music.js.git","clone_url":"https://github.com/twolfson/google-music.js.git","svn_url":"https://github.com/twolfson/google-music.js","homepage":"","size":1716,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":9,"forks":2,"open_issues":9,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twolfson/google-music.js/pulls/19"},"html":{"href":"https://github.com/twolfson/google-music.js/pull/19"},"issue":{"href":"https://api.github.com/repos/twolfson/google-music.js/issues/19"},"comments":{"href":"https://api.github.com/repos/twolfson/google-music.js/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/twolfson/google-music.js/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/twolfson/google-music.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twolfson/google-music.js/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/twolfson/google-music.js/statuses/798c753f9255173f2677792d73e32b9b7a9bbb92"}}}}