{"action":"created","comment":{"url":"https://api.github.com/repos/angular/protractor/pulls/comments/30829827","id":30829827,"diff_hunk":"@@ -85,64 +85,224 @@ the output of Protractor by returning a results object.\n Plugins are node modules which export an object with the following API:\n \n ```js\n-/*\n+/**\n  * Sets up plugins before tests are run. This is called after the WebDriver\n  * session has been started, but before the test framework has been set up.\n  *\n- * @param {Object} config The plugin configuration object. Note that\n- *     this is not the entire Protractor config object, just the\n- *     entry in the plugins array for this plugin.\n+ * @this {Object} bound to module.exports\n+ *\n+ * @throws {*} If this function throws an error, a failed assertion is added to\n+ *     the test results.\n  *\n- * @return Object If an object is returned, it is merged with the Protractor\n- *     result object. May return a promise.\n+ * @return {q.Promise=} Can return a promise, in which case protractor will wait\n+ *     for the promise to resolve before continuing.  If the promise is\n+ *     rejected, a failed assertion is added to the test results.\n  */\n-exports.setup = function(config) {};\n+exports.setup = function() {};\n \n-/*\n+/**\n  * This is called after the tests have been run, but before the WebDriver\n  * session has been terminated.\n  *\n- * @param {Object} config The plugin configuration object.\n+ * @this {Object} bound to module.exports\n+ *\n+ * @throws {*} If this function throws an error, a failed assertion is added to\n+ *     the test results.\n  *\n- * @return Object If an object is returned, it is merged with the Protractor\n- *     result object. May return a promise.\n+ * @return {q.Promise=} Can return a promise, in which case protractor will wait\n+ *     for the promise to resolve before continuing.  If the promise is\n+ *     rejected, a failed assertion is added to the test results.\n  */\n-exports.teardown = function(config) {};\n+exports.teardown = function() {};\n \n-/*\n+/**\n  * Called after the test results have been finalized and any jobs have been\n  * updated (if applicable).\n  *\n- * @param {Object} config The plugin configuration object.\n+ * @this {Object} bound to module.exports\n+ *\n+ * @throws {*} If this function throws an error, it is outputted to the console\n  *\n- * @return Return values are ignored.\n+ * @return {q.Promise=} Can return a promise, in which case protractor will wait\n+ *     for the promise to resolve before continuing.  If the promise is\n+ *     rejected, a failed assertion is added to the test results.","path":"docs/plugins.md","position":59,"original_position":59,"commit_id":"86e15837dc775194c12df5c66648add96f946ac4","original_commit_id":"86e15837dc775194c12df5c66648add96f946ac4","user":{"login":"sjelin","id":4841675,"avatar_url":"https://avatars.githubusercontent.com/u/4841675?v=3","gravatar_id":"","url":"https://api.github.com/users/sjelin","html_url":"https://github.com/sjelin","followers_url":"https://api.github.com/users/sjelin/followers","following_url":"https://api.github.com/users/sjelin/following{/other_user}","gists_url":"https://api.github.com/users/sjelin/gists{/gist_id}","starred_url":"https://api.github.com/users/sjelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjelin/subscriptions","organizations_url":"https://api.github.com/users/sjelin/orgs","repos_url":"https://api.github.com/users/sjelin/repos","events_url":"https://api.github.com/users/sjelin/events{/privacy}","received_events_url":"https://api.github.com/users/sjelin/received_events","type":"User","site_admin":false},"body":"Good catch.  However, protractor really will wait on a promise if it's returned.  And if the promise is rejected, an error will be logged to the console now","created_at":"2015-05-21T18:08:33Z","updated_at":"2015-05-21T18:08:33Z","html_url":"https://github.com/angular/protractor/pull/2104#discussion_r30829827","pull_request_url":"https://api.github.com/repos/angular/protractor/pulls/2104","_links":{"self":{"href":"https://api.github.com/repos/angular/protractor/pulls/comments/30829827"},"html":{"href":"https://github.com/angular/protractor/pull/2104#discussion_r30829827"},"pull_request":{"href":"https://api.github.com/repos/angular/protractor/pulls/2104"}}},"pull_request":{"url":"https://api.github.com/repos/angular/protractor/pulls/2104","id":34528942,"html_url":"https://github.com/angular/protractor/pull/2104","diff_url":"https://github.com/angular/protractor/pull/2104.diff","patch_url":"https://github.com/angular/protractor/pull/2104.patch","issue_url":"https://api.github.com/repos/angular/protractor/issues/2104","number":2104,"state":"open","locked":false,"title":"feat(plugins): Plugin API refactoring & expansion","user":{"login":"sjelin","id":4841675,"avatar_url":"https://avatars.githubusercontent.com/u/4841675?v=3","gravatar_id":"","url":"https://api.github.com/users/sjelin","html_url":"https://github.com/sjelin","followers_url":"https://api.github.com/users/sjelin/followers","following_url":"https://api.github.com/users/sjelin/following{/other_user}","gists_url":"https://api.github.com/users/sjelin/gists{/gist_id}","starred_url":"https://api.github.com/users/sjelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjelin/subscriptions","organizations_url":"https://api.github.com/users/sjelin/orgs","repos_url":"https://api.github.com/users/sjelin/repos","events_url":"https://api.github.com/users/sjelin/events{/privacy}","received_events_url":"https://api.github.com/users/sjelin/received_events","type":"User","site_admin":false},"body":"* Changed the plugin API so that it is more uniform (see docs/plugins.md)\r\n* Updated existing plugins to the new API\r\n* Added the `rewriteURL`, `onPageLoad`, and `onPageSync` entry points for plugins for modifying `browser.get`\r\n* Added the `waitForPromise` and `waitForCondition` entry points for plugins for modifying `waitForAngular`\r\n* Added tests\r\n\r\nThis closes #2126 and helps out @andresdominguez ","created_at":"2015-05-01T09:32:51Z","updated_at":"2015-05-21T18:08:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"198d56be35b933b32410875b816e663b3f688288","assignee":{"login":"juliemr","id":2081709,"avatar_url":"https://avatars.githubusercontent.com/u/2081709?v=3","gravatar_id":"","url":"https://api.github.com/users/juliemr","html_url":"https://github.com/juliemr","followers_url":"https://api.github.com/users/juliemr/followers","following_url":"https://api.github.com/users/juliemr/following{/other_user}","gists_url":"https://api.github.com/users/juliemr/gists{/gist_id}","starred_url":"https://api.github.com/users/juliemr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliemr/subscriptions","organizations_url":"https://api.github.com/users/juliemr/orgs","repos_url":"https://api.github.com/users/juliemr/repos","events_url":"https://api.github.com/users/juliemr/events{/privacy}","received_events_url":"https://api.github.com/users/juliemr/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/protractor/milestones/26","html_url":"https://github.com/angular/protractor/milestones/2.2","labels_url":"https://api.github.com/repos/angular/protractor/milestones/26/labels","id":1121526,"number":26,"title":"2.2","description":"","creator":{"login":"juliemr","id":2081709,"avatar_url":"https://avatars.githubusercontent.com/u/2081709?v=3","gravatar_id":"","url":"https://api.github.com/users/juliemr","html_url":"https://github.com/juliemr","followers_url":"https://api.github.com/users/juliemr/followers","following_url":"https://api.github.com/users/juliemr/following{/other_user}","gists_url":"https://api.github.com/users/juliemr/gists{/gist_id}","starred_url":"https://api.github.com/users/juliemr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliemr/subscriptions","organizations_url":"https://api.github.com/users/juliemr/orgs","repos_url":"https://api.github.com/users/juliemr/repos","events_url":"https://api.github.com/users/juliemr/events{/privacy}","received_events_url":"https://api.github.com/users/juliemr/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2015-05-20T16:32:45Z","updated_at":"2015-05-20T16:39:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/protractor/pulls/2104/commits","review_comments_url":"https://api.github.com/repos/angular/protractor/pulls/2104/comments","review_comment_url":"https://api.github.com/repos/angular/protractor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/protractor/issues/2104/comments","statuses_url":"https://api.github.com/repos/angular/protractor/statuses/86e15837dc775194c12df5c66648add96f946ac4","head":{"label":"sjelin:plugin-api","ref":"plugin-api","sha":"86e15837dc775194c12df5c66648add96f946ac4","user":{"login":"sjelin","id":4841675,"avatar_url":"https://avatars.githubusercontent.com/u/4841675?v=3","gravatar_id":"","url":"https://api.github.com/users/sjelin","html_url":"https://github.com/sjelin","followers_url":"https://api.github.com/users/sjelin/followers","following_url":"https://api.github.com/users/sjelin/following{/other_user}","gists_url":"https://api.github.com/users/sjelin/gists{/gist_id}","starred_url":"https://api.github.com/users/sjelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjelin/subscriptions","organizations_url":"https://api.github.com/users/sjelin/orgs","repos_url":"https://api.github.com/users/sjelin/repos","events_url":"https://api.github.com/users/sjelin/events{/privacy}","received_events_url":"https://api.github.com/users/sjelin/received_events","type":"User","site_admin":false},"repo":{"id":25808124,"name":"protractor","full_name":"sjelin/protractor","owner":{"login":"sjelin","id":4841675,"avatar_url":"https://avatars.githubusercontent.com/u/4841675?v=3","gravatar_id":"","url":"https://api.github.com/users/sjelin","html_url":"https://github.com/sjelin","followers_url":"https://api.github.com/users/sjelin/followers","following_url":"https://api.github.com/users/sjelin/following{/other_user}","gists_url":"https://api.github.com/users/sjelin/gists{/gist_id}","starred_url":"https://api.github.com/users/sjelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjelin/subscriptions","organizations_url":"https://api.github.com/users/sjelin/orgs","repos_url":"https://api.github.com/users/sjelin/repos","events_url":"https://api.github.com/users/sjelin/events{/privacy}","received_events_url":"https://api.github.com/users/sjelin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sjelin/protractor","description":"E2E test framework for Angular apps","fork":true,"url":"https://api.github.com/repos/sjelin/protractor","forks_url":"https://api.github.com/repos/sjelin/protractor/forks","keys_url":"https://api.github.com/repos/sjelin/protractor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjelin/protractor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjelin/protractor/teams","hooks_url":"https://api.github.com/repos/sjelin/protractor/hooks","issue_events_url":"https://api.github.com/repos/sjelin/protractor/issues/events{/number}","events_url":"https://api.github.com/repos/sjelin/protractor/events","assignees_url":"https://api.github.com/repos/sjelin/protractor/assignees{/user}","branches_url":"https://api.github.com/repos/sjelin/protractor/branches{/branch}","tags_url":"https://api.github.com/repos/sjelin/protractor/tags","blobs_url":"https://api.github.com/repos/sjelin/protractor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjelin/protractor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjelin/protractor/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjelin/protractor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjelin/protractor/statuses/{sha}","languages_url":"https://api.github.com/repos/sjelin/protractor/languages","stargazers_url":"https://api.github.com/repos/sjelin/protractor/stargazers","contributors_url":"https://api.github.com/repos/sjelin/protractor/contributors","subscribers_url":"https://api.github.com/repos/sjelin/protractor/subscribers","subscription_url":"https://api.github.com/repos/sjelin/protractor/subscription","commits_url":"https://api.github.com/repos/sjelin/protractor/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjelin/protractor/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjelin/protractor/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjelin/protractor/issues/comments{/number}","contents_url":"https://api.github.com/repos/sjelin/protractor/contents/{+path}","compare_url":"https://api.github.com/repos/sjelin/protractor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjelin/protractor/merges","archive_url":"https://api.github.com/repos/sjelin/protractor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjelin/protractor/downloads","issues_url":"https://api.github.com/repos/sjelin/protractor/issues{/number}","pulls_url":"https://api.github.com/repos/sjelin/protractor/pulls{/number}","milestones_url":"https://api.github.com/repos/sjelin/protractor/milestones{/number}","notifications_url":"https://api.github.com/repos/sjelin/protractor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjelin/protractor/labels{/name}","releases_url":"https://api.github.com/repos/sjelin/protractor/releases{/id}","created_at":"2014-10-27T07:39:31Z","updated_at":"2015-03-30T21:15:58Z","pushed_at":"2015-05-19T20:17:38Z","git_url":"git://github.com/sjelin/protractor.git","ssh_url":"git@github.com:sjelin/protractor.git","clone_url":"https://github.com/sjelin/protractor.git","svn_url":"https://github.com/sjelin/protractor","homepage":null,"size":4109,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"8b77fd836b039965722e01e83c0e71b36bf881f6","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":7639232,"name":"protractor","full_name":"angular/protractor","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/protractor","description":"E2E test framework for Angular apps","fork":false,"url":"https://api.github.com/repos/angular/protractor","forks_url":"https://api.github.com/repos/angular/protractor/forks","keys_url":"https://api.github.com/repos/angular/protractor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/protractor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/protractor/teams","hooks_url":"https://api.github.com/repos/angular/protractor/hooks","issue_events_url":"https://api.github.com/repos/angular/protractor/issues/events{/number}","events_url":"https://api.github.com/repos/angular/protractor/events","assignees_url":"https://api.github.com/repos/angular/protractor/assignees{/user}","branches_url":"https://api.github.com/repos/angular/protractor/branches{/branch}","tags_url":"https://api.github.com/repos/angular/protractor/tags","blobs_url":"https://api.github.com/repos/angular/protractor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/protractor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/protractor/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/protractor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/protractor/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/protractor/languages","stargazers_url":"https://api.github.com/repos/angular/protractor/stargazers","contributors_url":"https://api.github.com/repos/angular/protractor/contributors","subscribers_url":"https://api.github.com/repos/angular/protractor/subscribers","subscription_url":"https://api.github.com/repos/angular/protractor/subscription","commits_url":"https://api.github.com/repos/angular/protractor/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/protractor/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/protractor/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/protractor/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/protractor/contents/{+path}","compare_url":"https://api.github.com/repos/angular/protractor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/protractor/merges","archive_url":"https://api.github.com/repos/angular/protractor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/protractor/downloads","issues_url":"https://api.github.com/repos/angular/protractor/issues{/number}","pulls_url":"https://api.github.com/repos/angular/protractor/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/protractor/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/protractor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/protractor/labels{/name}","releases_url":"https://api.github.com/repos/angular/protractor/releases{/id}","created_at":"2013-01-16T04:30:53Z","updated_at":"2015-05-21T12:02:00Z","pushed_at":"2015-05-21T12:07:53Z","git_url":"git://github.com/angular/protractor.git","ssh_url":"git@github.com:angular/protractor.git","clone_url":"https://github.com/angular/protractor.git","svn_url":"https://github.com/angular/protractor","homepage":"http://www.protractortest.org","size":12918,"stargazers_count":3851,"watchers_count":3851,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":749,"mirror_url":null,"open_issues_count":148,"forks":749,"open_issues":148,"watchers":3851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/protractor/pulls/2104"},"html":{"href":"https://github.com/angular/protractor/pull/2104"},"issue":{"href":"https://api.github.com/repos/angular/protractor/issues/2104"},"comments":{"href":"https://api.github.com/repos/angular/protractor/issues/2104/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/protractor/pulls/2104/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/protractor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/protractor/pulls/2104/commits"},"statuses":{"href":"https://api.github.com/repos/angular/protractor/statuses/86e15837dc775194c12df5c66648add96f946ac4"}}}}