{"action":"created","comment":{"url":"https://api.github.com/repos/smartcar/node-sdk/pulls/comments/209026913","pull_request_review_id":144960944,"id":209026913,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTAyNjkxMw==","diff_hunk":"@@ -0,0 +1,73 @@\n+'use strict';\n+\n+const Chance = require('chance');\n+\n+const chance = new Chance();\n+\n+const helpers = {};\n+\n+helpers.getAuthClientParams = function() {\n+  return {\n+    clientId: 'e922556a-7d4f-4168-88cd-059276044798',\n+    clientSecret: '79c07401-d3b2-48c0-8407-dc19c4ece7ff',\n+    redirectUri: 'http://localhost:4040/callback',\n+    development: true,\n+  };\n+};\n+\n+const getCodeFromUrl = function(uri) {\n+  // this helper functions assumes the structure of the uri\n+  // is valid and contains the code required\n+  const firstIndexOfParams = uri.indexOf('?') + 1;\n+  const params = uri.substring(firstIndexOfParams);\n+\n+  for (const param of params.split('&')) {\n+    const [code, value] = param.split('=');\n+    if (code === 'code') {\n+      return value;\n+    }\n+  }\n+};\n+\n+helpers.runTest = function(client, browser, authUrl, test, done) {\n+  const email = chance.email({domain: 'smartcar.com'});\n+  /*\n+  * (todo Karthik) remove the pauses\n+  * we will use pause here to allow for the callback to execute\n+  * until we can neatly run an async nightwatch callback\n+  **/\n+  browser\n+    .url(authUrl)\n+    .waitForElementVisible('div[class=content]', 1000)\n+    .click('a[href^=\"https://mock.smartcar.com\"]')\n+    // login dialog is rendered\n+    .waitForElementVisible('input[id=username]', 1500)\n+    // add username/password and submit\n+    .setValue('input[id=username]', email)\n+    .setValue('input[id=password]', 'password')\n+    .click('button[id=approval-button]')\n+    .url((currentUrl) => {\n+      if (currentUrl.value.startsWith('http://localhost:4040/callback')) {\n+        // if we have skipped the permissions, we can extract the code\n+        test(getCodeFromUrl(currentUrl.value));\n+        browser\n+          .pause(5000)","path":"test/end-to-end/helpers/index.js","position":54,"original_position":54,"commit_id":"ab26635d34e4e2d1a240f1a89519272e5d013e70","original_commit_id":"ab26635d34e4e2d1a240f1a89519272e5d013e70","user":{"login":"RogWilco","id":325622,"node_id":"MDQ6VXNlcjMyNTYyMg==","avatar_url":"https://avatars3.githubusercontent.com/u/325622?v=4","gravatar_id":"","url":"https://api.github.com/users/RogWilco","html_url":"https://github.com/RogWilco","followers_url":"https://api.github.com/users/RogWilco/followers","following_url":"https://api.github.com/users/RogWilco/following{/other_user}","gists_url":"https://api.github.com/users/RogWilco/gists{/gist_id}","starred_url":"https://api.github.com/users/RogWilco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RogWilco/subscriptions","organizations_url":"https://api.github.com/users/RogWilco/orgs","repos_url":"https://api.github.com/users/RogWilco/repos","events_url":"https://api.github.com/users/RogWilco/events{/privacy}","received_events_url":"https://api.github.com/users/RogWilco/received_events","type":"User","site_admin":false},"body":"Just curious, what does this pause (and the similar one below) do?","created_at":"2018-08-09T18:06:31Z","updated_at":"2018-08-09T18:35:23Z","html_url":"https://github.com/smartcar/node-sdk/pull/61#discussion_r209026913","pull_request_url":"https://api.github.com/repos/smartcar/node-sdk/pulls/61","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/smartcar/node-sdk/pulls/comments/209026913"},"html":{"href":"https://github.com/smartcar/node-sdk/pull/61#discussion_r209026913"},"pull_request":{"href":"https://api.github.com/repos/smartcar/node-sdk/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/smartcar/node-sdk/pulls/61","id":205858458,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1ODU4NDU4","html_url":"https://github.com/smartcar/node-sdk/pull/61","diff_url":"https://github.com/smartcar/node-sdk/pull/61.diff","patch_url":"https://github.com/smartcar/node-sdk/pull/61.patch","issue_url":"https://api.github.com/repos/smartcar/node-sdk/issues/61","number":61,"state":"open","locked":false,"title":"End to end tests","user":{"login":"KarthikBhaskara","id":8335426,"node_id":"MDQ6VXNlcjgzMzU0MjY=","avatar_url":"https://avatars0.githubusercontent.com/u/8335426?v=4","gravatar_id":"","url":"https://api.github.com/users/KarthikBhaskara","html_url":"https://github.com/KarthikBhaskara","followers_url":"https://api.github.com/users/KarthikBhaskara/followers","following_url":"https://api.github.com/users/KarthikBhaskara/following{/other_user}","gists_url":"https://api.github.com/users/KarthikBhaskara/gists{/gist_id}","starred_url":"https://api.github.com/users/KarthikBhaskara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarthikBhaskara/subscriptions","organizations_url":"https://api.github.com/users/KarthikBhaskara/orgs","repos_url":"https://api.github.com/users/KarthikBhaskara/repos","events_url":"https://api.github.com/users/KarthikBhaskara/events{/privacy}","received_events_url":"https://api.github.com/users/KarthikBhaskara/received_events","type":"User","site_admin":false},"body":"## Description\r\nAdded end to end tests for the SDK.\r\n\r\nThe e2e tests are required to run serially so I've added a new script for it -\r\n```npm run test:e2e```.\r\n\r\n## Reviewer Checklist\r\n\r\n- [ ]  All endpoints have been tested\r\n- [ ] All existing and new tests run with the ```npm test``` command without throwing any errors. ","created_at":"2018-08-02T20:54:26Z","updated_at":"2018-08-09T18:35:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1723570d426ddb181f2aa3e185b0b6194d40091","assignee":null,"assignees":[],"requested_reviewers":[{"login":"GregChan","id":5120058,"node_id":"MDQ6VXNlcjUxMjAwNTg=","avatar_url":"https://avatars3.githubusercontent.com/u/5120058?v=4","gravatar_id":"","url":"https://api.github.com/users/GregChan","html_url":"https://github.com/GregChan","followers_url":"https://api.github.com/users/GregChan/followers","following_url":"https://api.github.com/users/GregChan/following{/other_user}","gists_url":"https://api.github.com/users/GregChan/gists{/gist_id}","starred_url":"https://api.github.com/users/GregChan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GregChan/subscriptions","organizations_url":"https://api.github.com/users/GregChan/orgs","repos_url":"https://api.github.com/users/GregChan/repos","events_url":"https://api.github.com/users/GregChan/events{/privacy}","received_events_url":"https://api.github.com/users/GregChan/received_events","type":"User","site_admin":false},{"login":"gurpreetatwal","id":7547554,"node_id":"MDQ6VXNlcjc1NDc1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/7547554?v=4","gravatar_id":"","url":"https://api.github.com/users/gurpreetatwal","html_url":"https://github.com/gurpreetatwal","followers_url":"https://api.github.com/users/gurpreetatwal/followers","following_url":"https://api.github.com/users/gurpreetatwal/following{/other_user}","gists_url":"https://api.github.com/users/gurpreetatwal/gists{/gist_id}","starred_url":"https://api.github.com/users/gurpreetatwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gurpreetatwal/subscriptions","organizations_url":"https://api.github.com/users/gurpreetatwal/orgs","repos_url":"https://api.github.com/users/gurpreetatwal/repos","events_url":"https://api.github.com/users/gurpreetatwal/events{/privacy}","received_events_url":"https://api.github.com/users/gurpreetatwal/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":400608728,"node_id":"MDU6TGFiZWw0MDA2MDg3Mjg=","url":"https://api.github.com/repos/smartcar/node-sdk/labels/Type:%20Enhancement","name":"Type: Enhancement","color":"1976D2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/smartcar/node-sdk/pulls/61/commits","review_comments_url":"https://api.github.com/repos/smartcar/node-sdk/pulls/61/comments","review_comment_url":"https://api.github.com/repos/smartcar/node-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smartcar/node-sdk/issues/61/comments","statuses_url":"https://api.github.com/repos/smartcar/node-sdk/statuses/ab26635d34e4e2d1a240f1a89519272e5d013e70","head":{"label":"smartcar:end-to-end-test","ref":"end-to-end-test","sha":"ab26635d34e4e2d1a240f1a89519272e5d013e70","user":{"login":"smartcar","id":11840303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODQwMzAz","avatar_url":"https://avatars2.githubusercontent.com/u/11840303?v=4","gravatar_id":"","url":"https://api.github.com/users/smartcar","html_url":"https://github.com/smartcar","followers_url":"https://api.github.com/users/smartcar/followers","following_url":"https://api.github.com/users/smartcar/following{/other_user}","gists_url":"https://api.github.com/users/smartcar/gists{/gist_id}","starred_url":"https://api.github.com/users/smartcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartcar/subscriptions","organizations_url":"https://api.github.com/users/smartcar/orgs","repos_url":"https://api.github.com/users/smartcar/repos","events_url":"https://api.github.com/users/smartcar/events{/privacy}","received_events_url":"https://api.github.com/users/smartcar/received_events","type":"Organization","site_admin":false},"repo":{"id":62264697,"node_id":"MDEwOlJlcG9zaXRvcnk2MjI2NDY5Nw==","name":"node-sdk","full_name":"smartcar/node-sdk","owner":{"login":"smartcar","id":11840303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODQwMzAz","avatar_url":"https://avatars2.githubusercontent.com/u/11840303?v=4","gravatar_id":"","url":"https://api.github.com/users/smartcar","html_url":"https://github.com/smartcar","followers_url":"https://api.github.com/users/smartcar/followers","following_url":"https://api.github.com/users/smartcar/following{/other_user}","gists_url":"https://api.github.com/users/smartcar/gists{/gist_id}","starred_url":"https://api.github.com/users/smartcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartcar/subscriptions","organizations_url":"https://api.github.com/users/smartcar/orgs","repos_url":"https://api.github.com/users/smartcar/repos","events_url":"https://api.github.com/users/smartcar/events{/privacy}","received_events_url":"https://api.github.com/users/smartcar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smartcar/node-sdk","description":"Smartcar Node.js SDK","fork":false,"url":"https://api.github.com/repos/smartcar/node-sdk","forks_url":"https://api.github.com/repos/smartcar/node-sdk/forks","keys_url":"https://api.github.com/repos/smartcar/node-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartcar/node-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartcar/node-sdk/teams","hooks_url":"https://api.github.com/repos/smartcar/node-sdk/hooks","issue_events_url":"https://api.github.com/repos/smartcar/node-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/smartcar/node-sdk/events","assignees_url":"https://api.github.com/repos/smartcar/node-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/smartcar/node-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/smartcar/node-sdk/tags","blobs_url":"https://api.github.com/repos/smartcar/node-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartcar/node-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartcar/node-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartcar/node-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartcar/node-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/smartcar/node-sdk/languages","stargazers_url":"https://api.github.com/repos/smartcar/node-sdk/stargazers","contributors_url":"https://api.github.com/repos/smartcar/node-sdk/contributors","subscribers_url":"https://api.github.com/repos/smartcar/node-sdk/subscribers","subscription_url":"https://api.github.com/repos/smartcar/node-sdk/subscription","commits_url":"https://api.github.com/repos/smartcar/node-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartcar/node-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartcar/node-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartcar/node-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartcar/node-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/smartcar/node-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartcar/node-sdk/merges","archive_url":"https://api.github.com/repos/smartcar/node-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartcar/node-sdk/downloads","issues_url":"https://api.github.com/repos/smartcar/node-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/smartcar/node-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/smartcar/node-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/smartcar/node-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartcar/node-sdk/labels{/name}","releases_url":"https://api.github.com/repos/smartcar/node-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/smartcar/node-sdk/deployments","created_at":"2016-06-29T23:35:13Z","updated_at":"2018-08-02T20:27:05Z","pushed_at":"2018-08-08T21:45:05Z","git_url":"git://github.com/smartcar/node-sdk.git","ssh_url":"git@github.com:smartcar/node-sdk.git","clone_url":"https://github.com/smartcar/node-sdk.git","svn_url":"https://github.com/smartcar/node-sdk","homepage":null,"size":298,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"smartcar:master","ref":"master","sha":"bf3a1c52e2ade07e542d1bbc27176bef9b917623","user":{"login":"smartcar","id":11840303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODQwMzAz","avatar_url":"https://avatars2.githubusercontent.com/u/11840303?v=4","gravatar_id":"","url":"https://api.github.com/users/smartcar","html_url":"https://github.com/smartcar","followers_url":"https://api.github.com/users/smartcar/followers","following_url":"https://api.github.com/users/smartcar/following{/other_user}","gists_url":"https://api.github.com/users/smartcar/gists{/gist_id}","starred_url":"https://api.github.com/users/smartcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartcar/subscriptions","organizations_url":"https://api.github.com/users/smartcar/orgs","repos_url":"https://api.github.com/users/smartcar/repos","events_url":"https://api.github.com/users/smartcar/events{/privacy}","received_events_url":"https://api.github.com/users/smartcar/received_events","type":"Organization","site_admin":false},"repo":{"id":62264697,"node_id":"MDEwOlJlcG9zaXRvcnk2MjI2NDY5Nw==","name":"node-sdk","full_name":"smartcar/node-sdk","owner":{"login":"smartcar","id":11840303,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODQwMzAz","avatar_url":"https://avatars2.githubusercontent.com/u/11840303?v=4","gravatar_id":"","url":"https://api.github.com/users/smartcar","html_url":"https://github.com/smartcar","followers_url":"https://api.github.com/users/smartcar/followers","following_url":"https://api.github.com/users/smartcar/following{/other_user}","gists_url":"https://api.github.com/users/smartcar/gists{/gist_id}","starred_url":"https://api.github.com/users/smartcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartcar/subscriptions","organizations_url":"https://api.github.com/users/smartcar/orgs","repos_url":"https://api.github.com/users/smartcar/repos","events_url":"https://api.github.com/users/smartcar/events{/privacy}","received_events_url":"https://api.github.com/users/smartcar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smartcar/node-sdk","description":"Smartcar Node.js SDK","fork":false,"url":"https://api.github.com/repos/smartcar/node-sdk","forks_url":"https://api.github.com/repos/smartcar/node-sdk/forks","keys_url":"https://api.github.com/repos/smartcar/node-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartcar/node-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartcar/node-sdk/teams","hooks_url":"https://api.github.com/repos/smartcar/node-sdk/hooks","issue_events_url":"https://api.github.com/repos/smartcar/node-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/smartcar/node-sdk/events","assignees_url":"https://api.github.com/repos/smartcar/node-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/smartcar/node-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/smartcar/node-sdk/tags","blobs_url":"https://api.github.com/repos/smartcar/node-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartcar/node-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartcar/node-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartcar/node-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartcar/node-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/smartcar/node-sdk/languages","stargazers_url":"https://api.github.com/repos/smartcar/node-sdk/stargazers","contributors_url":"https://api.github.com/repos/smartcar/node-sdk/contributors","subscribers_url":"https://api.github.com/repos/smartcar/node-sdk/subscribers","subscription_url":"https://api.github.com/repos/smartcar/node-sdk/subscription","commits_url":"https://api.github.com/repos/smartcar/node-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartcar/node-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartcar/node-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartcar/node-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartcar/node-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/smartcar/node-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartcar/node-sdk/merges","archive_url":"https://api.github.com/repos/smartcar/node-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartcar/node-sdk/downloads","issues_url":"https://api.github.com/repos/smartcar/node-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/smartcar/node-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/smartcar/node-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/smartcar/node-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartcar/node-sdk/labels{/name}","releases_url":"https://api.github.com/repos/smartcar/node-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/smartcar/node-sdk/deployments","created_at":"2016-06-29T23:35:13Z","updated_at":"2018-08-02T20:27:05Z","pushed_at":"2018-08-08T21:45:05Z","git_url":"git://github.com/smartcar/node-sdk.git","ssh_url":"git@github.com:smartcar/node-sdk.git","clone_url":"https://github.com/smartcar/node-sdk.git","svn_url":"https://github.com/smartcar/node-sdk","homepage":null,"size":298,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smartcar/node-sdk/pulls/61"},"html":{"href":"https://github.com/smartcar/node-sdk/pull/61"},"issue":{"href":"https://api.github.com/repos/smartcar/node-sdk/issues/61"},"comments":{"href":"https://api.github.com/repos/smartcar/node-sdk/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/smartcar/node-sdk/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/smartcar/node-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smartcar/node-sdk/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/smartcar/node-sdk/statuses/ab26635d34e4e2d1a240f1a89519272e5d013e70"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"RogWilco"}}