{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/42946081","id":42946081,"diff_hunk":"@@ -11,22 +11,23 @@ class GaiaHeader(Widget):\n     _back_button_locator = (By.CSS_SELECTOR, 'button.action-button')\n     _close_button_locator = (By.CSS_SELECTOR, 'button[type=\"reset\"]')\n \n-    def go_back(self):\n+    def go_back(self,app=None, exit_app=False, statusbar=False):\n         Wait(self.marionette).until(expected.element_enabled(self.root_element) and\n                                     expected.element_displayed(self.root_element))\n         self.marionette.switch_to_shadow_root(self.root_element)\n         element = self.marionette.find_element(*self._back_button_locator)\n-        if element.is_displayed():\n-            element.tap()\n-            self.marionette.switch_to_shadow_root()\n-        else: # This header has a close button instead of a back button\n+\n+        if not element.is_displayed(): # This header has a close button instead of a back button\n             self.marionette.switch_to_shadow_root()\n-            self.root_element.find_element(*self._close_button_locator).tap()\n-        Wait(self.marionette).until(expected.element_not_displayed(self.root_element))\n+            element = self.root_element.find_element(*self._close_button_locator)\n \n-    def go_back_and_exit(self, app=None, add_statusbar_height=True):\n-        Wait(self.marionette).until(expected.element_enabled(self.root_element) and\n-                                    expected.element_displayed(self.root_element))\n-        self.tap_element_from_system_app(self.root_element, add_statusbar_height=add_statusbar_height, x=20)\n-        app.wait_to_not_be_displayed()\n-        self.apps.switch_to_displayed_app()\n+        if exit_app:\n+            self.tap_element_from_system_app(element, statusbar)\n+            app.wait_to_not_be_displayed()\n+            self.apps.switch_to_displayed_app()\n+        else:\n+            element.tap()\n+            # if _close_button_locator is used, then below call is made again, but it does not\n+            # affect the frame when it is already outside the shadow root\n+            self.marionette.switch_to_shadow_root()","path":"tests/python/gaia-ui-tests/gaiatest/form_controls/header.py","position":35,"original_position":35,"commit_id":"745bae1757e7528ede4cb0223cf568c7323f49e5","original_commit_id":"745bae1757e7528ede4cb0223cf568c7323f49e5","user":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"body":"Should I change the code as above?","created_at":"2015-10-25T15:32:21Z","updated_at":"2015-10-25T15:32:21Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/32713#discussion_r42946081","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/42946081"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32713#discussion_r42946081"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713","id":48648522,"html_url":"https://github.com/mozilla-b2g/gaia/pull/32713","diff_url":"https://github.com/mozilla-b2g/gaia/pull/32713.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/32713.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32713","number":32713,"state":"open","locked":false,"title":"Bug 1218063 - Imagecompare: go_back_and_exit() method in header.py does not work in RTL","user":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"body":"…es not work in RTL","created_at":"2015-10-24T04:24:12Z","updated_at":"2015-10-25T15:32:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f889f6ed6bbd61b2f54a78b88da63631ebf5b650","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32713/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/745bae1757e7528ede4cb0223cf568c7323f49e5","head":{"label":"npark-mozilla:1218063","ref":"1218063","sha":"745bae1757e7528ede4cb0223cf568c7323f49e5","user":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"repo":{"id":18301296,"name":"gaia","full_name":"npark-mozilla/gaia","owner":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npark-mozilla/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see https://wiki.mozilla.org/Release_Management/B2G_Landing","fork":true,"url":"https://api.github.com/repos/npark-mozilla/gaia","forks_url":"https://api.github.com/repos/npark-mozilla/gaia/forks","keys_url":"https://api.github.com/repos/npark-mozilla/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npark-mozilla/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npark-mozilla/gaia/teams","hooks_url":"https://api.github.com/repos/npark-mozilla/gaia/hooks","issue_events_url":"https://api.github.com/repos/npark-mozilla/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/npark-mozilla/gaia/events","assignees_url":"https://api.github.com/repos/npark-mozilla/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/npark-mozilla/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/npark-mozilla/gaia/tags","blobs_url":"https://api.github.com/repos/npark-mozilla/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npark-mozilla/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npark-mozilla/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/npark-mozilla/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npark-mozilla/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/npark-mozilla/gaia/languages","stargazers_url":"https://api.github.com/repos/npark-mozilla/gaia/stargazers","contributors_url":"https://api.github.com/repos/npark-mozilla/gaia/contributors","subscribers_url":"https://api.github.com/repos/npark-mozilla/gaia/subscribers","subscription_url":"https://api.github.com/repos/npark-mozilla/gaia/subscription","commits_url":"https://api.github.com/repos/npark-mozilla/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/npark-mozilla/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/npark-mozilla/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/npark-mozilla/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/npark-mozilla/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/npark-mozilla/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npark-mozilla/gaia/merges","archive_url":"https://api.github.com/repos/npark-mozilla/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npark-mozilla/gaia/downloads","issues_url":"https://api.github.com/repos/npark-mozilla/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/npark-mozilla/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/npark-mozilla/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/npark-mozilla/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npark-mozilla/gaia/labels{/name}","releases_url":"https://api.github.com/repos/npark-mozilla/gaia/releases{/id}","created_at":"2014-03-31T17:15:03Z","updated_at":"2015-05-07T15:36:28Z","pushed_at":"2015-10-24T23:58:39Z","git_url":"git://github.com/npark-mozilla/gaia.git","ssh_url":"git@github.com:npark-mozilla/gaia.git","clone_url":"https://github.com/npark-mozilla/gaia.git","svn_url":"https://github.com/npark-mozilla/gaia","homepage":"https://wiki.mozilla.org/B2G","size":954908,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"e5088f5575e67a9997991cfbc5ecfb0507dc5d4c","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-10-24T12:55:20Z","pushed_at":"2015-10-25T10:22:34Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1673116,"stargazers_count":1993,"watchers_count":1993,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2488,"mirror_url":null,"open_issues_count":1262,"forks":2488,"open_issues":1262,"watchers":1993,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/32713"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32713"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/32713/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/32713/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/745bae1757e7528ede4cb0223cf568c7323f49e5"}}}}