{"action":"created","comment":{"url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/comments/77805084","id":77805084,"diff_hunk":"@@ -0,0 +1,31 @@\n+package academy.softserve.edu.utils;\n+\n+import academy.softserve.edu.tests.TestClassForListener;\n+import org.apache.commons.io.FileUtils;\n+import org.openqa.selenium.OutputType;\n+import org.openqa.selenium.TakesScreenshot;\n+import org.openqa.selenium.WebDriver;\n+import org.testng.ITestResult;\n+import org.testng.TestListenerAdapter;\n+\n+import java.io.File;\n+import java.io.IOException;\n+\n+public class TestListener extends TestListenerAdapter {\n+\n+    @Override\n+    public void onTestFailure(final ITestResult iTestResult) {\n+        takeScreenShotOnFailure(iTestResult);\n+    }\n+\n+    public void takeScreenShotOnFailure(final ITestResult iTestResult) {\n+        final Object object = iTestResult.getInstance();\n+        final WebDriver driver = ((TestClassForListener) object).getDriver();","path":"src/test/java/academy/softserve/edu/utils/TestListener.java","position":23,"original_position":23,"commit_id":"0f8c7f13fa7fed7400b08c879f8ba887e6d372b5","original_commit_id":"0f8c7f13fa7fed7400b08c879f8ba887e6d372b5","user":{"login":"toleksyn","id":6543461,"avatar_url":"https://avatars.githubusercontent.com/u/6543461?v=3","gravatar_id":"","url":"https://api.github.com/users/toleksyn","html_url":"https://github.com/toleksyn","followers_url":"https://api.github.com/users/toleksyn/followers","following_url":"https://api.github.com/users/toleksyn/following{/other_user}","gists_url":"https://api.github.com/users/toleksyn/gists{/gist_id}","starred_url":"https://api.github.com/users/toleksyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toleksyn/subscriptions","organizations_url":"https://api.github.com/users/toleksyn/orgs","repos_url":"https://api.github.com/users/toleksyn/repos","events_url":"https://api.github.com/users/toleksyn/events{/privacy}","received_events_url":"https://api.github.com/users/toleksyn/received_events","type":"User","site_admin":false},"body":"driver = ((TestClassForListener) object).getDriver(); - will only work for TestClassForListener.class, make it work fer every class","created_at":"2016-09-07T11:36:18Z","updated_at":"2016-09-07T11:36:18Z","html_url":"https://github.com/rkliuha/oms_test_framework/pull/2#discussion_r77805084","pull_request_url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/comments/77805084"},"html":{"href":"https://github.com/rkliuha/oms_test_framework/pull/2#discussion_r77805084"},"pull_request":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2","id":84068949,"html_url":"https://github.com/rkliuha/oms_test_framework/pull/2","diff_url":"https://github.com/rkliuha/oms_test_framework/pull/2.diff","patch_url":"https://github.com/rkliuha/oms_test_framework/pull/2.patch","issue_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/2","number":2,"state":"open","locked":false,"title":"Added functionality to make screenshot on test failure","user":{"login":"Nikodych","id":21026576,"avatar_url":"https://avatars.githubusercontent.com/u/21026576?v=3","gravatar_id":"","url":"https://api.github.com/users/Nikodych","html_url":"https://github.com/Nikodych","followers_url":"https://api.github.com/users/Nikodych/followers","following_url":"https://api.github.com/users/Nikodych/following{/other_user}","gists_url":"https://api.github.com/users/Nikodych/gists{/gist_id}","starred_url":"https://api.github.com/users/Nikodych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nikodych/subscriptions","organizations_url":"https://api.github.com/users/Nikodych/orgs","repos_url":"https://api.github.com/users/Nikodych/repos","events_url":"https://api.github.com/users/Nikodych/events{/privacy}","received_events_url":"https://api.github.com/users/Nikodych/received_events","type":"User","site_admin":false},"body":"Changed base class name from \"Test\" into \"TestClass\".\r\nCreated new class \"TestListener\" with functionality to make screenshot on test failure, by overriding testng listeners and function \"takeScreenShotOnFailure\".\r\nIn \"TestClass\" created an example test to verify work of \"TestListener\".\r\nScreenshot file is located at \"oms_test_framework/screenshot/\".\r\nListeners “@Listeners ({TestListener.class})” added at class level. When run above test file. You should see that screen shot will capture and save into screenshot folder with same name as test name.","created_at":"2016-09-06T06:52:27Z","updated_at":"2016-09-07T11:36:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2580afe3162fb2c4599dcbc059e345428390923a","assignee":{"login":"toleksyn","id":6543461,"avatar_url":"https://avatars.githubusercontent.com/u/6543461?v=3","gravatar_id":"","url":"https://api.github.com/users/toleksyn","html_url":"https://github.com/toleksyn","followers_url":"https://api.github.com/users/toleksyn/followers","following_url":"https://api.github.com/users/toleksyn/following{/other_user}","gists_url":"https://api.github.com/users/toleksyn/gists{/gist_id}","starred_url":"https://api.github.com/users/toleksyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toleksyn/subscriptions","organizations_url":"https://api.github.com/users/toleksyn/orgs","repos_url":"https://api.github.com/users/toleksyn/repos","events_url":"https://api.github.com/users/toleksyn/events{/privacy}","received_events_url":"https://api.github.com/users/toleksyn/received_events","type":"User","site_admin":false},"assignees":[{"login":"toleksyn","id":6543461,"avatar_url":"https://avatars.githubusercontent.com/u/6543461?v=3","gravatar_id":"","url":"https://api.github.com/users/toleksyn","html_url":"https://github.com/toleksyn","followers_url":"https://api.github.com/users/toleksyn/followers","following_url":"https://api.github.com/users/toleksyn/following{/other_user}","gists_url":"https://api.github.com/users/toleksyn/gists{/gist_id}","starred_url":"https://api.github.com/users/toleksyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toleksyn/subscriptions","organizations_url":"https://api.github.com/users/toleksyn/orgs","repos_url":"https://api.github.com/users/toleksyn/repos","events_url":"https://api.github.com/users/toleksyn/events{/privacy}","received_events_url":"https://api.github.com/users/toleksyn/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2/commits","review_comments_url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2/comments","review_comment_url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/2/comments","statuses_url":"https://api.github.com/repos/rkliuha/oms_test_framework/statuses/0f8c7f13fa7fed7400b08c879f8ba887e6d372b5","head":{"label":"rkliuha:dshkliar","ref":"dshkliar","sha":"0f8c7f13fa7fed7400b08c879f8ba887e6d372b5","user":{"login":"rkliuha","id":21175817,"avatar_url":"https://avatars.githubusercontent.com/u/21175817?v=3","gravatar_id":"","url":"https://api.github.com/users/rkliuha","html_url":"https://github.com/rkliuha","followers_url":"https://api.github.com/users/rkliuha/followers","following_url":"https://api.github.com/users/rkliuha/following{/other_user}","gists_url":"https://api.github.com/users/rkliuha/gists{/gist_id}","starred_url":"https://api.github.com/users/rkliuha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkliuha/subscriptions","organizations_url":"https://api.github.com/users/rkliuha/orgs","repos_url":"https://api.github.com/users/rkliuha/repos","events_url":"https://api.github.com/users/rkliuha/events{/privacy}","received_events_url":"https://api.github.com/users/rkliuha/received_events","type":"User","site_admin":false},"repo":{"id":67423921,"name":"oms_test_framework","full_name":"rkliuha/oms_test_framework","owner":{"login":"rkliuha","id":21175817,"avatar_url":"https://avatars.githubusercontent.com/u/21175817?v=3","gravatar_id":"","url":"https://api.github.com/users/rkliuha","html_url":"https://github.com/rkliuha","followers_url":"https://api.github.com/users/rkliuha/followers","following_url":"https://api.github.com/users/rkliuha/following{/other_user}","gists_url":"https://api.github.com/users/rkliuha/gists{/gist_id}","starred_url":"https://api.github.com/users/rkliuha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkliuha/subscriptions","organizations_url":"https://api.github.com/users/rkliuha/orgs","repos_url":"https://api.github.com/users/rkliuha/repos","events_url":"https://api.github.com/users/rkliuha/events{/privacy}","received_events_url":"https://api.github.com/users/rkliuha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkliuha/oms_test_framework","description":"OMS Test Framework ","fork":false,"url":"https://api.github.com/repos/rkliuha/oms_test_framework","forks_url":"https://api.github.com/repos/rkliuha/oms_test_framework/forks","keys_url":"https://api.github.com/repos/rkliuha/oms_test_framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkliuha/oms_test_framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkliuha/oms_test_framework/teams","hooks_url":"https://api.github.com/repos/rkliuha/oms_test_framework/hooks","issue_events_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/events{/number}","events_url":"https://api.github.com/repos/rkliuha/oms_test_framework/events","assignees_url":"https://api.github.com/repos/rkliuha/oms_test_framework/assignees{/user}","branches_url":"https://api.github.com/repos/rkliuha/oms_test_framework/branches{/branch}","tags_url":"https://api.github.com/repos/rkliuha/oms_test_framework/tags","blobs_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkliuha/oms_test_framework/statuses/{sha}","languages_url":"https://api.github.com/repos/rkliuha/oms_test_framework/languages","stargazers_url":"https://api.github.com/repos/rkliuha/oms_test_framework/stargazers","contributors_url":"https://api.github.com/repos/rkliuha/oms_test_framework/contributors","subscribers_url":"https://api.github.com/repos/rkliuha/oms_test_framework/subscribers","subscription_url":"https://api.github.com/repos/rkliuha/oms_test_framework/subscription","commits_url":"https://api.github.com/repos/rkliuha/oms_test_framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkliuha/oms_test_framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkliuha/oms_test_framework/contents/{+path}","compare_url":"https://api.github.com/repos/rkliuha/oms_test_framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkliuha/oms_test_framework/merges","archive_url":"https://api.github.com/repos/rkliuha/oms_test_framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkliuha/oms_test_framework/downloads","issues_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues{/number}","pulls_url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls{/number}","milestones_url":"https://api.github.com/repos/rkliuha/oms_test_framework/milestones{/number}","notifications_url":"https://api.github.com/repos/rkliuha/oms_test_framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkliuha/oms_test_framework/labels{/name}","releases_url":"https://api.github.com/repos/rkliuha/oms_test_framework/releases{/id}","deployments_url":"https://api.github.com/repos/rkliuha/oms_test_framework/deployments","created_at":"2016-09-05T13:36:53Z","updated_at":"2016-09-07T11:33:18Z","pushed_at":"2016-09-07T11:33:17Z","git_url":"git://github.com/rkliuha/oms_test_framework.git","ssh_url":"git@github.com:rkliuha/oms_test_framework.git","clone_url":"https://github.com/rkliuha/oms_test_framework.git","svn_url":"https://github.com/rkliuha/oms_test_framework","homepage":"","size":40,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"rkliuha:master","ref":"master","sha":"27db531110276dbabff6568f1beb57444aab7b94","user":{"login":"rkliuha","id":21175817,"avatar_url":"https://avatars.githubusercontent.com/u/21175817?v=3","gravatar_id":"","url":"https://api.github.com/users/rkliuha","html_url":"https://github.com/rkliuha","followers_url":"https://api.github.com/users/rkliuha/followers","following_url":"https://api.github.com/users/rkliuha/following{/other_user}","gists_url":"https://api.github.com/users/rkliuha/gists{/gist_id}","starred_url":"https://api.github.com/users/rkliuha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkliuha/subscriptions","organizations_url":"https://api.github.com/users/rkliuha/orgs","repos_url":"https://api.github.com/users/rkliuha/repos","events_url":"https://api.github.com/users/rkliuha/events{/privacy}","received_events_url":"https://api.github.com/users/rkliuha/received_events","type":"User","site_admin":false},"repo":{"id":67423921,"name":"oms_test_framework","full_name":"rkliuha/oms_test_framework","owner":{"login":"rkliuha","id":21175817,"avatar_url":"https://avatars.githubusercontent.com/u/21175817?v=3","gravatar_id":"","url":"https://api.github.com/users/rkliuha","html_url":"https://github.com/rkliuha","followers_url":"https://api.github.com/users/rkliuha/followers","following_url":"https://api.github.com/users/rkliuha/following{/other_user}","gists_url":"https://api.github.com/users/rkliuha/gists{/gist_id}","starred_url":"https://api.github.com/users/rkliuha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkliuha/subscriptions","organizations_url":"https://api.github.com/users/rkliuha/orgs","repos_url":"https://api.github.com/users/rkliuha/repos","events_url":"https://api.github.com/users/rkliuha/events{/privacy}","received_events_url":"https://api.github.com/users/rkliuha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rkliuha/oms_test_framework","description":"OMS Test Framework ","fork":false,"url":"https://api.github.com/repos/rkliuha/oms_test_framework","forks_url":"https://api.github.com/repos/rkliuha/oms_test_framework/forks","keys_url":"https://api.github.com/repos/rkliuha/oms_test_framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rkliuha/oms_test_framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rkliuha/oms_test_framework/teams","hooks_url":"https://api.github.com/repos/rkliuha/oms_test_framework/hooks","issue_events_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/events{/number}","events_url":"https://api.github.com/repos/rkliuha/oms_test_framework/events","assignees_url":"https://api.github.com/repos/rkliuha/oms_test_framework/assignees{/user}","branches_url":"https://api.github.com/repos/rkliuha/oms_test_framework/branches{/branch}","tags_url":"https://api.github.com/repos/rkliuha/oms_test_framework/tags","blobs_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rkliuha/oms_test_framework/statuses/{sha}","languages_url":"https://api.github.com/repos/rkliuha/oms_test_framework/languages","stargazers_url":"https://api.github.com/repos/rkliuha/oms_test_framework/stargazers","contributors_url":"https://api.github.com/repos/rkliuha/oms_test_framework/contributors","subscribers_url":"https://api.github.com/repos/rkliuha/oms_test_framework/subscribers","subscription_url":"https://api.github.com/repos/rkliuha/oms_test_framework/subscription","commits_url":"https://api.github.com/repos/rkliuha/oms_test_framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rkliuha/oms_test_framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rkliuha/oms_test_framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rkliuha/oms_test_framework/contents/{+path}","compare_url":"https://api.github.com/repos/rkliuha/oms_test_framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rkliuha/oms_test_framework/merges","archive_url":"https://api.github.com/repos/rkliuha/oms_test_framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rkliuha/oms_test_framework/downloads","issues_url":"https://api.github.com/repos/rkliuha/oms_test_framework/issues{/number}","pulls_url":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls{/number}","milestones_url":"https://api.github.com/repos/rkliuha/oms_test_framework/milestones{/number}","notifications_url":"https://api.github.com/repos/rkliuha/oms_test_framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rkliuha/oms_test_framework/labels{/name}","releases_url":"https://api.github.com/repos/rkliuha/oms_test_framework/releases{/id}","deployments_url":"https://api.github.com/repos/rkliuha/oms_test_framework/deployments","created_at":"2016-09-05T13:36:53Z","updated_at":"2016-09-07T11:33:18Z","pushed_at":"2016-09-07T11:33:17Z","git_url":"git://github.com/rkliuha/oms_test_framework.git","ssh_url":"git@github.com:rkliuha/oms_test_framework.git","clone_url":"https://github.com/rkliuha/oms_test_framework.git","svn_url":"https://github.com/rkliuha/oms_test_framework","homepage":"","size":40,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2"},"html":{"href":"https://github.com/rkliuha/oms_test_framework/pull/2"},"issue":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/2"},"comments":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/rkliuha/oms_test_framework/statuses/0f8c7f13fa7fed7400b08c879f8ba887e6d372b5"}}}}
{"actor":{"display_login":"toleksyn"}}