{"action":"created","comment":{"url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments/53832548","id":53832548,"diff_hunk":"@@ -0,0 +1,82 @@\n+/*\n+ Put Android-specific actions in this page object.\n+\n+ Do not perform verifications here. Verifications and assertions should go\n+ either in the test script or, for commonly used assertions, placed in an\n+ assertions object in tests/system/assertions.\n+*/\n+\n+var selectors = {\n+    // Define selectors here\n+\n+    // This xpath is the example, please update the xpath.\n+    HAMBURGER_MENU_BUTTON_XPATH: '//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.support.v4.widget.DrawerLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.FrameLayout[1]/android.widget.ImageView[1]'\n+};\n+\n+var AndroidAction = function(browser) {\n+    this.browser = browser;\n+    this.selectors = selectors;\n+};\n+\n+AndroidAction.prototype.clickHamburgerMenuButton = function() {\n+\n+    var self = this;\n+\n+    this.browser\n+        .contexts(function(result) {\n+            self.browser\n+                .useXpath()\n+                // set context to NATIVE_APP\n+                .setContext(result.value[0])\n+                .currentContext(function(ctx) {\n+                    self.browser.log('The context after switching ' + ctx.value);\n+                })\n+                .waitForElementVisible(selectors.HAMBURGER_MENU_BUTTON_XPATH)\n+                .log('Clicking Hamburger Menu button')\n+                .click(selectors.HAMBURGER_MENU_BUTTON_XPATH)\n+                //Waiting for the page load completely\n+                .pause(5000)\n+                .log('Starting Set Context')\n+                .useCss()\n+                //set context to WEBVIEW\n+                .setContext(result.value[result.value.length - 1])\n+                .currentContext(function(ctx) {\n+                    self.browser.log('The current context is ' + ctx.value);\n+                });\n+        });\n+    return this;\n+};\n+\n+AndroidAction.prototype.clickBackButton = function() {\n+    this.browser\n+        .pause(3000)","path":"app/tests/system/pageObjects/androidActions.js","position":52,"original_position":52,"commit_id":"12735243d4e96f01d3e3b82e3f77e50d08c64791","original_commit_id":"12735243d4e96f01d3e3b82e3f77e50d08c64791","user":{"login":"jeremywiebe","id":77138,"avatar_url":"https://avatars.githubusercontent.com/u/77138?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremywiebe","html_url":"https://github.com/jeremywiebe","followers_url":"https://api.github.com/users/jeremywiebe/followers","following_url":"https://api.github.com/users/jeremywiebe/following{/other_user}","gists_url":"https://api.github.com/users/jeremywiebe/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremywiebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremywiebe/subscriptions","organizations_url":"https://api.github.com/users/jeremywiebe/orgs","repos_url":"https://api.github.com/users/jeremywiebe/repos","events_url":"https://api.github.com/users/jeremywiebe/events{/privacy}","received_events_url":"https://api.github.com/users/jeremywiebe/received_events","type":"User","site_admin":false},"body":"What do we need this `pause` for?","created_at":"2016-02-23T19:12:49Z","updated_at":"2016-02-23T19:12:49Z","html_url":"https://github.com/mobify/astro-scaffold/pull/66#discussion_r53832548","pull_request_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments/53832548"},"html":{"href":"https://github.com/mobify/astro-scaffold/pull/66#discussion_r53832548"},"pull_request":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66","id":59885775,"html_url":"https://github.com/mobify/astro-scaffold/pull/66","diff_url":"https://github.com/mobify/astro-scaffold/pull/66.diff","patch_url":"https://github.com/mobify/astro-scaffold/pull/66.patch","issue_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/66","number":66,"state":"open","locked":false,"title":"Abstract System Level Actions for Android into a Action Library","user":{"login":"lilyzh","id":15114790,"avatar_url":"https://avatars.githubusercontent.com/u/15114790?v=3","gravatar_id":"","url":"https://api.github.com/users/lilyzh","html_url":"https://github.com/lilyzh","followers_url":"https://api.github.com/users/lilyzh/followers","following_url":"https://api.github.com/users/lilyzh/following{/other_user}","gists_url":"https://api.github.com/users/lilyzh/gists{/gist_id}","starred_url":"https://api.github.com/users/lilyzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilyzh/subscriptions","organizations_url":"https://api.github.com/users/lilyzh/orgs","repos_url":"https://api.github.com/users/lilyzh/repos","events_url":"https://api.github.com/users/lilyzh/events{/privacy}","received_events_url":"https://api.github.com/users/lilyzh/received_events","type":"User","site_admin":false},"body":"Abstract System Level Actions for Android into a Action Library\r\n\r\nJIRA: \r\nhttps://mobify.atlassian.net/browse/CSOG-5 \r\n\r\n## Changes\r\nAdded androidAction.js file under pageObjects folder, including:\r\n\r\n- Generalize the native xpath selectors\r\n- Generalize native action functions\r\n- Navigate using the hamburger menu\r\n- Use the system level back button\r\n- Generalize setting the windowhandler object\r\n\r\n## How to test-drive this PR\r\n- Update the Appium to the latest version\r\n- Clone https://github.com/mobify/generator-astro\r\n- Change `generator.sh`:\r\n```\r\nSCAFFOLD_VERSION=\"CSOG-5_system_action_android\"\r\nSCAFFOLD_URL=\"https://github.com/mobify/astro-scaffold/archive/CSOG-5_system_action_android.zip\"\r\n```\r\n- Run `./generator.sh`\r\n- `cd` into generated project and run `./scripts/ios-appium.sh`\r\n\r\n## TODOS:\r\n- [x] Tests are passing on your machine.\r\n- [x] Change works in both Android and iOS. (Tested with iOS build and test script. Not sure if there's an equivalent for Android). \r\n- [x] CHANGELOG.md has been updated.\r\n- [x] Scaffold is working. If a new feature was added, it was added to the Scaffold app.\r\n- [x] Run the generator to make sure it still functions correctly.\r\n- [x] QA +1\r\n- [ ] +1 from an engineer on the Astro team. @jeremywiebe ","created_at":"2016-02-19T00:15:16Z","updated_at":"2016-02-23T19:12:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"291557cb55c40175640b3e4905deaab4c01a16b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66/commits","review_comments_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66/comments","review_comment_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/66/comments","statuses_url":"https://api.github.com/repos/mobify/astro-scaffold/statuses/12735243d4e96f01d3e3b82e3f77e50d08c64791","head":{"label":"mobify:CSOG-5_system_action_android","ref":"CSOG-5_system_action_android","sha":"12735243d4e96f01d3e3b82e3f77e50d08c64791","user":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"repo":{"id":34024647,"name":"astro-scaffold","full_name":"mobify/astro-scaffold","owner":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mobify/astro-scaffold","description":"Starting point for building Astro applications","fork":false,"url":"https://api.github.com/repos/mobify/astro-scaffold","forks_url":"https://api.github.com/repos/mobify/astro-scaffold/forks","keys_url":"https://api.github.com/repos/mobify/astro-scaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mobify/astro-scaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mobify/astro-scaffold/teams","hooks_url":"https://api.github.com/repos/mobify/astro-scaffold/hooks","issue_events_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/events{/number}","events_url":"https://api.github.com/repos/mobify/astro-scaffold/events","assignees_url":"https://api.github.com/repos/mobify/astro-scaffold/assignees{/user}","branches_url":"https://api.github.com/repos/mobify/astro-scaffold/branches{/branch}","tags_url":"https://api.github.com/repos/mobify/astro-scaffold/tags","blobs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mobify/astro-scaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/mobify/astro-scaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mobify/astro-scaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/mobify/astro-scaffold/languages","stargazers_url":"https://api.github.com/repos/mobify/astro-scaffold/stargazers","contributors_url":"https://api.github.com/repos/mobify/astro-scaffold/contributors","subscribers_url":"https://api.github.com/repos/mobify/astro-scaffold/subscribers","subscription_url":"https://api.github.com/repos/mobify/astro-scaffold/subscription","commits_url":"https://api.github.com/repos/mobify/astro-scaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/mobify/astro-scaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/mobify/astro-scaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/mobify/astro-scaffold/contents/{+path}","compare_url":"https://api.github.com/repos/mobify/astro-scaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mobify/astro-scaffold/merges","archive_url":"https://api.github.com/repos/mobify/astro-scaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mobify/astro-scaffold/downloads","issues_url":"https://api.github.com/repos/mobify/astro-scaffold/issues{/number}","pulls_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/mobify/astro-scaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/mobify/astro-scaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mobify/astro-scaffold/labels{/name}","releases_url":"https://api.github.com/repos/mobify/astro-scaffold/releases{/id}","deployments_url":"https://api.github.com/repos/mobify/astro-scaffold/deployments","created_at":"2015-04-15T23:56:36Z","updated_at":"2016-01-30T07:16:17Z","pushed_at":"2016-02-23T01:23:59Z","git_url":"git://github.com/mobify/astro-scaffold.git","ssh_url":"git@github.com:mobify/astro-scaffold.git","clone_url":"https://github.com/mobify/astro-scaffold.git","svn_url":"https://github.com/mobify/astro-scaffold","homepage":null,"size":634,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":1,"default_branch":"develop"}},"base":{"label":"mobify:develop","ref":"develop","sha":"d30c9d90fe8a8a8ea7a98dfcf6539e1185a059f1","user":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"repo":{"id":34024647,"name":"astro-scaffold","full_name":"mobify/astro-scaffold","owner":{"login":"mobify","id":73539,"avatar_url":"https://avatars.githubusercontent.com/u/73539?v=3","gravatar_id":"","url":"https://api.github.com/users/mobify","html_url":"https://github.com/mobify","followers_url":"https://api.github.com/users/mobify/followers","following_url":"https://api.github.com/users/mobify/following{/other_user}","gists_url":"https://api.github.com/users/mobify/gists{/gist_id}","starred_url":"https://api.github.com/users/mobify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobify/subscriptions","organizations_url":"https://api.github.com/users/mobify/orgs","repos_url":"https://api.github.com/users/mobify/repos","events_url":"https://api.github.com/users/mobify/events{/privacy}","received_events_url":"https://api.github.com/users/mobify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mobify/astro-scaffold","description":"Starting point for building Astro applications","fork":false,"url":"https://api.github.com/repos/mobify/astro-scaffold","forks_url":"https://api.github.com/repos/mobify/astro-scaffold/forks","keys_url":"https://api.github.com/repos/mobify/astro-scaffold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mobify/astro-scaffold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mobify/astro-scaffold/teams","hooks_url":"https://api.github.com/repos/mobify/astro-scaffold/hooks","issue_events_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/events{/number}","events_url":"https://api.github.com/repos/mobify/astro-scaffold/events","assignees_url":"https://api.github.com/repos/mobify/astro-scaffold/assignees{/user}","branches_url":"https://api.github.com/repos/mobify/astro-scaffold/branches{/branch}","tags_url":"https://api.github.com/repos/mobify/astro-scaffold/tags","blobs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mobify/astro-scaffold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mobify/astro-scaffold/git/refs{/sha}","trees_url":"https://api.github.com/repos/mobify/astro-scaffold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mobify/astro-scaffold/statuses/{sha}","languages_url":"https://api.github.com/repos/mobify/astro-scaffold/languages","stargazers_url":"https://api.github.com/repos/mobify/astro-scaffold/stargazers","contributors_url":"https://api.github.com/repos/mobify/astro-scaffold/contributors","subscribers_url":"https://api.github.com/repos/mobify/astro-scaffold/subscribers","subscription_url":"https://api.github.com/repos/mobify/astro-scaffold/subscription","commits_url":"https://api.github.com/repos/mobify/astro-scaffold/commits{/sha}","git_commits_url":"https://api.github.com/repos/mobify/astro-scaffold/git/commits{/sha}","comments_url":"https://api.github.com/repos/mobify/astro-scaffold/comments{/number}","issue_comment_url":"https://api.github.com/repos/mobify/astro-scaffold/issues/comments{/number}","contents_url":"https://api.github.com/repos/mobify/astro-scaffold/contents/{+path}","compare_url":"https://api.github.com/repos/mobify/astro-scaffold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mobify/astro-scaffold/merges","archive_url":"https://api.github.com/repos/mobify/astro-scaffold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mobify/astro-scaffold/downloads","issues_url":"https://api.github.com/repos/mobify/astro-scaffold/issues{/number}","pulls_url":"https://api.github.com/repos/mobify/astro-scaffold/pulls{/number}","milestones_url":"https://api.github.com/repos/mobify/astro-scaffold/milestones{/number}","notifications_url":"https://api.github.com/repos/mobify/astro-scaffold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mobify/astro-scaffold/labels{/name}","releases_url":"https://api.github.com/repos/mobify/astro-scaffold/releases{/id}","deployments_url":"https://api.github.com/repos/mobify/astro-scaffold/deployments","created_at":"2015-04-15T23:56:36Z","updated_at":"2016-01-30T07:16:17Z","pushed_at":"2016-02-23T01:23:59Z","git_url":"git://github.com/mobify/astro-scaffold.git","ssh_url":"git@github.com:mobify/astro-scaffold.git","clone_url":"https://github.com/mobify/astro-scaffold.git","svn_url":"https://github.com/mobify/astro-scaffold","homepage":null,"size":634,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66"},"html":{"href":"https://github.com/mobify/astro-scaffold/pull/66"},"issue":{"href":"https://api.github.com/repos/mobify/astro-scaffold/issues/66"},"comments":{"href":"https://api.github.com/repos/mobify/astro-scaffold/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mobify/astro-scaffold/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/mobify/astro-scaffold/statuses/12735243d4e96f01d3e3b82e3f77e50d08c64791"}}}}