GitHub PullRequestReviewCommentEvent at 2014-06-17 19:36:00
Repository: acceptance-test-harness
Actor: uhafner
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/comments/13880126","id":13880126,"diff_hunk":"@@ -0,0 +1,74 @@\n+# Writing tests with Geb and Spock\n+This harness allows to write tests in [Groovy](http://groovy.codehaus.org/) with [Geb](http://www.gebish.org/) and [Spockframework](http://www.spockframework.org/). \n+\n+Here are only the specifics described that are needed to be compatible with the existing Java infrastructure and for a successful initialization of tests. Please see the documentation of [Groovy](http://groovy.codehaus.org/), [Geb](http://www.gebish.org/) and [Spockframework](http://www.spockframework.org/) for further information about writing the tests.\n+\n+## Geb PageObjects\n+Page objects written with Geb are very simple. All Geb page objects must extends the `org.jenkinsci.test.acceptance.po.Page` class. This class takes care about the correct initialization of the PageObject. Geb PageObjects are actually independent from the existing Java infrastructure and can not be used as arguments for i.e. build steps.\n+\n+To make a page object compatible with the existing infrastructure, simply add a new instance variable of the favored class/interface and add the `@Delegate` annotation. Of course it must be initialized, either inline or within the constructor.\n+\n+\n+Here is an example how to write a Geb page object that can be used as a PostBuildStep within every JUnit test.\n+```groovy\n+import org.jenkinsci.test.acceptance.geb.proxies.PostBuildStepProxy\n+import org.jenkinsci.test.acceptance.po.Describable\n+import org.jenkinsci.test.acceptance.po.Job\n+import org.jenkinsci.test.acceptance.po.Page\n+import org.jenkinsci.test.acceptance.po.PostBuildStep\n+\n+@Describable(\"Some post build step\")\n+class SomePostBuildStep extends Page {\n+\n+    static content = {\n+        area { $(\"div[descriptorid='hudson.plugins.example.ExamplePublisher']\") }\n+        execPattern { area.find(\"input[path='/publisher/execPattern']\") }\n+    }\n+\n+    @Delegate\n+    PostBuildStep parent;\n+\n+    SomePostBuildStep(Job job, String path) {\n+        super(job.injector)\n+        parent = new PostBuildStepProxy(job, path)\n+    }\n+}\n+```\n+\n+Within the content closure are all WebElements you wan't to access from the test. The parent field annotated with @Delegate takes care that this page object is a valid PostBuildStep and can be used within the [Job Class](../src/main/java/org/jenkinsci/test/acceptance/po/Job.java) as build step. This field must be initialized with a valid instance of the PostBuildStep interface.","path":"docs/GEB-SPOCK.md","position":38,"original_position":38,"commit_id":"9232a72fcb1d728a1eff8b31f6207d292668f5bc","original_commit_id":"9232a72fcb1d728a1eff8b31f6207d292668f5bc","user":{"login":"uhafner","id":503338,"avatar_url":"https://avatars.githubusercontent.com/u/503338?","gravatar_id":"4a8d7384e3fea70d63f31189d938c390","url":"https://api.github.com/users/uhafner","html_url":"https://github.com/uhafner","followers_url":"https://api.github.com/users/uhafner/followers","following_url":"https://api.github.com/users/uhafner/following{/other_user}","gists_url":"https://api.github.com/users/uhafner/gists{/gist_id}","starred_url":"https://api.github.com/users/uhafner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uhafner/subscriptions","organizations_url":"https://api.github.com/users/uhafner/orgs","repos_url":"https://api.github.com/users/uhafner/repos","events_url":"https://api.github.com/users/uhafner/events{/privacy}","received_events_url":"https://api.github.com/users/uhafner/received_events","type":"User","site_admin":false},"body":"Die Links funktionieren bei mir nicht. (Evtl. liegt das daran, dass ich die Änderung im Pull Request anschaue: https://github.com/uhafner/acceptance-test-harness/pull/59/files?short_path=9024a62#diff-9024a6254e415b2ff0af5c5f721c3771)","created_at":"2014-06-17T19:36:00Z","updated_at":"2014-06-17T19:36:00Z","html_url":"https://github.com/uhafner/acceptance-test-harness/pull/59#discussion_r13880126","pull_request_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/comments/13880126"},"html":{"href":"https://github.com/uhafner/acceptance-test-harness/pull/59#discussion_r13880126"},"pull_request":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59","id":17237308,"html_url":"https://github.com/uhafner/acceptance-test-harness/pull/59","diff_url":"https://github.com/uhafner/acceptance-test-harness/pull/59.diff","patch_url":"https://github.com/uhafner/acceptance-test-harness/pull/59.patch","issue_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues/59","number":59,"state":"open","title":"Documentation for testing with Groovy, Geb and Spock","user":{"login":"chr-fritz","id":1180400,"avatar_url":"https://avatars.githubusercontent.com/u/1180400?","gravatar_id":"736480e21ade98d82152f4b4794ddd57","url":"https://api.github.com/users/chr-fritz","html_url":"https://github.com/chr-fritz","followers_url":"https://api.github.com/users/chr-fritz/followers","following_url":"https://api.github.com/users/chr-fritz/following{/other_user}","gists_url":"https://api.github.com/users/chr-fritz/gists{/gist_id}","starred_url":"https://api.github.com/users/chr-fritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chr-fritz/subscriptions","organizations_url":"https://api.github.com/users/chr-fritz/orgs","repos_url":"https://api.github.com/users/chr-fritz/repos","events_url":"https://api.github.com/users/chr-fritz/events{/privacy}","received_events_url":"https://api.github.com/users/chr-fritz/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-06-17T14:12:21Z","updated_at":"2014-06-17T19:36:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de51b9e301b0f3b017e8225e4a01b54953199282","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59/commits","review_comments_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59/comments","review_comment_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/comments/{number}","comments_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues/59/comments","statuses_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/statuses/9232a72fcb1d728a1eff8b31f6207d292668f5bc","head":{"label":"jenkins-acceptance-test-group:groovy_documentation","ref":"groovy_documentation","sha":"9232a72fcb1d728a1eff8b31f6207d292668f5bc","user":{"login":"jenkins-acceptance-test-group","id":7138473,"avatar_url":"https://avatars.githubusercontent.com/u/7138473?","gravatar_id":null,"url":"https://api.github.com/users/jenkins-acceptance-test-group","html_url":"https://github.com/jenkins-acceptance-test-group","followers_url":"https://api.github.com/users/jenkins-acceptance-test-group/followers","following_url":"https://api.github.com/users/jenkins-acceptance-test-group/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-acceptance-test-group/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-acceptance-test-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-acceptance-test-group/subscriptions","organizations_url":"https://api.github.com/users/jenkins-acceptance-test-group/orgs","repos_url":"https://api.github.com/users/jenkins-acceptance-test-group/repos","events_url":"https://api.github.com/users/jenkins-acceptance-test-group/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-acceptance-test-group/received_events","type":"Organization","site_admin":false},"repo":{"id":18596025,"name":"acceptance-test-harness","full_name":"jenkins-acceptance-test-group/acceptance-test-harness","owner":{"login":"jenkins-acceptance-test-group","id":7138473,"avatar_url":"https://avatars.githubusercontent.com/u/7138473?","gravatar_id":null,"url":"https://api.github.com/users/jenkins-acceptance-test-group","html_url":"https://github.com/jenkins-acceptance-test-group","followers_url":"https://api.github.com/users/jenkins-acceptance-test-group/followers","following_url":"https://api.github.com/users/jenkins-acceptance-test-group/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-acceptance-test-group/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-acceptance-test-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-acceptance-test-group/subscriptions","organizations_url":"https://api.github.com/users/jenkins-acceptance-test-group/orgs","repos_url":"https://api.github.com/users/jenkins-acceptance-test-group/repos","events_url":"https://api.github.com/users/jenkins-acceptance-test-group/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-acceptance-test-group/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkins-acceptance-test-group/acceptance-test-harness","description":"Attempted port from selenium-tests to Java","fork":true,"url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness","forks_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/forks","keys_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/teams","hooks_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/hooks","issue_events_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/issues/events{/number}","events_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/events","assignees_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/assignees{/user}","branches_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/branches{/branch}","tags_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/tags","blobs_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/languages","stargazers_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/stargazers","contributors_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/contributors","subscribers_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/subscribers","subscription_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/subscription","commits_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/issues/comments/{number}","contents_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/contents/{+path}","compare_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/merges","archive_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/downloads","issues_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/issues{/number}","pulls_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/labels{/name}","releases_url":"https://api.github.com/repos/jenkins-acceptance-test-group/acceptance-test-harness/releases{/id}","created_at":"2014-04-09T12:17:17Z","updated_at":"2014-06-17T14:12:21Z","pushed_at":"2014-06-17T14:11:11Z","git_url":"git://github.com/jenkins-acceptance-test-group/acceptance-test-harness.git","ssh_url":"git@github.com:jenkins-acceptance-test-group/acceptance-test-harness.git","clone_url":"https://github.com/jenkins-acceptance-test-group/acceptance-test-harness.git","svn_url":"https://github.com/jenkins-acceptance-test-group/acceptance-test-harness","homepage":null,"size":8319,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"uhafner:master","ref":"master","sha":"57f9aa63da3e6b495d21bd05eb43174d3647f0e4","user":{"login":"uhafner","id":503338,"avatar_url":"https://avatars.githubusercontent.com/u/503338?","gravatar_id":"4a8d7384e3fea70d63f31189d938c390","url":"https://api.github.com/users/uhafner","html_url":"https://github.com/uhafner","followers_url":"https://api.github.com/users/uhafner/followers","following_url":"https://api.github.com/users/uhafner/following{/other_user}","gists_url":"https://api.github.com/users/uhafner/gists{/gist_id}","starred_url":"https://api.github.com/users/uhafner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uhafner/subscriptions","organizations_url":"https://api.github.com/users/uhafner/orgs","repos_url":"https://api.github.com/users/uhafner/repos","events_url":"https://api.github.com/users/uhafner/events{/privacy}","received_events_url":"https://api.github.com/users/uhafner/received_events","type":"User","site_admin":false},"repo":{"id":18364692,"name":"acceptance-test-harness","full_name":"uhafner/acceptance-test-harness","owner":{"login":"uhafner","id":503338,"avatar_url":"https://avatars.githubusercontent.com/u/503338?","gravatar_id":"4a8d7384e3fea70d63f31189d938c390","url":"https://api.github.com/users/uhafner","html_url":"https://github.com/uhafner","followers_url":"https://api.github.com/users/uhafner/followers","following_url":"https://api.github.com/users/uhafner/following{/other_user}","gists_url":"https://api.github.com/users/uhafner/gists{/gist_id}","starred_url":"https://api.github.com/users/uhafner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uhafner/subscriptions","organizations_url":"https://api.github.com/users/uhafner/orgs","repos_url":"https://api.github.com/users/uhafner/repos","events_url":"https://api.github.com/users/uhafner/events{/privacy}","received_events_url":"https://api.github.com/users/uhafner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uhafner/acceptance-test-harness","description":"Attempted port from selenium-tests to Java","fork":true,"url":"https://api.github.com/repos/uhafner/acceptance-test-harness","forks_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/forks","keys_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/teams","hooks_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/hooks","issue_events_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues/events{/number}","events_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/events","assignees_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/assignees{/user}","branches_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/branches{/branch}","tags_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/tags","blobs_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/git/refs{/sha}","trees_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/statuses/{sha}","languages_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/languages","stargazers_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/stargazers","contributors_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/contributors","subscribers_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/subscribers","subscription_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/subscription","commits_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/commits{/sha}","git_commits_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/git/commits{/sha}","comments_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/comments{/number}","issue_comment_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues/comments/{number}","contents_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/contents/{+path}","compare_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/merges","archive_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/downloads","issues_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues{/number}","pulls_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls{/number}","milestones_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/milestones{/number}","notifications_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/labels{/name}","releases_url":"https://api.github.com/repos/uhafner/acceptance-test-harness/releases{/id}","created_at":"2014-04-02T11:52:34Z","updated_at":"2014-06-17T18:46:52Z","pushed_at":"2014-06-17T18:46:50Z","git_url":"git://github.com/uhafner/acceptance-test-harness.git","ssh_url":"git@github.com:uhafner/acceptance-test-harness.git","clone_url":"https://github.com/uhafner/acceptance-test-harness.git","svn_url":"https://github.com/uhafner/acceptance-test-harness","homepage":null,"size":8091,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59"},"html":{"href":"https://github.com/uhafner/acceptance-test-harness/pull/59"},"issue":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues/59"},"comments":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/uhafner/acceptance-test-harness/statuses/9232a72fcb1d728a1eff8b31f6207d292668f5bc"}}}}