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 #12789 from viorelaioia/bug-924946
Browse files Browse the repository at this point in the history
Bug 924946 - Change test_ftu_with_tour so it can work on desktopb2g
  • Loading branch information
Zac committed Oct 14, 2013
2 parents 56cef91 + 5bd50b8 commit f41d485
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 41 deletions.
Expand Up @@ -7,4 +7,3 @@ online = true
[test_ftu_skip_tour.py]
skip-if = device == "desktop"
[test_ftu_with_tour.py]
skip-if = device == "desktop"
Expand Up @@ -10,19 +10,7 @@
class TestFtu(GaiaTestCase):

_next_button_locator = (By.ID, 'forward')

_section_languages_locator = (By.ID, 'languages')
_section_cell_data_locator = (By.ID, 'data_3g')
_section_wifi_locator = (By.ID, 'wifi')
_found_wifi_networks_locator = (By.CSS_SELECTOR, 'ul#networks-list li')
_section_date_time_locator = (By.ID, 'date_and_time')
_section_geolocation_locator = (By.ID, 'geolocation')
_section_import_contacts_locator = (By.ID, 'import_contacts')
_section_ayr_locator = (By.ID, 'about-your-rights')
_section_welcome_browser_locator = (By.ID, 'welcome_browser')
_section_browser_privacy_locator = (By.ID, 'browser_privacy')
_section_finish_locator = (By.ID, 'finish-screen')

_take_tour_button_locator = (By.ID, 'lets-go-button')

# Section Tour
Expand All @@ -44,38 +32,19 @@ def setUp(self):
# launch the First Time User app
self.app = self.apps.launch('FTU')

self.wait_for_condition(lambda m: self.data_layer.is_wifi_enabled)

def test_ftu_with_tour(self):

# Go through the FTU setup as quickly as possible to get to the Tour section
self.wait_for_element_displayed(*self._section_languages_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_cell_data_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_wifi_locator)
# The scanning for networks messes with the timing of taps
self.wait_for_condition(lambda m: len(m.find_elements(*self._found_wifi_networks_locator)) > 0)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_date_time_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_geolocation_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_import_contacts_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_welcome_browser_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_browser_privacy_locator)
# Tap next
self.marionette.find_element(*self._next_button_locator).tap()
self.wait_for_element_displayed(*self._section_finish_locator)

count = 0
while not self.is_element_displayed(*self._take_tour_button_locator):
if self.is_element_displayed(*self._next_button_locator):
self.marionette.find_element(*self._next_button_locator).tap()
else:
count=count+1
if count > 5:
break

# Take the tour
self.marionette.find_element(*self._take_tour_button_locator).tap()
Expand Down
Expand Up @@ -52,3 +52,4 @@ disabled = Bug 831852
[functional/settings/test_settings_wallpaper.py]
[functional/system/test_system_notification_bar.py]
disabled = Bug 900991
[functional/ftu/test_ftu_with_tour.py]

0 comments on commit f41d485

Please sign in to comment.