Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15008 from AndreiH/bug956031
Browse files Browse the repository at this point in the history
Bug 956031 - Ensure geolocation UI automated test checks for presence of...
  • Loading branch information
Zac committed Jan 7, 2014
2 parents ebeb201 + 8e1e5cf commit 8ca18c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Expand Up @@ -22,6 +22,8 @@ def permission_dialog_message(self):

def tap_to_confirm_permission(self):
self.marionette.find_element(*self._permission_confirm_button_locator).tap()
from gaiatest.apps.system.app import System
return System(self.marionette)

def tap_to_dismiss_permission(self):
self.marionette.find_element(*self._permission_dismiss_button_locator).tap()
5 changes: 5 additions & 0 deletions tests/python/gaia-ui-tests/gaiatest/apps/system/app.py
Expand Up @@ -11,6 +11,7 @@ class System(Base):
# status bar
_status_bar_locator = (By.ID, 'statusbar')
_status_bar_notification_locator = (By.ID, 'statusbar-notification')
_geoloc_statusbar_locator = (By.ID, 'statusbar-geolocation')

_notification_toaster_locator = (By.ID, 'notification-toaster')
_update_manager_toaster_locator = (By.ID, 'update-manager-toaster')
Expand Down Expand Up @@ -45,3 +46,7 @@ def is_app_update_notification_displayed(self):
def wait_for_app_update_to_clear(self):
update_manager_toaster = self.marionette.find_element(*self._update_manager_toaster_locator)
self.wait_for_condition(lambda m: update_manager_toaster.location['y'] == (0 - update_manager_toaster.size['height']))

@property
def geolocation_icon_displayed(self):
return self.marionette.find_element(*self._geoloc_statusbar_locator).is_displayed()
Expand Up @@ -33,7 +33,8 @@ def test_geolocation_prompt(self):
self.assertEqual(permission.permission_dialog_message,
'Geoloc would like to know your location.')

permission.tap_to_confirm_permission()
system_app = permission.tap_to_confirm_permission()

current_permission = self.apps.get_permission('Geoloc', 'geolocation')
self.assertEqual(current_permission, 'allow')
self.assertTrue(system_app.geolocation_icon_displayed)

0 comments on commit 8ca18c3

Please sign in to comment.