Ejemplo n.º 1
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.data_layer.set_setting('devtools.qps.enabled', True)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 2
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 3
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # Reset timezone.user-selected setting as we change this in our testvars
        self.data_layer.set_setting('time.timezone.user-selected', None)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 4
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_status_bar(self):
        """
        https://moztrap.mozilla.org/manage/cases/?filter-id=6119
        See also test_ftu_skip_tour.py for the other checks in this test case
        """

        status_bar = System(self.marionette).status_bar

        while not self.ftu.is_take_tour_button_visible:
            self.marionette.switch_to_frame()
            self.assertTrue(status_bar.is_displayed)
            self.apps.switch_to_displayed_app()
            self.ftu.tap_next()

        self.ftu.tap_take_tour()

        while not self.ftu.is_lets_go_button_visible:
            self.marionette.switch_to_frame()
            self.assertTrue(status_bar.is_displayed)
            self.apps.switch_to_displayed_app()
            self.ftu.tap_tour_next()
Ejemplo n.º 5
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_status_bar(self):
        """
        https://moztrap.mozilla.org/manage/cases/?filter-id=6119
        See also test_ftu_skip_tour.py for the other checks in this test case
        """

        status_bar = System(self.marionette).status_bar

        while not self.ftu.is_take_tour_button_visible:
            self.marionette.switch_to_frame()
            self.assertTrue(status_bar.is_displayed)
            self.apps.switch_to_displayed_app()
            self.ftu.tap_next()

        self.ftu.tap_take_tour()

        while not self.ftu.is_lets_go_button_visible:
            self.marionette.switch_to_frame()
            self.assertTrue(status_bar.is_displayed)
            self.apps.switch_to_displayed_app()
            self.ftu.tap_tour_next()
Ejemplo n.º 6
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.data_layer.set_setting('devtools.qps.enabled', True)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 7
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 8
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.number_of_sim_contacts = len(self.data_layer.sim_contacts)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette, ignored_exceptions=JavascriptException).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 9
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # Reset timezone.user-selected setting as we change this in our testvars
        self.data_layer.set_setting('time.timezone.user-selected', None)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 10
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_with_tour(self):

        # Go through the FTU setup as quickly as possible to get to the Tour section
        self.ftu.run_ftu_setup_with_default_values()

        # Take the tour
        self.ftu.tap_take_tour()

        # Walk through the tour
        self.assertEqual(self.ftu.step1_header_text, "Swipe up and down to browse your apps. Tap and hold an icon to move or delete it.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step2_header_text, "Swipe down to access recent notifications, credit information and settings.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step3_header_text, "Drag from the left edge of your screen to return to recently used apps.")

        # Try going back a step
        self.ftu.tap_back()
        self.assertEqual(self.ftu.step2_header_text, "Swipe down to access recent notifications, credit information and settings.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step3_header_text, "Drag from the left edge of your screen to return to recently used apps.")
        self.ftu.tap_tour_next()
        self.ftu.wait_for_finish_tutorial_section()
        self.ftu.tap_lets_go_button()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 11
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_with_tour(self):

        # Go through the FTU setup as quickly as possible to get to the Tour section
        self.ftu.run_ftu_setup_with_default_values()

        # Take the tour
        self.ftu.tap_take_tour()

        # Walk through the tour
        self.assertEqual(self.ftu.step1_header_text, "Swipe up and down to browse your apps. Tap and hold on an icon to move or delete it.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step2_header_text, "Swipe down to access recent notifications, credit information and settings.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step3_header_text, "Drag from the left edge of your screen to return to recently used apps.")

        # Try going back a step
        self.ftu.tap_back()
        self.assertEqual(self.ftu.step2_header_text, "Swipe down to access recent notifications, credit information and settings.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step3_header_text, "Drag from the left edge of your screen to return to recently used apps.")
        self.ftu.tap_tour_next()
        self.ftu.wait_for_finish_tutorial_section()
        self.ftu.tap_lets_go_button()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == 'Homescreen')
Ejemplo n.º 12
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_with_tour(self):

        # Go through the FTU setup as quickly as possible to get to the Tour section
        self.ftu.run_ftu_setup_with_default_values()

        # Take the tour
        self.ftu.tap_take_tour()

        # Walk through the tour
        self.assertEqual(self.ftu.step1_header_text,
                         "Swipe from right to left to browse your apps.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step2_header_text,
                         "Tap and hold on an icon to delete or move it.")
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step3_header_text,
            "Enter any keyword or topic and your phone will instantly adapt.")
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step4_header_text,
            "Swipe down to access recent notifications, credit information and settings."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step5_header_text,
            "Tap and hold the home button to browse and close recent apps.")

        # Try going back a step
        self.ftu.tap_back()
        self.assertEqual(
            self.ftu.step4_header_text,
            "Swipe down to access recent notifications, credit information and settings."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step5_header_text,
            "Tap and hold the home button to browse and close recent apps.")
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step6_header_text,
            "Swipe from the side of the screen to move back and forth between recent apps."
        )
        self.ftu.tap_tour_next()
        self.ftu.wait_for_finish_tutorial_section()
        self.ftu.tap_lets_go_button()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == 'Homescreen')
Ejemplo n.º 13
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_skip_tour_for_desktop(self):

        self.assertGreater(self.ftu.languages_list, 0, "No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")

        # Tap next
        self.ftu.tap_next_to_wifi_section()

        # Set timezone
        self.ftu.tap_next_to_timezone_section()
        self.ftu.set_timezone_continent("Asia")
        self.ftu.set_timezone_city("Almaty")
        self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.ftu.tap_next_to_import_contacts_section()

        self.ftu.tap_next_to_firefox_accounts_section()

        self.ftu.tap_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        # TODO assert via settings API that this is set. Currently it is not used
        self.ftu.tap_statistics_checkbox()
        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == 'Homescreen')
Ejemplo n.º 14
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.number_of_sim_contacts = len(self.data_layer.sim_contacts)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette, ignored_exceptions=JavascriptException).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_ftu_skip_tour(self):
        """https://moztrap.mozilla.org/manage/case/3876/

        https://moztrap.mozilla.org/manage/case/3879/
        """
        ssid = self.testvars["wifi"]["ssid"]
        psk = self.testvars["wifi"].get("psk")
        keymanagement = self.testvars["wifi"].get("keyManagement")

        self.assertGreater(self.ftu.languages_list, 0, "No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")
        self.ftu.tap_next_to_cell_data_section()

        # Tap enable data
        self.ftu.enable_data()
        self.wait_for_condition(
            lambda m: self.data_layer.is_cell_data_connected, message="Cell data was not connected by FTU app"
        )

        # Tap next
        self.ftu.tap_next_to_wifi_section()
        self.ftu.wait_for_networks_available()
        self.ftu.connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette, timeout=60, ignored_exceptions=StaleElementException).until(
            lambda m: "connected"
            in m.find_element(
                By.CSS_SELECTOR, '#networks-list li[data-ssid="%s"] aside' % self.testvars["wifi"]["ssid"]
            ).get_attribute("class")
        )

        self.assertTrue(self.data_layer.is_wifi_connected(self.testvars["wifi"]), "WiFi was not connected via FTU app")

        self.apps.switch_to_displayed_app()

        # Set timezone
        self.ftu.tap_next_to_timezone_section()
        self.ftu.set_timezone_continent("Asia")
        self.ftu.set_timezone_city("Almaty")
        self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting("geolocation.enabled"),
            message="Geolocation was not disabled by the FTU app",
        )
        self.ftu.tap_next_to_import_contacts_section()

        # Tap import from SIM
        # You can do this as many times as you like without db conflict
        self.ftu.tap_import_from_sim()
        self.ftu.wait_for_contacts_imported(self.number_of_sim_contacts)
        self.assertEqual(self.ftu.count_imported_contacts, len(self.data_layer.all_contacts))

        # all_contacts switches to top frame; Marionette needs to be switched back to ftu
        self.apps.switch_to_displayed_app()
        self.ftu.tap_next_to_firefox_accounts_section()
        self.ftu.tap_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        # TODO assert via settings API that this is set. Currently it is not used
        self.ftu.tap_statistics_checkbox()
        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == "Homescreen")
Ejemplo n.º 15
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.ftu = Ftu(self.marionette)
     self.ftu.launch()
Ejemplo n.º 16
0
class TestFtuAccessibility(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.data_layer.set_setting('devtools.qps.enabled', True)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_a11y_ftu(self):

        ssid = self.testvars['wifi']['ssid']
        psk = self.testvars['wifi'].get('psk')
        keymanagement = self.testvars['wifi'].get('keyManagement')

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message='No languages listed on screen')

        # Select different languages
        self.assertEqual(self.ftu.selected_language, 'en-US')
        self.ftu.a11y_click_language('qps-ploc')
        self.assertEqual(self.ftu.selected_language, 'qps-ploc')
        self.ftu.a11y_click_language('qps-plocm')
        self.assertEqual(self.ftu.selected_language, 'qps-plocm')
        self.ftu.a11y_click_language('en-US')
        self.assertEqual(self.ftu.selected_language, 'en-US')

        self.ftu.a11y_click_next_to_cell_data_section()
        # Enable data
        # TODO: this needs to be enabled when bug 1014887 lands.
        # self.ftu.a11y_enable_data()
        # self.wait_for_condition(
        #     lambda m: self.data_layer.is_cell_data_connected,
        #     message='Cell data was not connected by FTU app')

        self.ftu.a11y_click_next_to_wifi_section()
        # Wait for networks
        self.ftu.wait_for_networks_available()
        # Connect to Wifi
        self.ftu.a11y_connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette, timeout=60, ignored_exceptions=StaleElementException).until(
            lambda m: 'connected' in m.find_element(
                By.CSS_SELECTOR,
                '#networks-list li[data-ssid="%s"] aside' %
                self.testvars['wifi']['ssid']).get_attribute('class'))
        self.assertTrue(self.data_layer.is_wifi_connected(self.testvars['wifi']),
                        'WiFi was not connected via FTU app')

        self.apps.switch_to_displayed_app()

        self.ftu.a11y_click_next_to_timezone_section()
        # Select time zone.
        self.ftu.a11y_set_timezone_continent('Asia')
        self.ftu.a11y_set_timezone_city('Almaty')
        self.assertEqual(self.ftu.timezone_title, 'UTC+06:00 Asia/Almaty')

        self.ftu.a11y_click_next_to_geolocation_section()
        # Disable geolocation
        # TODO: this needs to be enabled when bug 1014887 lands.
        # self.ftu.a11y_disable_geolocation()
        # self.wait_for_condition(lambda m: not self.data_layer.get_setting('geolocation.enabled'),
        #                         message='Geolocation was not disabled by the FTU app')

        self.ftu.a11y_click_next_to_import_contacts_section()
        self.ftu.a11y_click_next_to_firefox_accounts_section()
        self.ftu.a11y_click_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(
            lambda m: self.data_layer.get_setting('debug.performance_data.shared'),
            message='Share performance data was not set')
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting('debug.performance_data.shared'),
            message='Share performance data was not unset')

        self.ftu.a11y_click_next_to_privacy_browser_section()
        self.ftu.a11y_click_next_to_finish_section()

        # Skip the tour
        self.ftu.a11y_click_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 17
0
class TestFtuAccessibility(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.data_layer.set_setting('devtools.qps.enabled', True)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_a11y_ftu(self):

        ssid = self.testvars['wifi']['ssid']
        psk = self.testvars['wifi'].get('psk')
        keymanagement = self.testvars['wifi'].get('keyManagement')

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message='No languages listed on screen')

        # Select different languages
        self.assertEqual(self.ftu.selected_language, 'en-US')
        self.ftu.a11y_click_language('qps-ploc')
        self.assertEqual(self.ftu.selected_language, 'qps-ploc')
        self.ftu.a11y_click_language('qps-plocm')
        self.assertEqual(self.ftu.selected_language, 'qps-plocm')
        self.ftu.a11y_click_language('en-US')
        self.assertEqual(self.ftu.selected_language, 'en-US')

        self.ftu.a11y_click_next_to_cell_data_section()
        # Enable data
        # TODO: this needs to be enabled when bug 1014887 lands.
        # self.ftu.a11y_enable_data()
        # self.wait_for_condition(
        #     lambda m: self.data_layer.is_cell_data_connected,
        #     message='Cell data was not connected by FTU app')

        self.ftu.a11y_click_next_to_wifi_section()
        # Wait for networks
        self.ftu.wait_for_networks_available()
        # Connect to Wifi
        self.ftu.a11y_connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette,
             timeout=60,
             ignored_exceptions=StaleElementException).until(
                 lambda m: 'connected' in m.find_element(
                     By.CSS_SELECTOR, '#networks-list li[data-ssid="%s"] aside'
                     % self.testvars['wifi']['ssid']).get_attribute('class'))
        self.assertTrue(
            self.data_layer.is_wifi_connected(self.testvars['wifi']),
            'WiFi was not connected via FTU app')

        self.apps.switch_to_displayed_app()

        self.ftu.a11y_click_next_to_timezone_section()
        # Select time zone.
        self.ftu.a11y_set_timezone_continent('Asia')
        self.ftu.a11y_set_timezone_city('Almaty')
        self.assertEqual(self.ftu.timezone_title, 'UTC+06:00 Asia/Almaty')

        self.ftu.a11y_click_next_to_geolocation_section()
        # Disable geolocation
        # TODO: this needs to be enabled when bug 1014887 lands.
        # self.ftu.a11y_disable_geolocation()
        # self.wait_for_condition(lambda m: not self.data_layer.get_setting('geolocation.enabled'),
        #                         message='Geolocation was not disabled by the FTU app')

        self.ftu.a11y_click_next_to_import_contacts_section()
        self.ftu.a11y_click_next_to_firefox_accounts_section()
        self.ftu.a11y_click_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(lambda m: self.data_layer.get_setting(
            'debug.performance_data.shared'),
                                message='Share performance data was not set')
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(lambda m: not self.data_layer.get_setting(
            'debug.performance_data.shared'),
                                message='Share performance data was not unset')

        self.ftu.a11y_click_next_to_privacy_browser_section()
        self.ftu.a11y_click_next_to_finish_section()

        # Skip the tour
        self.ftu.a11y_click_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 18
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_with_tour(self):

        # Go through the FTU setup as quickly as possible to get to the Tour section
        self.ftu.run_ftu_setup_with_default_values()

        # Take the tour
        self.ftu.tap_take_tour()

        # Walk through the tour
        self.assertEqual(self.ftu.step1_header_text, "Swipe from right to left to browse your apps.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step2_header_text, "Tap and hold on an icon to delete or move it.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step3_header_text, "Enter any keyword or topic and your phone will instantly adapt.")
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step4_header_text, "Swipe down to access recent notifications, credit information and settings."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step5_header_text, "Tap and hold the home button to browse and close recent apps.")

        # Try going back a step
        self.ftu.tap_back()
        self.assertEqual(
            self.ftu.step4_header_text, "Swipe down to access recent notifications, credit information and settings."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step5_header_text, "Tap and hold the home button to browse and close recent apps.")
        self.ftu.tap_tour_next()
        self.ftu.wait_for_finish_tutorial_section()
        self.ftu.tap_lets_go_button()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == "Homescreen")
Ejemplo n.º 19
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        # Reset timezone.user-selected setting as we change this in our testvars
        self.data_layer.set_setting('time.timezone.user-selected', None)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_ftu_skip_tour(self):
        """
        https://moztrap.mozilla.org/manage/case/6119/
        """
        ssid = self.testvars['wifi']['ssid']
        psk = self.testvars['wifi'].get('psk')
        keymanagement = self.testvars['wifi'].get('keyManagement')
        share_data_default = True
        geolocation_default = True

        # Assume a SIM is present if we assigned a phone number
        # Don't trust internal API for this, since it's an external condition
        has_a_sim = bool(self.environment.phone_numbers)

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0, message="No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")

        # If a SIM is present, the cell data screen comes up
        if has_a_sim:
            self.ftu.tap_next_to_cell_data_section()
            # Tap enable data if connection is also present. You might have
            # a SIM, but without a valid connection.
            if self.device.has_mobile_connection:
                self.ftu.enable_data()
                self.wait_for_condition(
                    lambda m: self.data_layer.is_cell_data_connected,
                    message='Cell data was not connected by FTU app')

        # Tap next
        self.ftu.tap_next_to_wifi_section()
        self.ftu.wait_for_networks_available()
        self.ftu.connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette, timeout=60, ignored_exceptions=StaleElementException).until(
            lambda m: 'connected' in m.find_element(
                By.CSS_SELECTOR,
                '#networks-list li[data-ssid="%s"] aside' %
                self.testvars['wifi']['ssid']).get_attribute('class'))

        self.assertTrue(self.data_layer.is_wifi_connected(self.testvars['wifi']),
                        "WiFi was not connected via FTU app")

        self.apps.switch_to_displayed_app()

        # Set timezone if there's no connection
        if not self.device.has_mobile_connection:
            self.ftu.tap_next_to_timezone_section()
            # UTC-05:00 America/New York is the default info if no network is detected
            self.assertEqual(self.ftu.timezone_title, "UTC-05:00 America/New York")
            self.ftu.set_timezone_continent("Asia")
            self.ftu.set_timezone_city("Almaty")
            self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Verify the "geolocation" option matches expected initial state
        # There's a very small lag on this after the dialog appears.
        Wait(self.marionette).until(
            lambda m: self.ftu.is_geolocation_enabled == geolocation_default,
            message="Geolocation state should match initial internal state")

        # Verify that internal state matches UI state
        self.assertEqual(self.data_layer.get_setting(
            'geolocation.enabled'), self.ftu.is_geolocation_enabled,
            msg='Geolocation internal state should match UI state')

        self.ftu.disable_geolocation()
        self.assertEqual(self.data_layer.get_setting(
            'geolocation.enabled'), not geolocation_default)
        self.ftu.tap_next_to_import_contacts_section()

        # If there's a SIM, try importing from it
        if has_a_sim:
            # You can do this as many times as you like without db conflict
            self.ftu.tap_import_from_sim()
            self.ftu.wait_for_contacts_imported()
            self.assertEqual(self.ftu.count_imported_contacts, len(self.data_layer.all_contacts))

            # all_contacts switches to top frame; Marionette needs to be switched back to ftu
            self.apps.switch_to_displayed_app()

        self.ftu.tap_next_to_firefox_accounts_section()
        self.ftu.tap_next_to_welcome_browser_section()

        # Verify the "Share Data" option matches expected initial state
        # There's a very small lag on this after the dialog appears.
        Wait(self.marionette).until(
            lambda m: self.ftu.is_share_data_enabled == share_data_default,
            message="Send Data UI state should match initial internal state")

        # Verify that internal state matches UI state
        self.assertEqual(self.data_layer.get_setting(
            'debug.performance_data.shared'), self.ftu.is_share_data_enabled,
            msg='Send Data internal state should match UI state')

        self.ftu.disable_share_data()
        self.assertEqual(self.data_layer.get_setting(
            'debug.performance_data.shared'), not share_data_default)

        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        Homescreen(self.marionette).wait_to_be_displayed()
Ejemplo n.º 20
0
class TestFtuAccessibility(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_a11y_ftu(self):
        # This test runs on TBPL only (device is covered by test_a11y_ftu.py)

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message='No languages listed on screen')

        # Select different languages
        self.ftu.a11y_click_language('en-US')
        self.assertEqual(self.ftu.selected_language, 'en-US')

        self.ftu.a11y_click_next_to_wifi_section()
        self.ftu.a11y_click_next_to_timezone_section()
        self.ftu.a11y_click_next_to_geolocation_section()
        self.ftu.a11y_click_next_to_import_contacts_section()
        self.ftu.a11y_click_next_to_firefox_accounts_section()
        self.ftu.a11y_click_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(lambda m: self.data_layer.get_setting(
            'debug.performance_data.shared'),
                                message='Share performance data was not set')
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(lambda m: not self.data_layer.get_setting(
            'debug.performance_data.shared'),
                                message='Share performance data was not unset')

        self.ftu.a11y_click_next_to_privacy_browser_section()
        self.ftu.a11y_click_next_to_finish_section()

        # Skip the tour
        self.ftu.a11y_click_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 21
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_skip_tour_for_desktop(self):

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0, message="No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")

        # Tap next
        self.ftu.tap_next_to_wifi_section()

        # Set timezone
        self.ftu.tap_next_to_timezone_section()
        self.ftu.set_timezone_continent("Asia")
        self.ftu.set_timezone_city("Almaty")
        self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.ftu.tap_next_to_import_contacts_section()

        self.ftu.tap_next_to_firefox_accounts_section()

        self.ftu.tap_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.tap_statistics_checkbox()
        self.assertTrue(self.data_layer.get_setting('debug.performance_data.shared'))
        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 22
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 23
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

        # Reset timezone.user-selected setting as we change this in our testvars
        self.data_layer.set_setting('time.timezone.user-selected', None)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_ftu_skip_tour(self):
        """
        https://moztrap.mozilla.org/manage/case/6119/
        """
        ssid = self.testvars['wifi']['ssid']
        psk = self.testvars['wifi'].get('psk')
        keymanagement = self.testvars['wifi'].get('keyManagement')
        share_data_default = True

        # Assume a SIM is present if we assigned a phone number
        # Don't trust internal API for this, since it's an external condition
        has_a_sim = bool(self.environment.phone_numbers)

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message="No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")

        # If a SIM is present, the cell data screen comes up
        if has_a_sim:
            self.ftu.tap_next_to_cell_data_section()
            # Tap enable data if connection is also present. You might have
            # a SIM, but without a valid connection.
            if self.device.has_mobile_connection:
                self.ftu.enable_data()
                self.wait_for_condition(
                    lambda m: self.data_layer.is_cell_data_connected,
                    message='Cell data was not connected by FTU app')

        # Tap next
        self.ftu.tap_next_to_wifi_section()
        self.ftu.wait_for_networks_available()
        self.ftu.connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette,
             timeout=60,
             ignored_exceptions=StaleElementException).until(
                 lambda m: 'connected' in m.find_element(
                     By.CSS_SELECTOR, '#networks-list li[data-ssid="%s"] aside'
                     % self.testvars['wifi']['ssid']).get_attribute('class'))

        self.assertTrue(
            self.data_layer.is_wifi_connected(self.testvars['wifi']),
            "WiFi was not connected via FTU app")

        self.apps.switch_to_displayed_app()

        # Set timezone if there's no connection
        if not self.device.has_mobile_connection:
            self.ftu.tap_next_to_timezone_section()
            # UTC-05:00 America/New York is the default info if no network is detected
            self.assertEqual(self.ftu.timezone_title,
                             "UTC-05:00 America/New York")
            self.ftu.set_timezone_continent("Asia")
            self.ftu.set_timezone_city("Almaty")
            self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting('geolocation.enabled'),
            message='Geolocation was not disabled by the FTU app')
        self.ftu.tap_next_to_import_contacts_section()

        # If there's a SIM, try importing from it
        if has_a_sim:
            # You can do this as many times as you like without db conflict
            self.ftu.tap_import_from_sim()
            self.ftu.wait_for_contacts_imported()
            self.assertEqual(self.ftu.count_imported_contacts,
                             len(self.data_layer.all_contacts))

            # all_contacts switches to top frame; Marionette needs to be switched back to ftu
            self.apps.switch_to_displayed_app()

        self.ftu.tap_next_to_firefox_accounts_section()
        self.ftu.tap_next_to_welcome_browser_section()

        # Verify the "Share Data" option matches expected initial state
        # There's a very small lag on this after the dialog appears.
        Wait(self.marionette).until(
            lambda m: self.ftu.is_share_data_enabled == share_data_default,
            message="Send Data UI state should match initial internal state")

        # Verify that internal state matches UI state
        self.assertEqual(
            self.data_layer.get_setting('debug.performance_data.shared'),
            self.ftu.is_share_data_enabled,
            msg='Send Data internal state should match UI state')

        # Toggle "Share Data" and verify that it also toggled internal state
        self.ftu.toggle_share_data()
        self.assertEqual(
            self.data_layer.get_setting('debug.performance_data.shared'),
            not share_data_default,
            msg='Send Data internal state should be changed by UI')

        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 24
0
class TestFtuAccessibility(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.data_layer.set_setting('devtools.qps.enabled', True)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_a11y_ftu(self):
        header = self.marionette.execute_script("""
            var qps = window.wrappedJSObject.navigator.mozL10n.qps;
            return qps['qps-ploc'].translate('Homescreen');
        """)

        # This test runs on TBPL only (device is covered by test_a11y_ftu.py)

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message='No languages listed on screen')

        # Select different languages
        self.assertEqual(self.ftu.selected_language, 'en-US')
        self.ftu.a11y_click_language('qps-ploc')
        self.assertEqual(self.ftu.selected_language, 'qps-ploc')
        self.ftu.a11y_click_language('qps-plocm')
        self.assertEqual(self.ftu.selected_language, 'qps-plocm')
        self.ftu.a11y_click_language('en-US')
        self.assertEqual(self.ftu.selected_language, 'en-US')

        self.ftu.a11y_click_next_to_wifi_section()
        self.ftu.a11y_click_next_to_timezone_section()
        self.ftu.a11y_click_next_to_geolocation_section()
        self.ftu.a11y_click_next_to_import_contacts_section()
        self.ftu.a11y_click_next_to_firefox_accounts_section()
        self.ftu.a11y_click_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(
            lambda m: self.data_layer.get_setting('debug.performance_data.shared'),
            message='Share performance data was not set')
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting('debug.performance_data.shared'),
            message='Share performance data was not unset')

        self.ftu.a11y_click_next_to_privacy_browser_section()
        self.ftu.a11y_click_next_to_finish_section()

        # Skip the tour
        self.ftu.a11y_click_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 25
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.data_layer.set_setting('devtools.qps.enabled', True)
     self.ftu = Ftu(self.marionette)
     self.ftu.launch()
Ejemplo n.º 26
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.ftu = Ftu(self.marionette)
     self.ftu.launch()
Ejemplo n.º 27
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_ftu_skip_tour(self):
        """https://moztrap.mozilla.org/manage/case/3876/

        https://moztrap.mozilla.org/manage/case/3879/
        """
        ssid = self.testvars['wifi']['ssid']
        psk = self.testvars['wifi'].get('psk')
        keymanagement = self.testvars['wifi'].get('keyManagement')

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message="No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")
        self.ftu.tap_next_to_cell_data_section()

        # Tap enable data
        self.ftu.enable_data()
        self.wait_for_condition(
            lambda m: self.data_layer.is_cell_data_connected,
            message='Cell data was not connected by FTU app')

        # Tap next
        self.ftu.tap_next_to_wifi_section()
        self.ftu.wait_for_networks_available()
        self.ftu.connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette,
             timeout=60,
             ignored_exceptions=StaleElementException).until(
                 lambda m: 'connected' in m.find_element(
                     By.CSS_SELECTOR, '#networks-list li[data-ssid="%s"] aside'
                     % self.testvars['wifi']['ssid']).get_attribute('class'))

        self.assertTrue(
            self.data_layer.is_wifi_connected(self.testvars['wifi']),
            "WiFi was not connected via FTU app")

        self.apps.switch_to_displayed_app()

        # Set timezone
        self.ftu.tap_next_to_timezone_section()
        self.ftu.set_timezone_continent("Asia")
        self.ftu.set_timezone_city("Almaty")
        self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting('geolocation.enabled'),
            message='Geolocation was not disabled by the FTU app')
        self.ftu.tap_next_to_import_contacts_section()

        # Tap import from SIM
        # You can do this as many times as you like without db conflict
        self.ftu.tap_import_from_sim()
        self.ftu.wait_for_contacts_imported()
        self.assertEqual(self.ftu.count_imported_contacts,
                         len(self.data_layer.all_contacts))

        # all_contacts switches to top frame; Marionette needs to be switched back to ftu
        self.apps.switch_to_displayed_app()
        self.ftu.tap_next_to_firefox_accounts_section()
        self.ftu.tap_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        # TODO assert via settings API that this is set. Currently it is not used
        self.ftu.tap_statistics_checkbox()
        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == 'Homescreen')
Ejemplo n.º 28
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)
Ejemplo n.º 29
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_with_tour(self):
        """
        https://moztrap.mozilla.org/manage/case/6119/
        """

        # Go through the FTU setup as quickly as possible to get to the Tour section
        self.ftu.run_ftu_setup_with_default_values()

        # Take the tour
        self.ftu.tap_take_tour()

        # Walk through the tour
        self.assertEqual(self.ftu.step1_header_text, "Swipe up and down to browse your apps and bookmarks. Tap and hold an icon to delete, move, or edit it.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step2_header_text, "Swipe down to access recent notifications, usage information and settings.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step3_header_text, "Drag from the left edge of your screen to return to recently used apps.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step4_header_text, "Tap on the search box anytime to start a search or go to a website.")

        # Try going back a step
        self.ftu.tap_back()
        self.assertEqual(self.ftu.step3_header_text, "Drag from the left edge of your screen to return to recently used apps.")
        self.ftu.tap_tour_next()
        self.assertEqual(self.ftu.step4_header_text, "Tap on the search box anytime to start a search or go to a website.")
        self.ftu.tap_tour_next()
        self.ftu.wait_for_finish_tutorial_section()
        self.ftu.tap_lets_go_button()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 30
0
class TestFtu(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_with_tour(self):
        """
        https://moztrap.mozilla.org/manage/case/6119/
        """

        # Go through the FTU setup as quickly as possible to get to the Tour section
        self.ftu.run_ftu_setup_with_default_values()

        # Take the tour
        self.ftu.tap_take_tour()

        # Walk through the tour
        self.assertEqual(
            self.ftu.step1_header_text,
            "Swipe up and down to browse your apps and bookmarks. Tap and hold an icon to delete, move, or edit it."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step2_header_text,
            "Swipe down to access recent notifications, credit information and settings."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step3_header_text,
            "Drag from the left edge of your screen to return to recently used apps."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step4_header_text,
            "Tap on the search box anytime to start a search or go to a website."
        )

        # Try going back a step
        self.ftu.tap_back()
        self.assertEqual(
            self.ftu.step3_header_text,
            "Drag from the left edge of your screen to return to recently used apps."
        )
        self.ftu.tap_tour_next()
        self.assertEqual(
            self.ftu.step4_header_text,
            "Tap on the search box anytime to start a search or go to a website."
        )
        self.ftu.tap_tour_next()
        self.ftu.wait_for_finish_tutorial_section()
        self.ftu.tap_lets_go_button()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 31
0
class TestFtuAccessibility(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_a11y_ftu(self):

        # This test runs on TBPL only (device is covered by test_a11y_ftu.py)

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0,
                                message='No languages listed on screen')

        # Select different languages
        self.assertEqual(self.ftu.selected_language, 'en-US')
        self.ftu.a11y_click_language('fr')
        self.assertEqual(self.ftu.selected_language, 'fr')
        self.ftu.a11y_click_language('en-US')
        self.assertEqual(self.ftu.selected_language, 'en-US')

        self.ftu.a11y_click_next_to_wifi_section()
        self.ftu.a11y_click_next_to_timezone_section()
        self.ftu.a11y_click_next_to_geolocation_section()
        self.ftu.a11y_click_next_to_import_contacts_section()
        self.ftu.a11y_click_next_to_firefox_accounts_section()
        self.ftu.a11y_click_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(
            lambda m: self.data_layer.get_setting('debug.performance_data.shared'),
            message='Share performance data was not set')
        self.ftu.a11y_click_statistics_checkbox()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting('debug.performance_data.shared'),
            message='Share performance data was not unset')

        self.ftu.a11y_click_next_to_privacy_browser_section()
        self.ftu.a11y_click_next_to_finish_section()

        # Skip the tour
        self.ftu.a11y_click_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 32
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        # Reset timezone.user-selected setting as we change this in our testvars
        self.data_layer.set_setting('time.timezone.user-selected', None)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

        # If mozWifiManager is not initialised an exception may be thrown
        Wait(self.marionette).until(lambda m: self.data_layer.is_wifi_enabled)

    def test_ftu_skip_tour(self):
        """
        https://moztrap.mozilla.org/manage/case/6119/
        """
        ssid = self.testvars['wifi']['ssid']
        psk = self.testvars['wifi'].get('psk')
        keymanagement = self.testvars['wifi'].get('keyManagement')

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0, message="No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")

        # Tap enable data if sim network present
        if self.device.has_mobile_connection:
            self.ftu.tap_next_to_cell_data_section()
            self.ftu.enable_data()
            self.wait_for_condition(
                lambda m: self.data_layer.is_cell_data_connected,
                message='Cell data was not connected by FTU app')

        # Tap next
        self.ftu.tap_next_to_wifi_section()
        self.ftu.wait_for_networks_available()
        self.ftu.connect_to_wifi(ssid, psk, keymanagement)
        Wait(self.marionette, timeout=60, ignored_exceptions=StaleElementException).until(
            lambda m: 'connected' in m.find_element(
                By.CSS_SELECTOR,
                '#networks-list li[data-ssid="%s"] aside' %
                self.testvars['wifi']['ssid']).get_attribute('class'))

        self.assertTrue(self.data_layer.is_wifi_connected(self.testvars['wifi']),
                        "WiFi was not connected via FTU app")

        self.apps.switch_to_displayed_app()

        # Set timezone if not connected to sim network
        if not self.device.has_mobile_connection:
            self.ftu.tap_next_to_timezone_section()
            # UTC-05:00 America/New York is the default info if no network is detected
            self.assertEqual(self.ftu.timezone_title, "UTC-05:00 America/New York")
            self.ftu.set_timezone_continent("Asia")
            self.ftu.set_timezone_city("Almaty")
            self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.wait_for_condition(
            lambda m: not self.data_layer.get_setting('geolocation.enabled'),
            message='Geolocation was not disabled by the FTU app')
        self.ftu.tap_next_to_import_contacts_section()

        if self.device.has_mobile_connection:
            # Tap import from SIM
            # You can do this as many times as you like without db conflict
            self.ftu.tap_import_from_sim()
            self.ftu.wait_for_contacts_imported()
            self.assertEqual(self.ftu.count_imported_contacts, len(self.data_layer.all_contacts))

            # all_contacts switches to top frame; Marionette needs to be switched back to ftu
            self.apps.switch_to_displayed_app()

        self.ftu.tap_next_to_firefox_accounts_section()
        self.ftu.tap_next_to_welcome_browser_section()

        # Tap the statistics box and check that it sets a setting
        self.ftu.tap_statistics_checkbox()
        self.assertTrue(self.data_layer.get_setting('debug.performance_data.shared'))
        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == Homescreen.name)
Ejemplo n.º 33
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.data_layer.set_setting('devtools.qps.enabled', True)
     self.ftu = Ftu(self.marionette)
     self.ftu.launch()
Ejemplo n.º 34
0
class TestFtu(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.ftu = Ftu(self.marionette)
        self.ftu.launch()

    def test_ftu_skip_tour_for_desktop(self):

        self.wait_for_condition(lambda m: self.ftu.languages_list > 0, message="No languages listed on screen")

        # select en-US due to the condition of this test is only for en-US
        self.ftu.tap_language("en-US")

        # Tap next
        self.ftu.tap_next_to_wifi_section()

        # Set timezone
        self.ftu.tap_next_to_timezone_section()
        self.ftu.set_timezone_continent("Asia")
        self.ftu.set_timezone_city("Almaty")
        # Bug 976570 - [ desktop b2g] Continent and city changes not visible in FTU menu
        # self.assertEqual(self.ftu.timezone_title, "UTC+06:00 Asia/Almaty")

        # Verify Geolocation section appears
        self.ftu.tap_next_to_geolocation_section()

        # Disable geolocation
        self.ftu.disable_geolocation()
        self.ftu.tap_next_to_import_contacts_section()

        self.ftu.tap_next_to_firefox_accounts_section()

        self.ftu.tap_next_to_welcome_browser_section()

        self.ftu.tap_statistics_checkbox()
        self.assertFalse(self.data_layer.get_setting('debug.performance_data.shared'))
        self.ftu.tap_next_to_privacy_browser_section()

        # Enter a dummy email address and check it set inside the os
        # TODO assert that this is preserved in the system somewhere. Currently it is not used
        self.ftu.enter_email_address("*****@*****.**")
        self.ftu.tap_next_to_finish_section()

        # Skip the tour
        self.ftu.tap_skip_tour()

        # Switch back to top level now that FTU app is gone
        homescreen(self.marionette).wait_to_be_displayed()