{"action":"created","comment":{"url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/comments/72243166","id":72243166,"diff_hunk":"@@ -0,0 +1,88 @@\n+package io.appium.java_client.youiengine.frames;\n+\n+import io.appium.java_client.youiengine.YouiEngineDriver;\n+import io.appium.java_client.youiengine.util.TestUtility;\n+import org.openqa.selenium.NoSuchElementException;\n+\n+/**\n+ * This class is used to encapsulate all common application behaviours and make them\n+ * available to test authors from one object. Test scripts instance this object and call methods\n+ * from this class or its member objects.\n+ *\n+ * By wrapping interactions in methods based off of UI components, a hierarchy is created that\n+ * allows test authors to write simple code. The actual code behind the interactions can be\n+ * updated in one place which detaches the test scripts from the implementation reducing\n+ * maintenance should the application under test change.\n+ *\n+ * Created by paulfoster on 2016-07-21.\n+ */\n+\n+public class YouiEngineAppiumSampleApp {\n+    private YouiEngineDriver driver;\n+    private static TestUtility utility;\n+\n+    public LanderFrame landerScreen;\n+    public TextEditFrame textEditScreen;\n+    public ButtonsFrame buttonsScreen;\n+\n+    /* Constructor takes an instance of the YouiEngineDriver. This ensures there is an open and\n+         running session to use and allows the test author to swap capabilities at the test script\n+         level.\n+\n+         This allows the YouiEngineSampleApp class to be platform independent.   */\n+    public YouiEngineAppiumSampleApp(YouiEngineDriver youiEngineDriver) {\n+        driver = youiEngineDriver;\n+        landerScreen = new LanderFrame(driver);\n+        textEditScreen = new TextEditFrame(driver);\n+        buttonsScreen = new ButtonsFrame(driver);\n+    }\n+\n+    /* Helper methods to allow test authors to perform app level navigation. The leverage common\n+         designs in the app such as the presence of a Back button on the second tier screens. */\n+    public void goHome() {\n+        try {\n+            driver.findElementByName(\"Btn-Back\").click();","path":"src/test/java/io/appium/java_client/youiengine/frames/YouiEngineAppiumSampleApp.java","position":44,"original_position":44,"commit_id":"f5650e69fae555dc8d663b02ed0b04534e16217e","original_commit_id":"f5650e69fae555dc8d663b02ed0b04534e16217e","user":{"login":"pfoster-youitv","id":16088405,"avatar_url":"https://avatars.githubusercontent.com/u/16088405?v=3","gravatar_id":"","url":"https://api.github.com/users/pfoster-youitv","html_url":"https://github.com/pfoster-youitv","followers_url":"https://api.github.com/users/pfoster-youitv/followers","following_url":"https://api.github.com/users/pfoster-youitv/following{/other_user}","gists_url":"https://api.github.com/users/pfoster-youitv/gists{/gist_id}","starred_url":"https://api.github.com/users/pfoster-youitv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfoster-youitv/subscriptions","organizations_url":"https://api.github.com/users/pfoster-youitv/orgs","repos_url":"https://api.github.com/users/pfoster-youitv/repos","events_url":"https://api.github.com/users/pfoster-youitv/events{/privacy}","received_events_url":"https://api.github.com/users/pfoster-youitv/received_events","type":"User","site_admin":false},"body":"I didn't really want to throw an exception on this call because the app is simple - if you're on the main screen there will not be a back button. If you're on a subscreen there will be. I'm using this pattern intentionally.\r\n\r\nAnother thought is checking to see if the Text Edit button exists, it'd be more certain and not an assumption that we're on the lander.\r\n\r\nI agree, it's likely better to use exists first.\r\n\r\n```\r\nif (!exists(\"Text Edit) {\r\n   if (!exists(\"Btn-Back\")) {\r\n      throw new NoIdeaWhatScreenYouAreOnException(\"I made this up\");\r\n   }\r\n   driver.findElementByName(\"Btn-Back\").click();\r\n}\r\n```\r\n\r\nWould work?","created_at":"2016-07-26T12:58:03Z","updated_at":"2016-07-26T12:58:03Z","html_url":"https://github.com/YOU-i-Labs/appium-java-client/pull/22#discussion_r72243166","pull_request_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/comments/72243166"},"html":{"href":"https://github.com/YOU-i-Labs/appium-java-client/pull/22#discussion_r72243166"},"pull_request":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22","id":78525721,"html_url":"https://github.com/YOU-i-Labs/appium-java-client/pull/22","diff_url":"https://github.com/YOU-i-Labs/appium-java-client/pull/22.diff","patch_url":"https://github.com/YOU-i-Labs/appium-java-client/pull/22.patch","issue_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues/22","number":22,"state":"open","locked":false,"title":"Added frames classes to represent the app and contain interaction met…","user":{"login":"pfoster-youitv","id":16088405,"avatar_url":"https://avatars.githubusercontent.com/u/16088405?v=3","gravatar_id":"","url":"https://api.github.com/users/pfoster-youitv","html_url":"https://github.com/pfoster-youitv","followers_url":"https://api.github.com/users/pfoster-youitv/followers","following_url":"https://api.github.com/users/pfoster-youitv/following{/other_user}","gists_url":"https://api.github.com/users/pfoster-youitv/gists{/gist_id}","starred_url":"https://api.github.com/users/pfoster-youitv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfoster-youitv/subscriptions","organizations_url":"https://api.github.com/users/pfoster-youitv/orgs","repos_url":"https://api.github.com/users/pfoster-youitv/repos","events_url":"https://api.github.com/users/pfoster-youitv/events{/privacy}","received_events_url":"https://api.github.com/users/pfoster-youitv/received_events","type":"User","site_admin":false},"body":"…hods for the test classes\r\n\r\n## Change list\r\n\r\n- Added frame classes\r\n- Wrapped sleep in try/catch for interrupt exceptions\r\n- Removed excess init method\r\n- Added use of 'app' to the test classes\r\n- Updated the test methods in the test classes to reflect the new app structure\r\n \r\n## Types of changes\r\n\r\n- [ ] Bugfix (non-breaking change which fixes an issue)\r\n- [X] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)\r\n\r\n## Details\r\n\r\nThe sample test app changed so the test classes needed to be updated. Frame classes were added to reflect the app UI, wrap interaction methods and make the test methods more readable.","created_at":"2016-07-22T19:10:36Z","updated_at":"2016-07-26T12:58:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29e2b9e7f77d501e20023eda14dff1e16a5afd86","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22/commits","review_comments_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22/comments","review_comment_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues/22/comments","statuses_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/statuses/f5650e69fae555dc8d663b02ed0b04534e16217e","head":{"label":"pfoster-youitv:newTests","ref":"newTests","sha":"f5650e69fae555dc8d663b02ed0b04534e16217e","user":{"login":"pfoster-youitv","id":16088405,"avatar_url":"https://avatars.githubusercontent.com/u/16088405?v=3","gravatar_id":"","url":"https://api.github.com/users/pfoster-youitv","html_url":"https://github.com/pfoster-youitv","followers_url":"https://api.github.com/users/pfoster-youitv/followers","following_url":"https://api.github.com/users/pfoster-youitv/following{/other_user}","gists_url":"https://api.github.com/users/pfoster-youitv/gists{/gist_id}","starred_url":"https://api.github.com/users/pfoster-youitv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfoster-youitv/subscriptions","organizations_url":"https://api.github.com/users/pfoster-youitv/orgs","repos_url":"https://api.github.com/users/pfoster-youitv/repos","events_url":"https://api.github.com/users/pfoster-youitv/events{/privacy}","received_events_url":"https://api.github.com/users/pfoster-youitv/received_events","type":"User","site_admin":false},"repo":{"id":63964022,"name":"appium-java-client","full_name":"pfoster-youitv/appium-java-client","owner":{"login":"pfoster-youitv","id":16088405,"avatar_url":"https://avatars.githubusercontent.com/u/16088405?v=3","gravatar_id":"","url":"https://api.github.com/users/pfoster-youitv","html_url":"https://github.com/pfoster-youitv","followers_url":"https://api.github.com/users/pfoster-youitv/followers","following_url":"https://api.github.com/users/pfoster-youitv/following{/other_user}","gists_url":"https://api.github.com/users/pfoster-youitv/gists{/gist_id}","starred_url":"https://api.github.com/users/pfoster-youitv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfoster-youitv/subscriptions","organizations_url":"https://api.github.com/users/pfoster-youitv/orgs","repos_url":"https://api.github.com/users/pfoster-youitv/repos","events_url":"https://api.github.com/users/pfoster-youitv/events{/privacy}","received_events_url":"https://api.github.com/users/pfoster-youitv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pfoster-youitv/appium-java-client","description":"Java language binding for writing Appium Tests, conforms to Mobile JSON Wire Protocol","fork":true,"url":"https://api.github.com/repos/pfoster-youitv/appium-java-client","forks_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/forks","keys_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/teams","hooks_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/hooks","issue_events_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/events","assignees_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/tags","blobs_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/languages","stargazers_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/stargazers","contributors_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/contributors","subscribers_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/subscribers","subscription_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/subscription","commits_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/merges","archive_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/downloads","issues_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/labels{/name}","releases_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/releases{/id}","deployments_url":"https://api.github.com/repos/pfoster-youitv/appium-java-client/deployments","created_at":"2016-07-22T15:31:09Z","updated_at":"2016-07-22T15:31:13Z","pushed_at":"2016-07-22T19:07:33Z","git_url":"git://github.com/pfoster-youitv/appium-java-client.git","ssh_url":"git@github.com:pfoster-youitv/appium-java-client.git","clone_url":"https://github.com/pfoster-youitv/appium-java-client.git","svn_url":"https://github.com/pfoster-youitv/appium-java-client","homepage":null,"size":177457,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"develop"}},"base":{"label":"YOU-i-Labs:develop","ref":"develop","sha":"e008a90157efcdd50f6b891ff1003199107eeb76","user":{"login":"YOU-i-Labs","id":2078519,"avatar_url":"https://avatars.githubusercontent.com/u/2078519?v=3","gravatar_id":"","url":"https://api.github.com/users/YOU-i-Labs","html_url":"https://github.com/YOU-i-Labs","followers_url":"https://api.github.com/users/YOU-i-Labs/followers","following_url":"https://api.github.com/users/YOU-i-Labs/following{/other_user}","gists_url":"https://api.github.com/users/YOU-i-Labs/gists{/gist_id}","starred_url":"https://api.github.com/users/YOU-i-Labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YOU-i-Labs/subscriptions","organizations_url":"https://api.github.com/users/YOU-i-Labs/orgs","repos_url":"https://api.github.com/users/YOU-i-Labs/repos","events_url":"https://api.github.com/users/YOU-i-Labs/events{/privacy}","received_events_url":"https://api.github.com/users/YOU-i-Labs/received_events","type":"Organization","site_admin":false},"repo":{"id":60346845,"name":"appium-java-client","full_name":"YOU-i-Labs/appium-java-client","owner":{"login":"YOU-i-Labs","id":2078519,"avatar_url":"https://avatars.githubusercontent.com/u/2078519?v=3","gravatar_id":"","url":"https://api.github.com/users/YOU-i-Labs","html_url":"https://github.com/YOU-i-Labs","followers_url":"https://api.github.com/users/YOU-i-Labs/followers","following_url":"https://api.github.com/users/YOU-i-Labs/following{/other_user}","gists_url":"https://api.github.com/users/YOU-i-Labs/gists{/gist_id}","starred_url":"https://api.github.com/users/YOU-i-Labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YOU-i-Labs/subscriptions","organizations_url":"https://api.github.com/users/YOU-i-Labs/orgs","repos_url":"https://api.github.com/users/YOU-i-Labs/repos","events_url":"https://api.github.com/users/YOU-i-Labs/events{/privacy}","received_events_url":"https://api.github.com/users/YOU-i-Labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/YOU-i-Labs/appium-java-client","description":"Java language binding for writing Appium Tests, conforms to Mobile JSON Wire Protocol","fork":true,"url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client","forks_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/forks","keys_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/teams","hooks_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/hooks","issue_events_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/events","assignees_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/tags","blobs_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/languages","stargazers_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/stargazers","contributors_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/contributors","subscribers_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/subscribers","subscription_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/subscription","commits_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/merges","archive_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/downloads","issues_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/labels{/name}","releases_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/releases{/id}","deployments_url":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/deployments","created_at":"2016-06-03T12:43:09Z","updated_at":"2016-06-03T12:43:40Z","pushed_at":"2016-07-22T20:16:10Z","git_url":"git://github.com/YOU-i-Labs/appium-java-client.git","ssh_url":"git@github.com:YOU-i-Labs/appium-java-client.git","clone_url":"https://github.com/YOU-i-Labs/appium-java-client.git","svn_url":"https://github.com/YOU-i-Labs/appium-java-client","homepage":null,"size":224538,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22"},"html":{"href":"https://github.com/YOU-i-Labs/appium-java-client/pull/22"},"issue":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues/22"},"comments":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/YOU-i-Labs/appium-java-client/statuses/f5650e69fae555dc8d663b02ed0b04534e16217e"}}}}
{"actor":{"display_login":"pfoster-youitv"}}