Example #1
0
    def test_browser_navigation(self):

        self.test_url = self.marionette.absolute_url(
            'sample_websites/darkness/index.html')

        search = Search(self.marionette)
        search.launch()
        browser = search.go_to_url(self.test_url)
        browser.wait_for_page_to_load()

        #TODO: remove the reloading and rechecking for elements when bug 1128034 is resolved,
        browser.tap_reload_button()
        browser.wait_for_page_to_load()
        browser.switch_to_content()
        Wait(self.marionette).until(lambda m: 'Darkness' == m.title)
        Wait(self.marionette).until(lambda m: m.find_element(
            *self._academic_page_locator).is_displayed())
        self.take_screenshot()

        self.marionette.switch_to_frame()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        400,
                                        locator=browser._browser_frame_locator)

        self.take_screenshot()
Example #2
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ################## Screen Lock ######################
        screenlock_page = settings.open_screen_lock()
        screenlock_page.enable_lockscreen()
        self.take_screenshot('screen_lock')
        screenlock_page.enable_passcode_lock()
        self.take_screenshot('screen_lock-passcode')
        settings.return_to_prev_menu(screenlock_page.screen_element,
                                     screenlock_page.passcode_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     screenlock_page.screen_element)

        ################## App Permission ######################
        permission_page = settings.open_app_permissions()
        self.take_screenshot('app_permissions')
        permission_page.tap_camera_app()
        self.take_screenshot('app_permissions-app_list')
        permission_page.tap_geolocation_selection()
        self.take_screenshot('app_permissions-geoloc_option', top_frame=True)
        permission_page.exit_geolocation_selection()
        settings.return_to_prev_menu(permission_page.screen_element,
                                     permission_page.details_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     permission_page.screen_element)

        ################## Do Not Track ######################
        dnt_page = settings.open_do_not_track()
        self.take_screenshot('do_not_track')
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        settings.screen_element.size['height'],
                                        screen=dnt_page.screen_element)
        self.take_screenshot('do_not_track')
        settings.return_to_prev_menu(settings.screen_element,
                                     dnt_page.screen_element)

        ################## Browsing Privacy ######################
        browsingprivacy_page = settings.open_browsing_privacy()
        self.take_screenshot('browsing_privacy')
        confirm_dialog = browsingprivacy_page.clear_browsing_history()
        self.take_screenshot('browsing_privacy-history')
        confirm_dialog.refresh_root_element()
        confirm_dialog.cancel_clear()
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            settings.screen_element.size['height'],
            screen=browsingprivacy_page.screen_element)
        self.take_screenshot('browsing_privacy')
        confirm_dialog = browsingprivacy_page.clear_private_data()
        self.take_screenshot('browsing_privacy-data')
        confirm_dialog.refresh_root_element()
        confirm_dialog.cancel_clear()
        settings.return_to_prev_menu(settings.screen_element,
                                     browsingprivacy_page.screen_element)
    def orientation_zoom_check(self):

        self.push_resource(self.images, count=self.image_count)

        self.take_screenshot()
        # flick image, change orientation, pinch zoom, change orientation
        # launch gallery, load image.
        gallery = Gallery(self.marionette)
        gallery.launch()
        gallery.wait_for_files_to_load(self.image_count)

        self.assertEqual(gallery.gallery_items_number, self.image_count)

        # Tap first image to open full screen view.
        image = gallery.tap_first_gallery_item()
        self.assertIsNotNone(image.current_image_source)
        self.assertTrue(image.is_photo_toolbar_displayed)

        # scroll back and forth in different display mode
        self.change_orientation('landscape-primary')
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        400, locator=image._current_image_locator)

        self.change_orientation('portrait-primary')
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        400, locator=image._current_image_locator)

        # flip A LOT
        for x in range(0, 4):
            self.change_orientation('landscape-primary')
            self.change_orientation('portrait-primary')
        self.take_screenshot()

        # do pinch zoom while flipping the phone
        GaiaImageCompareTestCase.pinch(self.marionette, image._current_frame_locator, 'in', 20)

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        300, locator=image._current_image_locator)
        self.take_screenshot()
        self.change_orientation('landscape-primary')
        GaiaImageCompareTestCase.pinch(self.marionette, image._current_frame_locator, 'out', 50)
        self.take_screenshot()
        self.change_orientation('portrait-primary')

        image.double_tap_image()
        self.take_screenshot(prewait=3) #takes time for zoom-in action to complete

        # go back and forth with flicking then exit gallery app
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        150, locator=image._current_frame_locator)

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        150, locator=image._current_frame_locator)
        self.take_screenshot()
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ###################### Device Information and its sub pages ######################
        device_info_page = settings.open_device_info()
        self.take_screenshot('dev_info')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            device_info_page.screen_element.size['height'],
            screen=device_info_page.screen_element)
        self.take_screenshot('dev_info')

        moreinfo_page = device_info_page.tap_more_info()
        self.take_screenshot('dev_info-more_info')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            device_info_page.screen_element.size['height'],
            screen=moreinfo_page.screen)
        self.take_screenshot('dev_info-more_info')
        settings.return_to_prev_menu(device_info_page.screen_element)

        device_info_page.tap_reset_phone()
        self.take_screenshot('dev_info-reset')
        device_info_page.confirm_reset(False)

        device_info_page.tap_update_frequency()
        self.take_screenshot('dev_info-update-freq')
        device_info_page.exit_update_frequency()
        settings.return_to_prev_menu(settings.screen_element)

        ### Downloads page
        settings.open_downloads()
        self.take_screenshot('downloads')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_battery()
        self.take_screenshot('battery')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_accessibility()
        self.take_screenshot('accessibility')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_developer()
        self.take_screenshot('developer')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_improve()
        self.take_screenshot('improve')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_help()
        self.take_screenshot('help')
        settings.return_to_prev_menu(settings.screen_element)
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        self.take_screenshot('main')
        for i in range(0, 4):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            settings.screen_element.size['height'], screen = settings.screen_element)
            self.take_screenshot('main')
    def test_settings_app(self, options):
        settings = Settings(self.marionette)
        settings.launch()
        ########### USB Storage #############################
        usb_storage = settings.open_usb_storage()
        usb_storage.enable_usb_storage()
        self.take_screenshot('usbstorage-enablewarning')
        # if usb is enabled, it affects media storage menu
        if options == "disable":
            usb_storage.cancel_usb_storage()
            self.assertFalse(usb_storage.enabled)
            self.take_screenshot('usbstorage')
        else:
            usb_storage.confirm_usb_storage()
            self.assertTrue(usb_storage.enabled)
            self.take_screenshot('usbstorage')

        settings.return_to_prev_menu(settings.screen_element, usb_storage.screen_element)

        ########### Media Storage #############################
        # when USB is enabled, need to capture the 'Not Available' text
        mediastorage_page = settings.open_media_storage()
        self.take_screenshot('media_storage')

        if options == "disable":
            mediastorage_page.internal_storage.tap_format()
            self.take_screenshot('media_storage-format_internal')
            mediastorage_page.internal_storage.cancel_format()

            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            mediastorage_page.screen_element.size['height'],
                                            screen = mediastorage_page.screen_element)
            self.take_screenshot('media_storage')
            mediastorage_page.external_storage0.tap_format()
            self.take_screenshot('media_storage-format_SD')
            mediastorage_page.external_storage0.cancel_format()
            mediastorage_page.external_storage0.tap_eject()
            self.take_screenshot('media_storage-eject_SD')
            mediastorage_page.external_storage0.cancel_eject()

            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            mediastorage_page.screen_element.size['height'],
                                            screen = mediastorage_page.screen_element)
            self.take_screenshot('media_storage')
            mediastorage_page.tap_select_media_location()
            self.take_screenshot('media_storage-select_media_loc')
            mediastorage_page.confirm_select_media_location()
            self.take_screenshot('media_storage-media_locations', top_frame=True)
            mediastorage_page.pick_media_location('Internal')
            settings.return_to_prev_menu(settings.screen_element, mediastorage_page.screen_element)

        ########### Application Storage #############################
            settings.open_application_storage()
            self.take_screenshot('application_storage')
    def test_settings_app(self, options):
        settings = Settings(self.marionette)
        settings.launch()
        ########### USB Storage #############################
        usb_storage = settings.open_usb_storage()
        usb_storage.enable_usb_storage()
        self.take_screenshot('usbstorage-enablewarning')
        # if usb is enabled, it affects media storage menu
        if options == "disable":
            usb_storage.cancel_usb_storage()
            self.assertFalse(usb_storage.enabled)
            self.take_screenshot('usbstorage')
        else:
            usb_storage.confirm_usb_storage()
            self.assertTrue(usb_storage.enabled)
            self.take_screenshot('usbstorage')

        settings.return_to_prev_menu(settings.screen_element, usb_storage.screen_element)

        ########### Media Storage #############################
        # when USB is enabled, need to capture the 'Not Available' text
        mediastorage_page = settings.open_media_storage()
        self.take_screenshot('media_storage')
        if options == "disable":
            mediastorage_page.internal_storage.tap_internal_format()
            self.take_screenshot('media_storage-format_internal')
            mediastorage_page.internal_storage.cancel_format()

            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            mediastorage_page.screen_element.size['height'],
                                            screen = mediastorage_page.screen_element)
            self.take_screenshot('media_storage')
            mediastorage_page.external_storage0.tap_sd_format()
            self.take_screenshot('media_storage-format_SD')
            mediastorage_page.external_storage0.cancel_format()
            mediastorage_page.external_storage0.tap_eject()
            self.take_screenshot('media_storage-eject_SD')
            mediastorage_page.external_storage0.cancel_eject()

            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            mediastorage_page.screen_element.size['height'],
                                            screen = mediastorage_page.screen_element)
            self.take_screenshot('media_storage')
            mediastorage_page.tap_select_media_location()
            self.take_screenshot('media_storage-select_media_loc')
            mediastorage_page.confirm_select_media_location()
            self.take_screenshot('media_storage-media_locations', top_frame=True)
            mediastorage_page.pick_media_location('Internal')
            settings.return_to_prev_menu(settings.screen_element, mediastorage_page.screen_element)

        ########### Application Storage #############################
            settings.open_application_storage()
            self.take_screenshot('application_storage')
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ###################### Device Information and its sub pages ######################
        device_info_page = settings.open_device_info()
        self.take_screenshot('dev_info')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', device_info_page.screen_element.size['height'],
                                        screen = device_info_page.screen_element)
        self.take_screenshot('dev_info')

        moreinfo_page = device_info_page.tap_more_info()
        self.take_screenshot('dev_info-more_info')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', device_info_page.screen_element.size['height'],
                                        screen = moreinfo_page.screen)
        self.take_screenshot('dev_info-more_info')
        settings.return_to_prev_menu(device_info_page.screen_element)

        device_info_page.tap_reset_phone()
        self.take_screenshot('dev_info-reset')
        device_info_page.confirm_reset(False)

        device_info_page.tap_update_frequency()
        self.take_screenshot('dev_info-update-freq')
        device_info_page.exit_update_frequency()
        settings.return_to_prev_menu(settings.screen_element)

        ### Downloads page
        settings.open_downloads()
        self.take_screenshot('downloads')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_battery()
        self.take_screenshot('battery')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_accessibility()
        self.take_screenshot('accessibility')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_developer()
        self.take_screenshot('developer')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_improve()
        self.take_screenshot('improve')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_help()
        self.take_screenshot('help')
        settings.return_to_prev_menu(settings.screen_element)
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ################## Screen Lock ######################
        screenlock_page = settings.open_screen_lock()
        screenlock_page.enable_lockscreen()
        self.take_screenshot('screen_lock')
        screenlock_page.enable_passcode_lock()
        self.take_screenshot('screen_lock-passcode')
        settings.return_to_prev_menu(screenlock_page.screen_element, screenlock_page.passcode_screen_element)
        settings.return_to_prev_menu(settings.screen_element, screenlock_page.screen_element)

        ################## App Permission ######################
        permission_page = settings.open_app_permissions()
        self.take_screenshot('app_permissions')
        permission_page.tap_camera_app()
        self.take_screenshot('app_permissions-app_list')
        permission_page.tap_geolocation_selection()
        self.take_screenshot('app_permissions-geoloc_option',top_frame=True)
        permission_page.exit_geolocation_selection()
        settings.return_to_prev_menu(permission_page.screen_element, permission_page.details_screen_element)
        settings.return_to_prev_menu(settings.screen_element, permission_page.screen_element)

        ################## Do Not Track ######################
        dnt_page = settings.open_do_not_track()
        self.take_screenshot('do_not_track')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        settings.screen_element.size['height'], screen = dnt_page.screen_element)
        self.take_screenshot('do_not_track')
        settings.return_to_prev_menu(settings.screen_element, dnt_page.screen_element)

        ################## Browsing Privacy ######################
        browsingprivacy_page = settings.open_browsing_privacy()
        self.take_screenshot('browsing_privacy')
        confirm_dialog = browsingprivacy_page.clear_browsing_history()
        self.take_screenshot('browsing_privacy-history')
        confirm_dialog.refresh_root_element()
        confirm_dialog.cancel_clear()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        settings.screen_element.size['height'],
                                        screen = browsingprivacy_page.screen_element)
        self.take_screenshot('browsing_privacy')
        confirm_dialog = browsingprivacy_page.clear_private_data()
        self.take_screenshot('browsing_privacy-data')
        confirm_dialog.refresh_root_element()
        confirm_dialog.cancel_clear()
        settings.return_to_prev_menu(settings.screen_element, browsingprivacy_page.screen_element)
Example #10
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        # opening each subpage in Settings menu.  Privacy Control is not opened, because it is a separate app
        #some subpages have their own subpages, and they need to be opened as well.
        settings.open_wifi()
        self.take_screenshot('wifi')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_sim_manager()
        self.take_screenshot('sim_manager')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_call()
        self.take_screenshot('call')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_message()
        self.take_screenshot('message')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_cell_and_data()
        self.take_screenshot('cell_and_data')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_bluetooth()
        self.take_screenshot('bluetooth')
        settings.return_to_prev_menu(settings.screen_element)

        ##################### Internet sharing and its subpages ######################
        internet_settings_page = settings.open_internet_sharing()
        self.take_screenshot('internet_sharing')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            internet_settings_page.screen_element.size['height'],
            screen=internet_settings_page.screen_element)

        self.take_screenshot('internet_sharing')
        hotspot_page = internet_settings_page.tap_hotspot_settings()
        self.take_screenshot('internet_sharing-hotspot')
        hotspot_page.tap_security_settings()
        self.take_screenshot('internet_sharing-hotspot-security')
        hotspot_page.confirm_security_settings()
        settings.return_to_prev_menu(internet_settings_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element)
    def test_settings_app(self, options):
        settings = Settings(self.marionette)
        settings.launch()
        ########### USB Storage #############################
        settings.enable_usb_storage()
        self.take_screenshot("usbstorage-enablewarning")
        # if usb is enabled, it affects media storage menu
        if options == "disable":
            settings.cancel_usb_storage()
            self.assertFalse(settings.is_usb_storage_enabled)
            usbstorage_page = settings.open_usb_storage()
            self.take_screenshot("usbstorage")
            settings.return_to_prev_menu(settings.screen_element, usbstorage_page.screen_element)
        else:
            settings.confirm_usb_storage()
            self.assertTrue(settings.is_usb_storage_enabled)

        ########### Media Storage #############################
        # when USB is enabled, need to capture the 'Not Available' text
        mediastorage_page = settings.open_media_storage()
        self.take_screenshot("media_storage")
        for i in range(0, 2):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                "down",
                mediastorage_page.screen_element.size["height"],
                screen=mediastorage_page.screen_element,
            )
            self.take_screenshot("media_storage")

        if options == "disable":
            mediastorage_page.internal_storage.tap_format()
            self.take_screenshot("media_storage-format_internal")
            mediastorage_page.internal_storage.cancel_format()
            mediastorage_page.external_storage0.tap_format()
            self.take_screenshot("media_storage-format_SD")
            mediastorage_page.external_storage0.cancel_format()
            mediastorage_page.tap_select_media_location()
            self.take_screenshot("media_storage-select_media_loc")
            mediastorage_page.confirm_select_media_location()
            self.take_screenshot("media_storage-media_locations")
            mediastorage_page.pick_media_location("Internal")
            settings.return_to_prev_menu(settings.screen_element, mediastorage_page.screen_element)

            ########### Application Storage #############################
            settings.open_application_storage()
            self.take_screenshot("application_storage")
Example #12
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        # opening each subpage in Settings menu.  Privacy Control is not opened, because it is a separate app
        #some subpages have their own subpages, and they need to be opened as well.
        settings.open_wifi()
        self.take_screenshot('wifi')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_sim_manager()
        self.take_screenshot('sim_manager')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_call()
        self.take_screenshot('call')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_message()
        self.take_screenshot('message')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_cell_and_data()
        self.take_screenshot('cell_and_data')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_bluetooth()
        self.take_screenshot('bluetooth')
        settings.return_to_prev_menu(settings.screen_element)

        ##################### Internet sharing and its subpages ######################
        internet_settings_page = settings.open_internet_sharing()
        self.take_screenshot('internet_sharing')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', internet_settings_page.screen_element.size['height'],
                                        screen = internet_settings_page.screen_element)

        self.take_screenshot('internet_sharing')
        hotspot_page = internet_settings_page.tap_hotspot_settings()
        self.take_screenshot('internet_sharing-hotspot')
        hotspot_page.tap_security_settings()
        self.take_screenshot('internet_sharing-hotspot-security')
        hotspot_page.confirm_security_settings()
        settings.return_to_prev_menu(internet_settings_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element)
Example #13
0
    def test_install_and_execute_bing_map(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        results = marketplace.search(self.app_search)
        first_result = results.search_results[0]
        first_result.tap_install_button()
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        results = marketplace.get_current_displayed_result()
        first_result = results.search_results[0]
        first_result.tap_open_app_button(self.app_title, self._map_locator)

        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_in_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_in_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_in_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)

        # move around
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        100,
                                        locator=self._map_locator)

        self.take_screenshot(prewait=self.draw_wait_time)
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        100,
                                        locator=self._map_locator)

        self.take_screenshot(prewait=self.draw_wait_time)

        # zoom out
        self.marionette.find_element(*self._zoom_out_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_out_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_out_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
Example #14
0
    def test_settings_app(self, options):
        settings = Settings(self.marionette)
        settings.launch()
        ########### USB Storage #############################
        settings.wait_for_usb_storage_toggle_ready()
        settings.toggle_usb_storage()
        self.take_screenshot('usbstorage-enablewarning')
        # if usb is enabled, it affects media storage menu
        if options == "disable":
            settings.cancel_usb_storage()
        else:
            settings.confirm_usb_storage()

        ########### Media Storage #############################
        # when USB is enabled, need to capture the 'Not Available' text
        mediastorage_page = settings.open_media_storage()
        self.take_screenshot('media_storage')
        for i in range(0, 2):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                mediastorage_page.screen_element.size['height'],
                screen=mediastorage_page.screen_element)
            self.take_screenshot('media_storage')

        if options == "disable":
            mediastorage_page.tap_format_internal_storage()
            self.take_screenshot('media_storage-format_internal')
            mediastorage_page.cancel_format_storage()
            mediastorage_page.tap_format_SD()
            self.take_screenshot('media_storage-format_SD')
            mediastorage_page.cancel_format_storage()
            mediastorage_page.tap_select_media_location()
            self.take_screenshot('media_storage-select_media_loc')
            mediastorage_page.confirm_select_media_location()
            self.take_screenshot('media_storage-media_locations')
            mediastorage_page.pick_media_location('Internal')
            settings.return_to_prev_menu(settings.screen_element)

            ########### Application Storage #############################
            settings.open_application_storage()
            self.take_screenshot('application_storage')
Example #15
0
    def test_browser_navigation(self):

        self.test_url = self.marionette.absolute_url("sample_websites/darkness/index.html")

        search = Search(self.marionette)
        search.launch()
        browser = search.go_to_url(self.test_url)
        browser.wait_for_page_to_load()

        # TODO: remove the reloading and rechecking for elements when bug 1128034 is resolved,
        browser.tap_reload_button()
        browser.wait_for_page_to_load()
        browser.switch_to_content()
        Wait(self.marionette).until(lambda m: "Darkness" == m.title)
        Wait(self.marionette).until(lambda m: m.find_element(*self._academic_page_locator).is_displayed())
        self.take_screenshot()

        self.marionette.switch_to_frame()
        GaiaImageCompareTestCase.scroll(self.marionette, "down", 400, locator=browser._browser_frame_locator)

        self.take_screenshot()
    def test_settings_app(self, options):
        settings = Settings(self.marionette)
        settings.launch()
        ########### USB Storage #############################
        settings.wait_for_usb_storage_toggle_ready()
        settings.toggle_usb_storage()
        self.take_screenshot('usbstorage-enablewarning')
        # if usb is enabled, it affects media storage menu
        if options == "disable":
            settings.cancel_usb_storage()
        else:
            settings.confirm_usb_storage()

        ########### Media Storage #############################
        # when USB is enabled, need to capture the 'Not Available' text
        mediastorage_page = settings.open_media_storage()
        self.take_screenshot('media_storage')
        for i in range(0, 2):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            mediastorage_page.screen_element.size['height'],
                                            screen=mediastorage_page.screen_element)
            self.take_screenshot('media_storage')

        if options == "disable":
            mediastorage_page.tap_format_internal_storage()
            self.take_screenshot('media_storage-format_internal')
            mediastorage_page.cancel_format_storage()
            mediastorage_page.tap_format_SD()
            self.take_screenshot('media_storage-format_SD')
            mediastorage_page.cancel_format_storage()
            mediastorage_page.tap_select_media_location()
            self.take_screenshot('media_storage-select_media_loc')
            mediastorage_page.confirm_select_media_location()
            self.take_screenshot('media_storage-media_locations')
            mediastorage_page.pick_media_location('Internal')
            settings.return_to_prev_menu(settings.screen_element)

        ########### Application Storage #############################
            settings.open_application_storage()
            self.take_screenshot('application_storage')
    def test_install_and_execute_bing_map(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        results = marketplace.search(self.app_search)
        first_result = results.search_results[0]
        first_result.tap_install_button()
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        results = marketplace.get_current_displayed_result()
        first_result = results.search_results[0]
        first_result.tap_open_app_button(self._map_locator)

        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_in_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_in_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_in_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)

        # move around
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=self._map_locator)

        self.take_screenshot(prewait=self.draw_wait_time)
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        100, locator=self._map_locator)

        self.take_screenshot(prewait=self.draw_wait_time)

        # zoom out
        self.marionette.find_element(*self._zoom_out_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_out_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
        self.marionette.find_element(*self._zoom_out_locator).tap()
        self.take_screenshot(prewait=self.draw_wait_time)
Example #18
0
    def test_settings_app(self):
        settings = Settings(self.marionette)
        settings.launch()

        # opening each subpage in Settings menu.
        # some subpages have their own subpages, and they need to be opened as well.
        #################### Wi-Fi and its subpages ######################
        wifi_page = settings.open_wifi()
        Wait(self.marionette).until(lambda m: wifi_page.is_wifi_enabled is True)

        self.take_screenshot('wifi-enabled')
        wifi_page.tap_connect_with_wps()
        self.take_screenshot('wifi-wps')
        settings.return_to_prev_menu(wifi_page.screen_element, wifi_page.wps_screen_element)
        self.marionette.execute_script('arguments[0].scrollIntoView(false);', [wifi_page.manage_network_button])
        wifi_page.tap_manage_networks()
        wifi_page.tap_join_hidden_network()
        wifi_page.tap_security_selector()
        self.take_screenshot('wifi-securityType', top_frame=True)
        wifi_page.tap_security_ok()
        self.take_screenshot('wifi-joinHidden')
        settings.return_to_prev_menu(wifi_page.manage_network_screen_element,
                                     wifi_page.join_hidden_network_screen_element)
        self.take_screenshot('wifi-manageNetwork')
        settings.return_to_prev_menu(wifi_page.screen_element, wifi_page.manage_network_screen_element)
        wifi_page.tap_manage_certs()
        wifi_page.tap_import_certs()
        self.take_screenshot('wifi-importCert')
        settings.return_to_prev_menu(wifi_page.manage_certs_screen_element, wifi_page.select_certs_screen_element)
        self.take_screenshot('wifi-manageCert')
        settings.return_to_prev_menu(wifi_page.screen_element, wifi_page.manage_certs_screen_element)
        wifi_page.disable_wifi()
        self.take_screenshot('wifi-disabled')
        settings.return_to_prev_menu(settings.screen_element, wifi_page.screen_element)

        #################### Sim manager and its subpages ######################
        sim_page = settings.open_sim_manager()
        self.take_screenshot('sim_manager')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        sim_page.screen_element.size['height'],
                                        screen = sim_page.screen_element)
        self.take_screenshot('sim_manager')
        sim_page.tap_sim_security()
        sim_page.enable_sim_pin()
        self.take_screenshot('sim_manager-pin_page')
        settings.return_to_prev_menu(sim_page.security_screen_element,
                                     sim_page.sim_pin_screen_element)
        self.take_screenshot('sim_manager-security')
        settings.return_to_prev_menu(sim_page.screen_element, sim_page.security_screen_element)
        settings.return_to_prev_menu(settings.screen_element, sim_page.screen_element)

        ################### Call Settings and its subpages ######################
        cs_page = settings.open_call()
        self.take_screenshot('cs-selectSIM')
        cs_page.tap_sim_1()
        self.take_screenshot('callsettings')
        cs_page.tap_voicemail()
        self.take_screenshot('voicemail')
        settings.return_to_prev_menu(cs_page.cs_screen_element, cs_page.vm_screen_element)

        cs_page.tap_caller_id_selection()
        self.take_screenshot('callerID', top_frame=True)
        cs_page.confirm_caller_id_selection()

        cs_page.tap_fixed_dialing()
        self.take_screenshot('fixeddialing')
        cs_page.tap_auth_numbers()
        self.take_screenshot('authNumbers')
        settings.return_to_prev_menu(cs_page.fixed_dialing_screen_element,
                                     cs_page.auth_screen_element)
        cs_page.enable_fixed_dialing()
        self.take_screenshot('enableFDN')
        settings.return_to_prev_menu(cs_page.fixed_dialing_screen_element,
                                     cs_page.fixed_dialing_simpin_screen_element)
        settings.return_to_prev_menu(cs_page.cs_screen_element,
                                     cs_page.fixed_dialing_screen_element)

        cs_page.tap_call_forwarding()
        self.take_screenshot('callforward_init')
        cs_page.wait_until_call_forwarding_info_received()
        self.take_screenshot('callforward')
        cs_page.tap_always_forward()
        self.take_screenshot('alwaysFwd')
        settings.return_to_prev_menu(cs_page.call_forwarding_screen_element,
                                     cs_page.call_forwarding_always_screen_element)
        cs_page.tap_forward_when_busy()
        self.take_screenshot('busyFwd')
        settings.return_to_prev_menu(cs_page.call_forwarding_screen_element,
                                     cs_page.call_forwarding_busy_screen_element)
        cs_page.tap_forward_unanswered()
        self.take_screenshot('unansweredFwd')
        settings.return_to_prev_menu(cs_page.call_forwarding_screen_element,
                                     cs_page.call_forwarding_unans_screen_element)
        cs_page.tap_forward_unreachable()
        self.take_screenshot('unreachFwd')
        settings.return_to_prev_menu(cs_page.call_forwarding_screen_element,
                                     cs_page.call_forwarding_unreach_screen_element)
        settings.return_to_prev_menu(cs_page.cs_screen_element, cs_page.call_forwarding_screen_element)

        cs_page.tap_call_barring()
        self.take_screenshot('callBarring-init')
        cs_page.wait_until_call_barring_info_received()
        self.take_screenshot('callBarring')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        cs_page.call_barring_screen_element.size['height'],
                                        screen = cs_page.call_barring_screen_element)
        self.take_screenshot('callBarring')
        cs_page.tap_change_passcode()
        self.take_screenshot('callBarring-passcode')
        settings.return_to_prev_menu(cs_page.call_barring_screen_element,
                                     cs_page.call_barring_passcode_screen_element)
        cs_page.tap_call_barring_all()
        self.take_screenshot('callBarring-passcode2')
        cs_page.tap_call_barring_all_cancel()
        settings.return_to_prev_menu(cs_page.cs_screen_element, cs_page.call_barring_screen_element)
        settings.return_to_prev_menu(cs_page.screen_element, cs_page.cs_screen_element)
        settings.return_to_prev_menu(settings.screen_element, cs_page.screen_element)

        ################## Messaging Settings and its subpages ######################
        messaging_page = settings.open_message()
        self.take_screenshot('message')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        messaging_page.screen_element.size['height'],
                                        screen = messaging_page.screen_element)
        self.take_screenshot('message')
        messaging_page.tap_auto_retrieve_selector()
        self.take_screenshot('message-autoretrieve_options',top_frame=True)
        messaging_page.close_retrieve_dialog()
        messaging_page.select_sim_1()
        self.take_screenshot('message-sim_1')
        settings.return_to_prev_menu(messaging_page.screen_element,
                                     messaging_page.settings_screen_element)
        settings.return_to_prev_menu(settings.screen_element, messaging_page.screen_element)

        ################### Cellular & Data and its subpages ######################
        cell_data_page = settings.open_cell_and_data()
        self.take_screenshot('cell_and_data')
        cell_data_page.enable_data()
        self.take_screenshot('data_enable_prompt')
        cell_data_page.data_prompt.turn_on()
        Wait(self.marionette).until(lambda m: cell_data_page.is_data_toggle_checked is True)
        cell_data_page.enable_roaming()
        self.take_screenshot('roaming_enable_prompt')
        cell_data_page.data_prompt.turn_on()
        Wait(self.marionette).until(lambda m: cell_data_page.is_roaming_toggle_checked is True)
        self.take_screenshot('cell_and_data_enabled')
        sim_settings_page = cell_data_page.tap_sim_1_setting()
        self.take_screenshot('sim_1_setting')
        sim_settings_page.tap_network_operator()
        self.take_screenshot('network_op')
        sim_settings_page.tap_network_type()
        self.take_screenshot('cell_network_type',top_frame=True)
        sim_settings_page.confirm_network_type()
        settings.return_to_prev_menu(sim_settings_page.screen_element,
                                     sim_settings_page.network_op_screen_element)
        sim_settings_page.tap_apn_settings()
        self.take_screenshot('apn_settings')
        sim_settings_page.tap_reset_to_default()
        self.take_screenshot('apn_setting_reset')
        sim_settings_page.tap_cancel_reset()
        sim_settings_page.tap_data_settings()
        self.take_screenshot('apn_list')  # all other settings show the same dialog
        sim_settings_page.tap_add_new_apn()
        self.take_screenshot('apn_editor')
        for i in range(0, 2):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            sim_settings_page.apn_editor_screen_element.size['height'],
                                            screen = sim_settings_page.apn_editor_screen_element)
            self.take_screenshot('apn_editor')
        sim_settings_page.select_authentication()
        self.take_screenshot('apn_authentication', top_frame=True)
        sim_settings_page.confirm_apn_selection()
        sim_settings_page.select_protocol()
        self.take_screenshot('apn_protocol', top_frame=True)
        sim_settings_page.confirm_apn_selection()
        sim_settings_page.select_roaming_protocol()
        self.take_screenshot('apn_roaming', top_frame=True)
        sim_settings_page.confirm_apn_selection()

        settings.return_to_prev_menu(sim_settings_page.data_settings_screen_element,
                                     sim_settings_page.apn_editor_screen_element)
        settings.return_to_prev_menu(sim_settings_page.apn_settings_screen_element,
                                     sim_settings_page.data_settings_screen_element)
        settings.return_to_prev_menu(sim_settings_page.screen_element,
                                     sim_settings_page.apn_settings_screen_element)
        settings.return_to_prev_menu(cell_data_page.screen_element, sim_settings_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element, cell_data_page.screen_element)

        ################# Bluetooth and its subpages ######################
        bluetooth_page = settings.open_bluetooth()
        self.take_screenshot('bluetooth-disabled')
        bluetooth_page.refresh_root_element()  # frame is switched, need to refresh the root
        bluetooth_page.enable_bluetooth()
        self.take_screenshot('bluetooth-enabled')
        bluetooth_page.refresh_root_element()
        bluetooth_page.tap_rename_my_device()
        self.take_screenshot('bluetooth-renameDevice')
        bluetooth_page.refresh_root_element()
        bluetooth_page.tap_update_device_name_ok()
        bluetooth_page.disable_bluetooth()
        settings.return_to_prev_menu(settings.screen_element, bluetooth_page.screen_element)

        ##################### Internet sharing and its subpages ######################
        internet_settings_page = settings.open_internet_sharing()
        self.take_screenshot('internet_sharing')
        internet_settings_page.enable_hotspot()
        self.take_screenshot('internet_sharing-hotspot_enabled')
        hotspot_page = internet_settings_page.tap_hotspot_settings()
        self.take_screenshot('internet_sharing-hotspot')
        hotspot_page.tap_security_settings()
        self.take_screenshot('internet_sharing-hotspot-security',top_frame=True)
        hotspot_page.confirm_security_settings()
        settings.return_to_prev_menu(internet_settings_page.screen_element,
                                     hotspot_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     internet_settings_page.screen_element)
Example #19
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ###################### Device Information and its sub pages ######################
        device_info_page = settings.open_device_info()
        self.take_screenshot('dev_info')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            device_info_page.screen_element.rect['height'],
            screen=device_info_page.screen_element)
        self.take_screenshot('dev_info')

        moreinfo_page = device_info_page.tap_more_info()
        self.take_screenshot('dev_info-more_info')
        moreinfo_page.refresh_root_element()
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            moreinfo_page.screen_element.rect['height'],
            screen=moreinfo_page.screen_element)
        self.take_screenshot('dev_info-more_info')
        moreinfo_page.refresh_root_element()
        settings.return_to_prev_menu(device_info_page.screen_element,
                                     device_info_page.moreinfo_screen_element)

        device_info_page.tap_your_rights()
        self.take_screenshot('dev_info-rights')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            device_info_page.rights_screen_element.rect['height'],
            screen=device_info_page.rights_screen_element)
        self.take_screenshot('dev_info-rights')
        settings.return_to_prev_menu(device_info_page.screen_element,
                                     device_info_page.rights_screen_element)

        device_info_page.tap_your_privacy()
        self.take_screenshot('dev_info-privacy')
        settings.return_to_prev_menu(device_info_page.screen_element,
                                     device_info_page.privacy_screen_element)

        device_info_page.tap_legal_info()
        device_info_page.tap_open_source_notices(
        )  # Not checking the entire licensing document
        self.take_screenshot('dev_info-opensource_notice')
        settings.return_to_prev_menu(device_info_page.legal_screen_element,
                                     device_info_page.notice_screen_element)

        device_info_page.tap_obtaining_source_code(
        )  # Not checking the entire licensing document
        self.take_screenshot('dev_info-sourcecode')
        settings.return_to_prev_menu(device_info_page.legal_screen_element,
                                     device_info_page.source_screen_element)
        self.take_screenshot('dev_info-legal_info')
        settings.return_to_prev_menu(device_info_page.screen_element,
                                     device_info_page.legal_screen_element)

        device_info_page.tap_reset_phone()
        self.take_screenshot('dev_info-reset')
        device_info_page.confirm_reset(False)

        device_info_page.tap_update_frequency()
        self.take_screenshot('dev_info-update-freq', top_frame=True)
        device_info_page.exit_update_frequency()
        settings.return_to_prev_menu(settings.screen_element,
                                     device_info_page.screen_element)

        ###################### Download and its sub pages ######################
        dl_page = settings.open_downloads()
        self.take_screenshot('downloads')
        settings.return_to_prev_menu(settings.screen_element,
                                     dl_page.screen_element)

        ###################### Battery and its sub pages ######################
        battery_page = settings.open_battery()
        self.take_screenshot('battery')
        battery_page.tap_turn_on_auto()
        self.take_screenshot('battery-turnon_options')
        battery_page.confirm_turnon_options()
        settings.return_to_prev_menu(settings.screen_element,
                                     battery_page.screen_element)

        ###################### Accessibility and its sub pages ######################
        access_page = settings.open_accessibility()
        color_page = access_page.open_color_settings()
        color_page.toggle_filters()
        self.take_screenshot('accessibility-color')
        color_page.toggle_filters()  # set the filter to the original position
        settings.return_to_prev_menu(access_page.screen_element,
                                     color_page.screen_element)
        audio_page = access_page.open_audio_settings()
        self.take_screenshot('accessibility-audio')
        settings.return_to_prev_menu(access_page.screen_element,
                                     audio_page.screen_element)
        input_page = access_page.open_input_settings()
        self.take_screenshot('accessibility-input')
        input_page.tap_change_delay()
        self.take_screenshot('accessibility-input_delay', top_frame=True)
        input_page.tap_confirm_delay()
        settings.return_to_prev_menu(access_page.screen_element,
                                     input_page.screen_element)
        self.take_screenshot('accessibility')
        settings.return_to_prev_menu(settings.screen_element,
                                     access_page.screen_element)

        ###################### Improve Firefox OS and its sub pages ######################
        improve_page = settings.open_improve()
        self.take_screenshot('improve')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            improve_page.screen_element.rect['height'],
            screen=improve_page.screen_element)
        self.take_screenshot('improve')
        improve_page.tap_send_feedback()
        self.take_screenshot('feedback')
        settings.return_to_prev_menu(improve_page.screen_element,
                                     improve_page.feedback_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     improve_page.screen_element)

        ###################### Help page ######################
        settings.open_help()
        self.take_screenshot('help')
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        #################### Sound ######################
        sound_page = settings.open_sound()
        self.take_screenshot("sound")
        GaiaImageCompareTestCase.scroll(
            self.marionette, "down", sound_page.screen_element.size["height"], screen=sound_page.screen_element
        )
        self.take_screenshot("sound")
        ringtone_page = sound_page.tap_ring_tone_selector()

        self.take_screenshot("sound-ringtones")
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                "down",
                ringtone_page.screen_element.size["height"],
                screen=ringtone_page.screen_element,
            )
            self.take_screenshot("sound-ringtones")

        ringtone_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)

        alerts_page = sound_page.tap_alerts_selector()
        self.take_screenshot("sound-alerts")
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette, "down", alerts_page.screen_element.size["height"], screen=alerts_page.screen_element
            )
            self.take_screenshot("sound-alerts")
        alerts_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)

        manage_page = sound_page.tap_manage_tones_selector()
        self.take_screenshot("sound-manage_tones")
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette, "down", manage_page.screen_element.size["height"], screen=manage_page.screen_element
            )
            self.take_screenshot("sound-manage_tones")

        manage_page.ring_tones[1].select_option()
        self.take_screenshot("sound-manage_tones-share")
        manage_page.cancel_share()
        manage_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)
        settings.return_to_prev_menu(settings.screen_element, sound_page.screen_element)

        #################### Display ######################
        display_page = settings.open_display()
        self.take_screenshot("display")
        display_page.pick_wallpaper()
        self.take_screenshot("display-wallpaper_pick")
        display_page.cancel_pick_wallpaper()
        display_page.tap_timeout_selector()
        self.take_screenshot("display-timeout_values")
        display_page.tap_timeout_confirmation()
        settings.return_to_prev_menu(settings.screen_element, display_page.screen_element)

        #################### Homescreen ######################
        homescreen_page = settings.open_homescreen()
        self.take_screenshot("homescreen")
        homescreen_page.open_select_icon_layout()
        self.take_screenshot("homescreen-layout")
        homescreen_page.open_select_icon_layout()
        settings.return_to_prev_menu(settings.screen_element, homescreen_page.screen_element)

        ################### Search ######################
        search_page = settings.open_search()
        self.take_screenshot("search")
        search_page.open_select_search_engine()
        self.take_screenshot("search-engine_list")
        search_page.close_select_search_engine()
        settings.return_to_prev_menu(settings.screen_element, search_page.screen_element)

        ################## Navigation ######################
        nav_page = settings.open_navigation()
        self.take_screenshot("navigation")
        settings.return_to_prev_menu(settings.screen_element, nav_page.screen_element)

        ################# Notifications ######################
        notif_page = settings.open_notification()
        self.take_screenshot("notification")
        settings.return_to_prev_menu(settings.screen_element, notif_page.screen_element)

        ################ Date and Time ######################
        # Only the main page and Time Format selection is checked
        date_time_page = settings.open_date_and_time()
        self.take_screenshot("date_and_time")
        GaiaImageCompareTestCase.scroll(
            self.marionette, "down", date_time_page.screen_element.size["height"], screen=date_time_page.screen_element
        )
        self.take_screenshot("date_and_time")
        date_time_page.open_time_format()
        self.take_screenshot("date_and_time-time_format")
        date_time_page.close_time_format()
        settings.return_to_prev_menu(settings.screen_element, date_time_page.screen_element)

        ############### Language ######################
        # 'Get more languages' menu cannot be opened due to css bug
        language_page = settings.open_language()
        self.take_screenshot("language")
        language_page.open_select_language()
        self.take_screenshot("language-select")
        language_page.close_select_language()
        settings.return_to_prev_menu(settings.screen_element, language_page.screen_element)

        # This involves app switching, and often would cause whitescreen issue under 319MB memory config
        # Please run in 512 or 1024 MB mode to avoid this issue
        ############### Keyboards ######################
        keyboard_page = settings.open_keyboard()
        self.take_screenshot("keyboard")
        builtin_page = keyboard_page.tap_built_in_keyboards()
        self.take_screenshot("keyboard-built_in")
        builtin_page.tap_user_dictionary()
        self.take_screenshot("keyboard-user-dict")
        builtin_page.tap_user_dict_exit()
        builtin_page.tap_exit()
        keyboard_page.wait_until_page_ready()
        morekb_page = keyboard_page.tap_add_more_keyboards()
        self.take_screenshot("keyboard-more_kb")
        settings.return_to_prev_menu(keyboard_page.screen_element, morekb_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element, keyboard_page.screen_element)

        ############## Themes ######################
        themes_page = settings.open_themes()
        self.take_screenshot("themes")
        settings.return_to_prev_menu(
            settings.screen_element, themes_page.screen_element, back_button=themes_page.back_btn_element
        )

        ############# Addons ######################
        addons_page = settings.open_addons()
        self.take_screenshot("addons")
        addons_page.tap_first_item()
        self.take_screenshot("addons-addon_enabled")
        addons_page.toggle_addon_status()  # addons are enabled by default
        Wait(self.marionette).until(lambda m: not addons_page.is_addon_enabled)
        self.take_screenshot("addons-addon_disabled")
        addons_page.toggle_addon_status()  # revert to original state
        settings.return_to_prev_menu(addons_page.screen_element, addons_page.details_screen_element)
        settings.return_to_prev_menu(settings.screen_element, addons_page.screen_element)

        ############# Achievements ######################
        settings.open_achievements()
        self.take_screenshot("achievements")
Example #21
0
    def test_calendar_flick(self):
        """https://bugzilla.mozilla.org/show_bug.cgi?id=937085"""

        calendar = Calendar(self.marionette)
        calendar.launch()

        calendar.flick_to_next_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.tap_week_display_button()
        time.sleep(3)  # auto-scrolls when week view is entered, wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        300, locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'up',
                                        300, locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()

        calendar.tap_day_display_button()
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        300, locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'up',
                                        300, locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._day_view_locator)
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
Example #22
0
    def test_calendar_flick(self):
        """https://bugzilla.mozilla.org/show_bug.cgi?id=937085"""

        calendar = Calendar(self.marionette)
        calendar.launch()

        calendar.flick_to_next_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.tap_week_display_button()
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        300, locator=calendar._week_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'up',
                                        300, locator=calendar._week_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=calendar._week_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._week_view_locator)
        self.take_screenshot()

        calendar.tap_day_display_button()
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        300, locator=calendar._day_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'up',
                                        300, locator=calendar._day_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=calendar._day_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._day_view_locator)
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._day_view_locator)
        self.take_screenshot()
Example #23
0
    def orientation_zoom_check(self):

        self.push_resource(self.images, count=self.image_count)

        self.take_screenshot()
        # flick image, change orientation, pinch zoom, change orientation
        # launch gallery, load image.
        gallery = Gallery(self.marionette)
        gallery.launch()
        gallery.wait_for_files_to_load(self.image_count)

        self.assertEqual(gallery.gallery_items_number, self.image_count)

        # Tap first image to open full screen view.
        image = gallery.tap_first_gallery_item()
        self.assertIsNotNone(image.current_image_source)
        self.assertTrue(image.is_photo_toolbar_displayed)

        # scroll back and forth in different display mode
        self.change_orientation('landscape-primary')
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        400,
                                        locator=image._current_image_locator)

        self.change_orientation('portrait-primary')
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        400,
                                        locator=image._current_image_locator)

        # flip A LOT
        for x in range(0, 4):
            self.change_orientation('landscape-primary')
            self.change_orientation('portrait-primary')
        self.take_screenshot()

        # do pinch zoom while flipping the phone
        GaiaImageCompareTestCase.pinch(self.marionette,
                                       image._current_frame_locator, 'in', 20)

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        300,
                                        locator=image._current_image_locator)
        self.take_screenshot()
        self.change_orientation('landscape-primary')
        GaiaImageCompareTestCase.pinch(self.marionette,
                                       image._current_frame_locator, 'out', 50)
        self.take_screenshot()
        self.change_orientation('portrait-primary')

        image.double_tap_image()
        self.take_screenshot(
            prewait=3)  #takes time for zoom-in action to complete

        # go back and forth with flicking then exit gallery app
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        150,
                                        locator=image._current_frame_locator)

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        150,
                                        locator=image._current_frame_locator)
        self.take_screenshot()
Example #24
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ################## Screen Lock ######################
        screenlock_view = settings.open_screen_lock()
        screenlock_view.enable_lockscreen()
        self.take_screenshot('screen_lock')
        screenlock_view.enable_passcode_lock()
        self.take_screenshot('screen_lock-passcode')
        settings.return_to_prev_menu(screenlock_view.screen_element)
        settings.return_to_prev_menu(settings.screen_element)

        ################## App Permission ######################
        permission_view = settings.open_app_permissions()
        self.take_screenshot('app_permissions')
        permission_view.tap_first_item()
        self.take_screenshot('app_permissions-app_list')
        permission_view.tap_geolocation_selection()
        self.take_screenshot('app_permissions-geoloc_option')
        permission_view.exit_geolocation_selection()
        settings.return_to_prev_menu(permission_view.screen_element)
        settings.return_to_prev_menu(settings.screen_element)

        ################## Do Not Track ######################
        dnt_page = settings.open_do_not_track()
        self.take_screenshot('do_not_track')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        settings.screen_element.size['height'], screen = dnt_page.screen_element)
        self.take_screenshot('do_not_track')
        settings.return_to_prev_menu(settings.screen_element)

        ################## Browsing Privacy ######################
        browsingprivacy_page = settings.open_browsing_privacy()
        self.take_screenshot('browsing_privacy')
        browsingprivacy_page.tap_clear_browsing_history()
        self.take_screenshot('browsing_privacy-history')
        browsingprivacy_page.cancel_clear()
        browsingprivacy_page.tap_clear_private_data()
        self.take_screenshot('browsing_privacy-data')
        browsingprivacy_page.cancel_clear()
        settings.return_to_prev_menu(settings.screen_element)

        ################# Privacy Controls ######################
        privacycontrol_page = settings.open_privacy_controls()
        self.apps.switch_to_displayed_app()
        privacycontrol_page.tap_close_tour()
        self.take_screenshot('privacy_control')
        privacycontrol_page.tap_about()
        self.take_screenshot('privacy_control-about')
        privacycontrol_page.exit_about()

        #### Location Accuracy
        # Note: Checking only the first app in the app list
        loc_acc_page = privacycontrol_page.tap_loc_accuracy()
        loc_acc_page.switch_loc_adjustment()
        self.take_screenshot('privacy_control-locacc')
        loc_acc_page.tap_adjustment_selection()
        self.take_screenshot('privacy_control-locacc-adjust_selection')
        loc_acc_page.tap_adjustment_ok()
        loc_acc_page.tap_add_exception()
        self.take_screenshot('privacy_control-locacc-applist')
        loc_acc_page.tap_first_app()
        self.take_screenshot('privacy_control-locacc-applist-firstapp')
        loc_acc_page.tap_global_settings()
        self.take_screenshot('privacy_control-locacc-applist-globalsetting')
        loc_acc_page.tap_global_settings_ok()
        settings.return_to_prev_menu(loc_acc_page.applist_screen_element)
        settings.return_to_prev_menu(loc_acc_page.screen_element)
        settings.return_to_prev_menu(privacycontrol_page.screen_element)

        #### Remote Protect
        privacycontrol_page.tap_remote_protect()
        self.take_screenshot('privacy_control-remprotect')
        settings.return_to_prev_menu(privacycontrol_page.screen_element)

        #### Transparency Controls
        #### Note: Only the first app and first permission details are opened for format check
        transpc_view = privacycontrol_page.tap_trans_control()
        self.take_screenshot('privacy_control-trans_ctrl')
        transpc_view.tap_applications()
        self.take_screenshot('privacy_control-trans_ctrl_apps')
        transpc_view.tap_app_order_selection()
        self.take_screenshot('privacy_control-trans_ctrl_apps_order_select')
        transpc_view.tap_app_order_ok()
        #tap first app
        transpc_view.tap_first_app_in_list()
        self.take_screenshot('privacy_control-trans_ctrl_first_app')
        settings.return_to_prev_menu(transpc_view.apps_screen_element, False)
        settings.return_to_prev_menu(transpc_view.screen_element, False)
        transpc_view.tap_permissions()

        self.take_screenshot('privacy_control-transp-perm')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            settings.screen_element.size['height'],
                                            screen=transpc_view.perm_screen_element)
            self.take_screenshot('privacy_control-transp-perm')
        transpc_view.tap_first_perm_in_list()
        self.take_screenshot('privacy_control-trans_ctrl_first_perm')
        settings.return_to_prev_menu(transpc_view.perm_screen_element)
Example #25
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        self.take_screenshot('main')
        for i in range(0, 4):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                            settings.screen_element.size['height'], screen=settings.screen_element)
            self.take_screenshot('main')

        #opening each subpage in Settings menu.  Privacy Control is not opened, because it is a separate app
        #some subpages have their own subpages, and they need to be opened as well.
        settings.open_wifi()
        self.take_screenshot('wifi')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_sim_manager()
        self.take_screenshot('sim_manager')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_call()
        self.take_screenshot('call')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_message()
        self.take_screenshot('message')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_cell_and_data()
        self.take_screenshot('cell_and_data')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_bluetooth()
        self.take_screenshot('bluetooth')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_internet_sharing()
        self.take_screenshot('internet_sharing')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_sound()
        self.take_screenshot('sound')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_display()
        self.take_screenshot('display')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_homescreen()
        self.take_screenshot('homescreen')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_search()
        self.take_screenshot('search')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_navigation()
        self.take_screenshot('navigation')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_notification()
        self.take_screenshot('notification')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_date_and_time()
        self.take_screenshot('date_and_time')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_language()
        self.take_screenshot('language')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_keyboard()
        self.take_screenshot('keyboard')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_themes()
        self.take_screenshot('themes')
        settings.return_to_prev_menu(settings.screen_element, gaia_header=False)

        settings.open_addons()
        self.take_screenshot('addons')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_achievements()
        self.take_screenshot('achievements')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_firefox_accounts()
        self.take_screenshot('firefox_accounts')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_findmydevice()
        self.take_screenshot('findmydevice')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_screen_lock()
        self.take_screenshot('screen_lock')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_app_permissions()
        self.take_screenshot('app_permissions')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_do_not_track()
        self.take_screenshot('do_not_track')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_browsing_privacy()
        self.take_screenshot('browsing_privacy')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_media_storage()
        self.take_screenshot('media_storage')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_application_storage()
        self.take_screenshot('application_storage')
        settings.return_to_prev_menu(settings.screen_element)

        ### Device Information and its sub pages
        device_info_page = settings.open_device_info()
        self.take_screenshot('dev_info')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', device_info_page.screen_element.size['height'],
                                        screen=device_info_page.screen_element)
        self.take_screenshot('dev_info')

        moreinfo_page = device_info_page.tap_more_info()
        self.take_screenshot('dev_info-more_info')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', device_info_page.screen_element.size['height'],
                                        screen=moreinfo_page.screen)
        self.take_screenshot('dev_info-more_info')
        settings.return_to_prev_menu(device_info_page.screen_element)

        device_info_page.tap_reset_phone()
        self.take_screenshot('dev_info-reset')
        device_info_page.confirm_reset(False)

        device_info_page.tap_update_frequency()
        self.take_screenshot('dev_info-update-freq')
        device_info_page.exit_update_frequency()
        settings.return_to_prev_menu(settings.screen_element)

        ### Downloads page
        settings.open_downloads()
        self.take_screenshot('downloads')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_battery()
        self.take_screenshot('battery')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_accessibility()
        self.take_screenshot('accessibility')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_developer()
        self.take_screenshot('developer')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_improve()
        self.take_screenshot('improve')
        settings.return_to_prev_menu(settings.screen_element)

        settings.open_help()
        self.take_screenshot('help')
        settings.return_to_prev_menu(settings.screen_element)
Example #26
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ################## Screen Lock ######################
        screenlock_page = settings.open_screen_lock()
        screenlock_page.enable_lockscreen()
        self.take_screenshot('screen_lock')
        screenlock_page.enable_passcode_lock()
        self.take_screenshot('screen_lock-passcode')
        settings.return_to_prev_menu(screenlock_page.screen_element,
                                     screenlock_page.passcode_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     screenlock_page.screen_element)

        ################## App Permission ######################
        permission_page = settings.open_app_permissions()
        self.take_screenshot('app_permissions')
        permission_page.tap_camera_app()
        self.take_screenshot('app_permissions-app_list')
        permission_page.tap_geolocation_selection()
        self.take_screenshot('app_permissions-geoloc_option')
        permission_page.exit_geolocation_selection()
        settings.return_to_prev_menu(permission_page.screen_element,
                                     permission_page.details_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     permission_page.screen_element)

        ################## Do Not Track ######################
        dnt_page = settings.open_do_not_track()
        self.take_screenshot('do_not_track')
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        settings.screen_element.size['height'],
                                        screen=dnt_page.screen_element)
        self.take_screenshot('do_not_track')
        settings.return_to_prev_menu(settings.screen_element,
                                     dnt_page.screen_element)

        ################## Browsing Privacy ######################
        browsingprivacy_page = settings.open_browsing_privacy()
        self.take_screenshot('browsing_privacy')
        browsingprivacy_page.tap_clear_browsing_history()
        self.take_screenshot('browsing_privacy-history')
        browsingprivacy_page.cancel_clear()
        browsingprivacy_page.tap_clear_private_data()
        self.take_screenshot('browsing_privacy-data')
        browsingprivacy_page.cancel_clear()
        settings.return_to_prev_menu(settings.screen_element,
                                     browsingprivacy_page.screen_element)

        # Note: this does not check the initial guided tour
        ################# Privacy Controls ######################
        privacycontrol_page = settings.open_privacy_controls()
        self.apps.switch_to_displayed_app()
        privacycontrol_page.tap_close_tour()
        self.take_screenshot('privacy_control')
        privacycontrol_page.tap_about()
        self.take_screenshot('privacy_control-about')
        privacycontrol_page.return_to_prev_menu(
            privacycontrol_page.screen_element,
            privacycontrol_page.about_screen_element)
        #privacycontrol_page.exit_about()

        ################# Location Accuracy
        # Note: Checking only the first app in the app list
        loc_acc_page = privacycontrol_page.tap_loc_accuracy()
        loc_acc_page.switch_loc_adjustment()
        self.take_screenshot('privacy_control-locacc')
        loc_acc_page.tap_adjustment_selection()
        self.take_screenshot('privacy_control-locacc-adjust_selection')
        loc_acc_page.tap_adjustment_ok()
        loc_acc_page.tap_add_exception()
        self.take_screenshot('privacy_control-locacc-applist')
        loc_acc_page.tap_first_app()
        self.take_screenshot('privacy_control-locacc-applist-firstapp')
        loc_acc_page.tap_global_settings()
        self.take_screenshot('privacy_control-locacc-applist-globalsetting')
        loc_acc_page.tap_global_settings_ok()
        privacycontrol_page.return_to_prev_menu(
            loc_acc_page.applist_screen_element,
            loc_acc_page.appview_screen_element)
        privacycontrol_page.return_to_prev_menu(
            loc_acc_page.screen_element, loc_acc_page.applist_screen_element)
        privacycontrol_page.return_to_prev_menu(
            privacycontrol_page.screen_element, loc_acc_page.screen_element)

        ################# Remote Protect #################
        rprotect_page = privacycontrol_page.tap_remote_protect()
        self.take_screenshot('privacy_control-remprotect')
        privacycontrol_page.return_to_prev_menu(
            privacycontrol_page.screen_element, rprotect_page.screen_element)

        # Note: Only the first app and first permission details are opened for format check
        ################# Transparency Controls #################
        transpc_page = privacycontrol_page.tap_trans_control()
        self.take_screenshot('privacy_control-trans_ctrl')
        transpc_page.tap_applications()
        self.take_screenshot('privacy_control-trans_ctrl_apps')
        transpc_page.tap_app_order_selection()
        self.take_screenshot('privacy_control-trans_ctrl_apps_order_select')
        transpc_page.tap_app_order_ok()
        #tap first app
        transpc_page.tap_first_app_in_list()
        self.take_screenshot('privacy_control-trans_ctrl_first_app')
        privacycontrol_page.return_to_prev_menu(
            transpc_page.apps_screen_element,
            transpc_page.apps_detail_element,
            html_header_locator=transpc_page._app_detail_header_locator)
        privacycontrol_page.return_to_prev_menu(
            transpc_page.screen_element,
            transpc_page.apps_screen_element,
            html_header_locator=transpc_page._app_list_header_locator)
        transpc_page.tap_permissions()

        self.take_screenshot('privacy_control-transp-perm')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                settings.screen_element.size['height'],
                screen=transpc_page.perm_screen_element)
            self.take_screenshot('privacy_control-transp-perm')
        transpc_page.tap_first_perm_in_list()
        self.take_screenshot('privacy_control-trans_ctrl_first_perm')
        privacycontrol_page.return_to_prev_menu(
            transpc_page.perm_screen_element, transpc_page.perm_detail_element)
Example #27
0
    def test_settings_app(self):
        settings = Settings(self.marionette)
        settings.launch()

        # opening each subpage in Settings menu.
        # some subpages have their own subpages, and they need to be opened as well.
        #################### Wi-Fi and its subpages ######################
        wifi_page = settings.open_wifi()
        Wait(
            self.marionette).until(lambda m: wifi_page.is_wifi_enabled is True)

        self.take_screenshot('wifi-enabled')
        wifi_page.tap_connect_with_wps()
        self.take_screenshot('wifi-wps')
        settings.return_to_prev_menu(wifi_page.screen_element,
                                     wifi_page.wps_screen_element)
        self.marionette.execute_script('arguments[0].scrollIntoView(false);',
                                       [wifi_page.manage_network_button])
        wifi_page.tap_manage_networks()
        wifi_page.tap_join_hidden_network()
        wifi_page.tap_security_selector()
        self.take_screenshot('wifi-securityType', top_frame=True)
        wifi_page.tap_security_ok()
        self.take_screenshot('wifi-joinHidden')
        settings.return_to_prev_menu(
            wifi_page.manage_network_screen_element,
            wifi_page.join_hidden_network_screen_element)
        self.take_screenshot('wifi-manageNetwork')
        settings.return_to_prev_menu(wifi_page.screen_element,
                                     wifi_page.manage_network_screen_element)
        wifi_page.tap_manage_certs()
        wifi_page.tap_import_certs()
        self.take_screenshot('wifi-importCert')
        settings.return_to_prev_menu(wifi_page.manage_certs_screen_element,
                                     wifi_page.select_certs_screen_element)
        self.take_screenshot('wifi-manageCert')
        settings.return_to_prev_menu(wifi_page.screen_element,
                                     wifi_page.manage_certs_screen_element)
        wifi_page.disable_wifi()
        self.take_screenshot('wifi-disabled')
        settings.return_to_prev_menu(settings.screen_element,
                                     wifi_page.screen_element)

        #################### Sim manager and its subpages ######################
        sim_page = settings.open_sim_manager()
        self.take_screenshot('sim_manager')
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        sim_page.screen_element.size['height'],
                                        screen=sim_page.screen_element)
        self.take_screenshot('sim_manager')
        sim_page.tap_sim_security()
        sim_page.enable_sim_pin()
        self.take_screenshot('sim_manager-pin_page')
        settings.return_to_prev_menu(sim_page.security_screen_element,
                                     sim_page.sim_pin_screen_element)
        self.take_screenshot('sim_manager-security')
        settings.return_to_prev_menu(sim_page.screen_element,
                                     sim_page.security_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     sim_page.screen_element)

        ################### Call Settings and its subpages ######################
        cs_page = settings.open_call()
        self.take_screenshot('cs-selectSIM')
        cs_page.tap_sim_1()
        self.take_screenshot('callsettings')
        cs_page.tap_voicemail()
        self.take_screenshot('voicemail')
        settings.return_to_prev_menu(cs_page.cs_screen_element,
                                     cs_page.vm_screen_element)

        cs_page.tap_caller_id_selection()
        self.take_screenshot('callerID', top_frame=True)
        cs_page.confirm_caller_id_selection()

        cs_page.tap_fixed_dialing()
        self.take_screenshot('fixeddialing')
        cs_page.tap_auth_numbers()
        self.take_screenshot('authNumbers')
        settings.return_to_prev_menu(cs_page.fixed_dialing_screen_element,
                                     cs_page.auth_screen_element)
        cs_page.enable_fixed_dialing()
        self.take_screenshot('enableFDN')
        settings.return_to_prev_menu(
            cs_page.fixed_dialing_screen_element,
            cs_page.fixed_dialing_simpin_screen_element)
        settings.return_to_prev_menu(cs_page.cs_screen_element,
                                     cs_page.fixed_dialing_screen_element)

        cs_page.tap_call_forwarding()
        self.take_screenshot('callforward_init')
        cs_page.wait_until_call_forwarding_info_received()
        self.take_screenshot('callforward')
        cs_page.tap_always_forward()
        self.take_screenshot('alwaysFwd')
        settings.return_to_prev_menu(
            cs_page.call_forwarding_screen_element,
            cs_page.call_forwarding_always_screen_element)
        cs_page.tap_forward_when_busy()
        self.take_screenshot('busyFwd')
        settings.return_to_prev_menu(
            cs_page.call_forwarding_screen_element,
            cs_page.call_forwarding_busy_screen_element)
        cs_page.tap_forward_unanswered()
        self.take_screenshot('unansweredFwd')
        settings.return_to_prev_menu(
            cs_page.call_forwarding_screen_element,
            cs_page.call_forwarding_unans_screen_element)
        cs_page.tap_forward_unreachable()
        self.take_screenshot('unreachFwd')
        settings.return_to_prev_menu(
            cs_page.call_forwarding_screen_element,
            cs_page.call_forwarding_unreach_screen_element)
        settings.return_to_prev_menu(cs_page.cs_screen_element,
                                     cs_page.call_forwarding_screen_element)

        cs_page.tap_call_barring()
        cs_page.wait_until_call_barring_info_received(
        )  # this sometimes happens in less than a second,
        # making it difficult to obtain init view
        self.take_screenshot('callBarring')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            cs_page.call_barring_screen_element.size['height'],
            screen=cs_page.call_barring_screen_element)
        self.take_screenshot('callBarring')
        cs_page.tap_change_passcode()
        self.take_screenshot('callBarring-passcode')
        settings.return_to_prev_menu(
            cs_page.call_barring_screen_element,
            cs_page.call_barring_passcode_screen_element)
        cs_page.tap_call_barring_all()
        self.take_screenshot('callBarring-passcode2')
        cs_page.tap_call_barring_all_cancel()
        settings.return_to_prev_menu(cs_page.cs_screen_element,
                                     cs_page.call_barring_screen_element)
        settings.return_to_prev_menu(cs_page.screen_element,
                                     cs_page.cs_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     cs_page.screen_element)

        ################## Messaging Settings and its subpages ######################
        messaging_page = settings.open_message()
        self.take_screenshot('message')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            messaging_page.screen_element.size['height'],
            screen=messaging_page.screen_element)
        self.take_screenshot('message')
        messaging_page.tap_auto_retrieve_selector()
        self.take_screenshot('message-autoretrieve_options', top_frame=True)
        messaging_page.close_retrieve_dialog()
        messaging_page.select_sim_1()
        self.take_screenshot('message-sim_1')
        settings.return_to_prev_menu(messaging_page.screen_element,
                                     messaging_page.settings_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     messaging_page.screen_element)

        ################### Cellular & Data and its subpages ######################
        cell_data_page = settings.open_cell_and_data()
        self.take_screenshot('cell_and_data')
        cell_data_page.enable_data()
        self.take_screenshot('data_enable_prompt')
        cell_data_page.data_prompt.turn_on()
        Wait(self.marionette).until(
            lambda m: cell_data_page.is_data_toggle_checked is True)
        cell_data_page.enable_roaming()
        self.take_screenshot('roaming_enable_prompt')
        cell_data_page.data_prompt.turn_on()
        Wait(self.marionette).until(
            lambda m: cell_data_page.is_roaming_toggle_checked is True)
        self.take_screenshot('cell_and_data_enabled')
        sim_settings_page = cell_data_page.tap_sim_1_setting()
        self.take_screenshot('sim_1_setting')
        sim_settings_page.tap_network_operator()
        self.take_screenshot('network_op')
        sim_settings_page.tap_network_type()
        self.take_screenshot('cell_network_type', top_frame=True)
        sim_settings_page.confirm_network_type()
        settings.return_to_prev_menu(
            sim_settings_page.screen_element,
            sim_settings_page.network_op_screen_element)
        sim_settings_page.tap_apn_settings()
        self.take_screenshot('apn_settings')
        sim_settings_page.tap_reset_to_default()
        self.take_screenshot('apn_setting_reset')
        sim_settings_page.tap_cancel_reset()
        sim_settings_page.tap_data_settings()
        self.take_screenshot(
            'apn_list')  # all other settings show the same dialog
        sim_settings_page.tap_add_new_apn()
        self.take_screenshot('apn_editor')
        for i in range(0, 2):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                sim_settings_page.apn_editor_screen_element.size['height'],
                screen=sim_settings_page.apn_editor_screen_element)
            self.take_screenshot('apn_editor')
        sim_settings_page.select_authentication()
        self.take_screenshot('apn_authentication', top_frame=True)
        sim_settings_page.confirm_apn_selection()
        sim_settings_page.select_protocol()
        self.take_screenshot('apn_protocol', top_frame=True)
        sim_settings_page.confirm_apn_selection()
        sim_settings_page.select_roaming_protocol()
        self.take_screenshot('apn_roaming', top_frame=True)
        sim_settings_page.confirm_apn_selection()

        settings.return_to_prev_menu(
            sim_settings_page.data_settings_screen_element,
            sim_settings_page.apn_editor_screen_element)
        settings.return_to_prev_menu(
            sim_settings_page.apn_settings_screen_element,
            sim_settings_page.data_settings_screen_element)
        settings.return_to_prev_menu(
            sim_settings_page.screen_element,
            sim_settings_page.apn_settings_screen_element)
        settings.return_to_prev_menu(cell_data_page.screen_element,
                                     sim_settings_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     cell_data_page.screen_element)

        ################# Bluetooth and its subpages ######################
        bluetooth_page = settings.open_bluetooth()
        self.take_screenshot('bluetooth-disabled')
        bluetooth_page.refresh_root_element(
        )  # frame is switched, need to refresh the root
        bluetooth_page.enable_bluetooth()
        self.take_screenshot('bluetooth-enabled')
        bluetooth_page.refresh_root_element()
        bluetooth_page.tap_rename_my_device()
        self.take_screenshot('bluetooth-renameDevice')
        bluetooth_page.refresh_root_element()
        bluetooth_page.tap_update_device_name_ok()
        bluetooth_page.disable_bluetooth()
        settings.return_to_prev_menu(settings.screen_element,
                                     bluetooth_page.screen_element)

        ##################### Internet sharing and its subpages ######################
        internet_settings_page = settings.open_internet_sharing()
        self.take_screenshot('internet_sharing')
        internet_settings_page.enable_hotspot()
        self.take_screenshot('internet_sharing-hotspot_enabled')
        hotspot_page = internet_settings_page.tap_hotspot_settings()
        self.take_screenshot('internet_sharing-hotspot')
        hotspot_page.tap_security_settings()
        self.take_screenshot('internet_sharing-hotspot-security',
                             top_frame=True)
        hotspot_page.confirm_security_settings()
        settings.return_to_prev_menu(internet_settings_page.screen_element,
                                     hotspot_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     internet_settings_page.screen_element)
    def test_install_and_execute_bing_map(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        results = marketplace.search(self.app_search)
        first_result = results.search_results[0]
        app_name = first_result.get_app_name()
        first_result.tap_install_button()

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.assertEqual(self.apps.displayed_app.name, 'Marketplace')

        self.device.touch_home_button()

        # Check that the icon of the app is on the homescreen
        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(app_name)

        installed_app = homescreen.installed_app(app_name)
        installed_app.tap_icon()

        Wait(self.marionette).until(lambda m: m.title == self.app_title)
        bingmap = self.marionette.find_element(*self._map_locator)
        Wait(self.marionette).until(lambda m: bingmap.is_displayed())
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # once the map is completely loaded, use the UI to render different views
        # zoom in
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # move around
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        100,
                                        locator=self._map_locator)

        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        100,
                                        locator=self._map_locator)

        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # zoom out
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        #################### Sound ######################
        sound_page = settings.open_sound()
        self.take_screenshot('sound')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', sound_page.screen_element.size['height'],
                                        screen=sound_page.screen_element)
        self.take_screenshot('sound')
        ringtone_page = sound_page.tap_ring_tone_selector()

        self.take_screenshot('sound-ringtones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down', ringtone_page.screen_element.size['height'],
                                            screen = ringtone_page.screen_element)
            self.take_screenshot('sound-ringtones')

        ringtone_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)

        alerts_page = sound_page.tap_alerts_selector()
        self.take_screenshot('sound-alerts')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down', alerts_page.screen_element.size['height'],
                                            screen=alerts_page.screen_element)
            self.take_screenshot('sound-alerts')
        alerts_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)

        manage_page = sound_page.tap_manage_tones_selector()
        self.take_screenshot('sound-manage_tones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down', manage_page.screen_element.size['height'],
                                            screen=manage_page.screen_element)
            self.take_screenshot('sound-manage_tones')

        manage_page.ring_tones[1].select_option()
        self.take_screenshot('sound-manage_tones-share')
        manage_page.cancel_share()
        manage_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)
        settings.return_to_prev_menu(settings.screen_element)

        #################### Display ######################
        display_page = settings.open_display()
        self.take_screenshot('display')
        display_page.pick_wallpaper()
        self.take_screenshot('display-wallpaper_pick')
        display_page.cancel_pick_wallpaper()
        display_page.tap_timeout_selector()
        self.take_screenshot('display-timeout_values')
        display_page.tap_timeout_confirmation()
        settings.return_to_prev_menu(settings.screen_element)

        #################### Homescreen ######################
        homescreen_page = settings.open_homescreen()
        self.take_screenshot('homescreen')
        homescreen_page.open_select_icon_layout()
        self.take_screenshot('homescreen-layout')
        homescreen_page.open_select_icon_layout()
        settings.return_to_prev_menu(settings.screen_element)

        ################### Search ######################
        search_page = settings.open_search()
        self.take_screenshot('search')
        search_page.open_select_search_engine()
        self.take_screenshot('search-engine_list')
        search_page.close_select_search_engine()
        settings.return_to_prev_menu(settings.screen_element)

        ################## Search ######################
        settings.open_navigation()
        self.take_screenshot('navigation')
        settings.return_to_prev_menu(settings.screen_element)

        ################# Notifications ######################
        settings.open_notification()
        self.take_screenshot('notification')
        settings.return_to_prev_menu(settings.screen_element)

        ################ Notifications ######################
        # Only the main page and Time Format selection is checked
        date_time_page = settings.open_date_and_time()
        self.take_screenshot('date_and_time')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', date_time_page.screen_element.size['height'],
                                        screen=date_time_page.screen_element)
        self.take_screenshot('date_and_time')
        date_time_page.open_time_format()
        self.take_screenshot('date_and_time-time_format')
        date_time_page.close_time_format()
        settings.return_to_prev_menu(settings.screen_element)

        ############### Language ######################
        # 'Get more languages' menu cannot be opened due to css bug
        language_page = settings.open_language()
        self.take_screenshot('language')
        language_page.open_select_language()
        self.take_screenshot('language-select')
        language_page.close_select_language()
        settings.return_to_prev_menu(settings.screen_element)

        ############### Keyboards ######################
        keyboard_page = settings.open_keyboard()
        self.take_screenshot('keyboard')
        builtin_page = keyboard_page.tap_built_in_keyboards()
        self.take_screenshot('keyboard-built_in')
        builtin_page.tap_user_dictionary()
        self.take_screenshot('keyboard-user-dict')
        builtin_page.tap_user_dict_exit()
        builtin_page.tap_exit()
        keyboard_page.wait_until_page_ready()
        keyboard_page.tap_add_more_keyboards()
        self.take_screenshot('keyboard-more_kb')
        settings.return_to_prev_menu(keyboard_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element)

        ############## Themes ######################
        settings.open_themes()
        self.take_screenshot('themes')
        settings.return_to_prev_menu(settings.screen_element, gaia_header=False)

        ############# Addons ######################
        addons_page = settings.open_addons()
        self.take_screenshot('addons')
        addons_page.tap_first_item()
        self.take_screenshot('addons-addon')
        addons_page.toggle_addon_status()  # addons are disabled by default
        self.take_screenshot('addons-addon')
        addons_page.toggle_addon_status()
        addons_page.exit_addon_description()
        settings.return_to_prev_menu(settings.screen_element)

        ############# Achievements ######################
        settings.open_achievements()
        self.take_screenshot('achievements')
        settings.return_to_prev_menu(settings.screen_element)
Example #30
0
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        #################### Sound ######################
        sound_page = settings.open_sound()
        self.take_screenshot('sound')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            sound_page.screen_element.size['height'],
            screen=sound_page.screen_element)
        self.take_screenshot('sound')
        ringtone_page = sound_page.tap_ring_tone_selector()

        self.take_screenshot('sound-ringtones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                ringtone_page.screen_element.size['height'],
                screen=ringtone_page.screen_element)
            self.take_screenshot('sound-ringtones')

        ringtone_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(
            lambda m: sound_page.ring_tone_selector_visible)

        alerts_page = sound_page.tap_alerts_selector()
        self.take_screenshot('sound-alerts')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                alerts_page.screen_element.size['height'],
                screen=alerts_page.screen_element)
            self.take_screenshot('sound-alerts')
        alerts_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(
            lambda m: sound_page.ring_tone_selector_visible)

        manage_page = sound_page.tap_manage_tones_selector()
        self.take_screenshot('sound-manage_tones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                manage_page.screen_element.size['height'],
                screen=manage_page.screen_element)
            self.take_screenshot('sound-manage_tones')

        manage_page.ring_tones[1].select_option()
        self.take_screenshot('sound-manage_tones-share')
        manage_page.cancel_share()
        manage_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(
            lambda m: sound_page.ring_tone_selector_visible)
        settings.return_to_prev_menu(settings.screen_element)

        #################### Display ######################
        display_page = settings.open_display()
        self.take_screenshot('display')
        display_page.pick_wallpaper()
        self.take_screenshot('display-wallpaper_pick')
        display_page.cancel_pick_wallpaper()
        display_page.tap_timeout_selector()
        self.take_screenshot('display-timeout_values')
        display_page.tap_timeout_confirmation()
        settings.return_to_prev_menu(settings.screen_element)

        #################### Homescreen ######################
        homescreen_page = settings.open_homescreen()
        self.take_screenshot('homescreen')
        homescreen_page.open_select_icon_layout()
        self.take_screenshot('homescreen-layout')
        homescreen_page.open_select_icon_layout()
        settings.return_to_prev_menu(settings.screen_element)

        ################### Search ######################
        search_page = settings.open_search()
        self.take_screenshot('search')
        search_page.open_select_search_engine()
        self.take_screenshot('search-engine_list')
        search_page.close_select_search_engine()
        settings.return_to_prev_menu(settings.screen_element)

        ################## Search ######################
        settings.open_navigation()
        self.take_screenshot('navigation')
        settings.return_to_prev_menu(settings.screen_element)

        ################# Notifications ######################
        settings.open_notification()
        self.take_screenshot('notification')
        settings.return_to_prev_menu(settings.screen_element)

        ################ Notifications ######################
        # Only the main page and Time Format selection is checked
        date_time_page = settings.open_date_and_time()
        self.take_screenshot('date_and_time')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            date_time_page.screen_element.size['height'],
            screen=date_time_page.screen_element)
        self.take_screenshot('date_and_time')
        date_time_page.open_time_format()
        self.take_screenshot('date_and_time-time_format')
        date_time_page.close_time_format()
        settings.return_to_prev_menu(settings.screen_element)

        ############### Language ######################
        # 'Get more languages' menu cannot be opened due to css bug
        language_page = settings.open_language()
        self.take_screenshot('language')
        language_page.open_select_language()
        self.take_screenshot('language-select')
        language_page.close_select_language()
        settings.return_to_prev_menu(settings.screen_element)

        ############### Keyboards ######################
        keyboard_page = settings.open_keyboard()
        self.take_screenshot('keyboard')
        builtin_page = keyboard_page.tap_built_in_keyboards()
        self.take_screenshot('keyboard-built_in')
        builtin_page.tap_user_dictionary()
        self.take_screenshot('keyboard-user-dict')
        builtin_page.tap_user_dict_exit()
        builtin_page.tap_exit()
        keyboard_page.wait_until_page_ready()
        keyboard_page.tap_add_more_keyboards()
        self.take_screenshot('keyboard-more_kb')
        settings.return_to_prev_menu(keyboard_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element)

        ############## Themes ######################
        settings.open_themes()
        self.take_screenshot('themes')
        settings.return_to_prev_menu(settings.screen_element,
                                     gaia_header=False)

        ############# Addons ######################
        addons_page = settings.open_addons()
        self.take_screenshot('addons')
        addons_page.tap_first_item()
        self.take_screenshot('addons-addon')
        addons_page.toggle_addon_status()  # addons are disabled by default
        self.take_screenshot('addons-addon')
        addons_page.toggle_addon_status()
        addons_page.exit_addon_description()
        settings.return_to_prev_menu(settings.screen_element)

        ############# Achievements ######################
        settings.open_achievements()
        self.take_screenshot('achievements')
        settings.return_to_prev_menu(settings.screen_element)
    def test_install_and_execute_bing_map(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        results = marketplace.search(self.app_search)
        first_result = results.search_results[0]
        app_name = first_result.get_app_name()
        first_result.tap_install_button()

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.assertEqual(self.apps.displayed_app.name, 'Marketplace')

        self.device.touch_home_button()

        # Check that the icon of the app is on the homescreen
        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(app_name)

        installed_app = homescreen.installed_app(app_name)
        installed_app.tap_icon()

        Wait(self.marionette).until(lambda m: m.title == self.app_title)
        bingmap = self.marionette.find_element(*self._map_locator)
        Wait(self.marionette).until(lambda m: bingmap.is_displayed())
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # once the map is completely loaded, use the UI to render different views
        # zoom in
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # move around
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=self._map_locator)

        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        100, locator=self._map_locator)

        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # zoom out
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
Example #32
0
    def test_calendar_flick(self):
        """https://bugzilla.mozilla.org/show_bug.cgi?id=937085"""

        calendar = Calendar(self.marionette)
        calendar.launch()

        calendar.flick_to_next_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.tap_week_display_button()
        time.sleep(
            3
        )  # auto-scrolls when week view is entered, wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        300,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'up',
                                        300,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        100,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        100,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()

        calendar.tap_day_display_button()
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        300,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'up',
                                        300,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        100,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        100,
                                        locator=calendar._day_view_locator)
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        100,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ###################### Device Information and its sub pages ######################
        device_info_page = settings.open_device_info()
        self.take_screenshot('dev_info')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', device_info_page.screen_element.rect['height'],
                                        screen = device_info_page.screen_element)
        self.take_screenshot('dev_info')

        moreinfo_page = device_info_page.tap_more_info()
        self.take_screenshot('dev_info-more_info')
        moreinfo_page.refresh_root_element()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', moreinfo_page.screen_element.rect['height'],
                                        screen=moreinfo_page.screen_element)
        self.take_screenshot('dev_info-more_info')
        moreinfo_page.refresh_root_element()
        settings.return_to_prev_menu(device_info_page.screen_element, device_info_page.moreinfo_screen_element)

        device_info_page.tap_your_rights()
        self.take_screenshot('dev_info-rights')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', device_info_page.rights_screen_element.rect['height'],
                                        screen = device_info_page.rights_screen_element)
        self.take_screenshot('dev_info-rights')
        settings.return_to_prev_menu(device_info_page.screen_element, device_info_page.rights_screen_element)

        device_info_page.tap_your_privacy()
        self.take_screenshot('dev_info-privacy')
        settings.return_to_prev_menu(device_info_page.screen_element, device_info_page.privacy_screen_element)

        device_info_page.tap_legal_info()
        device_info_page.tap_open_source_notices()  # Not checking the entire licensing document
        self.take_screenshot('dev_info-opensource_notice')
        settings.return_to_prev_menu(device_info_page.legal_screen_element, device_info_page.notice_screen_element)

        device_info_page.tap_obtaining_source_code()  # Not checking the entire licensing document
        self.take_screenshot('dev_info-sourcecode')
        settings.return_to_prev_menu(device_info_page.legal_screen_element, device_info_page.source_screen_element)
        self.take_screenshot('dev_info-legal_info')
        settings.return_to_prev_menu(device_info_page.screen_element, device_info_page.legal_screen_element)

        device_info_page.tap_reset_phone()
        self.take_screenshot('dev_info-reset')
        device_info_page.confirm_reset(False)

        device_info_page.tap_update_frequency()
        self.take_screenshot('dev_info-update-freq', top_frame=True)
        device_info_page.exit_update_frequency()
        settings.return_to_prev_menu(settings.screen_element, device_info_page.screen_element)

        ###################### Download and its sub pages ######################
        dl_page = settings.open_downloads()
        self.take_screenshot('downloads')
        settings.return_to_prev_menu(settings.screen_element, dl_page.screen_element)

        ###################### Battery and its sub pages ######################
        battery_page = settings.open_battery()
        self.take_screenshot('battery')
        battery_page.tap_turn_on_auto()
        self.take_screenshot('battery-turnon_options')
        battery_page.confirm_turnon_options()
        settings.return_to_prev_menu(settings.screen_element, battery_page.screen_element)

        ###################### Accessibility and its sub pages ######################
        access_page = settings.open_accessibility()
        color_page = access_page.open_color_settings()
        color_page.toggle_filters()
        self.take_screenshot('accessibility-color')
        color_page.toggle_filters()  # set the filter to the original position
        settings.return_to_prev_menu(access_page.screen_element, color_page.screen_element)
        self.take_screenshot('accessibility')
        settings.return_to_prev_menu(settings.screen_element, access_page.screen_element)

        ###################### Improve Firefox OS and its sub pages ######################
        improve_page = settings.open_improve()
        self.take_screenshot('improve')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', improve_page.screen_element.rect['height'],
                                        screen=improve_page.screen_element)
        self.take_screenshot('improve')
        settings.return_to_prev_menu(settings.screen_element, improve_page.screen_element)

        ###################### Help page ######################
        settings.open_help()
        self.take_screenshot('help')
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        #################### Sound ######################
        sound_page = settings.open_sound()
        self.take_screenshot('sound')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', sound_page.screen_element.size['height'],
                                        screen=sound_page.screen_element)
        self.take_screenshot('sound')
        ringtone_page = sound_page.tap_ring_tone_selector()
        self.take_screenshot('sound-ringtones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down', ringtone_page.screen_element.size['height'],
                                            screen=ringtone_page.screen_element)
            self.take_screenshot('sound-ringtones')

        ringtone_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)

        alerts_page = sound_page.tap_alerts_selector()
        self.take_screenshot('sound-alerts')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down', alerts_page.screen_element.size['height'],
                                            screen=alerts_page.screen_element)
            self.take_screenshot('sound-alerts')
        alerts_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)

        manage_page = sound_page.tap_manage_tones_selector()
        self.take_screenshot('sound-manage_tones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(self.marionette, 'down', manage_page.screen_element.size['height'],
                                            screen=manage_page.screen_element)
            self.take_screenshot('sound-manage_tones')

        manage_page.ring_tones[1].select_option()
        self.take_screenshot('sound-manage_tones-share')
        manage_page.cancel_share()
        manage_page.tap_exit()
        settings.switch_to_settings_app()
        Wait(self.marionette).until(lambda m: sound_page.ring_tone_selector_visible)
        settings.return_to_prev_menu(settings.screen_element, sound_page.screen_element)

        #################### Display ######################
        display_page = settings.open_display()
        self.take_screenshot('display')
        display_page.tap_timeout_selector()
        self.take_screenshot('display-timeout_values', top_frame=True)
        display_page.tap_timeout_confirmation()
        settings.return_to_prev_menu(settings.screen_element, display_page.screen_element)

        #################### Homescreen ######################
        homescreen_page = settings.open_homescreen()
        self.take_screenshot('homescreen')

        homescreen_page.open_change_home_screen()
        self.take_screenshot('homescreen-change_homescreen')
        homescreen_page.open_get_more_home_screen()
        self.take_screenshot('homescreen-get_more_homescreen',top_frame=True)
        homescreen_page.cancel_get_more_home_screen()
        settings.return_to_prev_menu(homescreen_page.screen_element,
                                     homescreen_page.change_homescreen_screen_element)
        settings.return_to_prev_menu(settings.screen_element, homescreen_page.screen_element)

        ################### Search ######################
        search_page = settings.open_search()
        self.take_screenshot('search')
        search_page.open_select_search_engine()
        self.take_screenshot('search-engine_list')
        search_page.close_select_search_engine()
        settings.return_to_prev_menu(settings.screen_element, search_page.screen_element)

        ################## Navigation ######################
        nav_page = settings.open_navigation()
        self.take_screenshot('navigation')
        settings.return_to_prev_menu(settings.screen_element, nav_page.screen_element)

        ################# Notifications ######################
        notif_page = settings.open_notification()
        self.take_screenshot('notification')
        settings.return_to_prev_menu(settings.screen_element, notif_page.screen_element)

        ################ Date and Time ######################
        # Only the main page and Time Format selection is checked
        date_time_page = settings.open_date_and_time()
        self.take_screenshot('date_and_time')
        GaiaImageCompareTestCase.scroll(self.marionette, 'down', date_time_page.screen_element.size['height'],
                                        screen=date_time_page.screen_element)
        self.take_screenshot('date_and_time')
        date_time_page.disable_default_format()
        date_time_page.open_time_format()
        self.take_screenshot('date_and_time-time_format',top_frame=True)
        date_time_page.close_time_format()
        settings.return_to_prev_menu(settings.screen_element, date_time_page.screen_element)

        ############### Language ######################
        # 'Get more languages' menu cannot be opened due to css bug
        language_page = settings.open_language()
        self.take_screenshot('language')
        language_page.open_select_language()
        self.take_screenshot('language-select',top_frame=True)
        language_page.close_select_language()
        settings.return_to_prev_menu(settings.screen_element, language_page.screen_element)

        # This involves app switching, and often would cause whitescreen issue under 319MB memory config
        # Please run in 512 or 1024 MB mode to avoid this issue
        ############### Keyboards ######################
        keyboard_page = settings.open_keyboard()
        self.take_screenshot('keyboard')
        builtin_page = keyboard_page.tap_built_in_keyboards()
        self.take_screenshot('keyboard-built_in')
        builtin_page.tap_user_dictionary()
        self.take_screenshot('keyboard-user-dict')
        builtin_page.tap_user_dict_exit()
        builtin_page.tap_exit()
        keyboard_page.wait_until_page_ready()
        morekb_page = keyboard_page.tap_add_more_keyboards()
        self.take_screenshot('keyboard-more_kb')
        settings.return_to_prev_menu(keyboard_page.screen_element, morekb_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element, keyboard_page.screen_element)

        ############## Themes ######################
        themes_page = settings.open_themes()
        self.take_screenshot('themes')
        settings.return_to_prev_menu(settings.screen_element, themes_page.screen_element)

        ############# Addons ######################
        addons_page = settings.open_addons()
        self.take_screenshot('addons')
        addons_page.tap_first_item()
        self.take_screenshot('addons-addon_enabled')
        addons_page.toggle_addon_status()  # addons are enabled by default
        Wait(self.marionette).until(lambda m: not addons_page.is_addon_enabled)
        self.take_screenshot('addons-addon_disabled')
        addons_page.toggle_addon_status()  # revert to original state
        settings.return_to_prev_menu(addons_page.screen_element, addons_page.details_screen_element)
        settings.return_to_prev_menu(settings.screen_element, addons_page.screen_element)
    def test_settings_app(self):

        settings = Settings(self.marionette)
        settings.launch()

        ################### Sound ######################
        sound_page = settings.open_sound()
        self.take_screenshot('sound')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            sound_page.screen_element.size['height'],
            screen=sound_page.screen_element)
        self.take_screenshot('sound')
        ringtone_page = sound_page.tap_ring_tone_selector()
        self.take_screenshot('sound-ringtones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                ringtone_page.screen_element.size['height'],
                screen=ringtone_page.screen_element)
            self.take_screenshot('sound-ringtones')

        ringtone_page.tap_exit()
        Wait(self.marionette).until(
            lambda m: sound_page.ring_tone_selector_visible)

        alerts_page = sound_page.tap_alerts_selector()
        self.take_screenshot('sound-alerts')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                alerts_page.screen_element.size['height'],
                screen=alerts_page.screen_element)
            self.take_screenshot('sound-alerts')
        alerts_page.tap_exit()
        Wait(self.marionette).until(
            lambda m: sound_page.ring_tone_selector_visible)

        manage_page = sound_page.tap_manage_tones_selector()
        self.take_screenshot('sound-manage_tones')
        for i in range(0, 5):
            GaiaImageCompareTestCase.scroll(
                self.marionette,
                'down',
                manage_page.screen_element.size['height'],
                screen=manage_page.screen_element)
            self.take_screenshot('sound-manage_tones')

        manage_page.ring_tones[1].select_option()
        self.take_screenshot('sound-manage_tones-share')
        manage_page.cancel_share()
        manage_page.tap_exit()
        Wait(self.marionette).until(
            lambda m: sound_page.ring_tone_selector_visible)
        settings.return_to_prev_menu(settings.screen_element,
                                     sound_page.screen_element)

        #################### Display ######################
        display_page = settings.open_display()
        self.take_screenshot('display')
        display_page.tap_timeout_selector()
        self.take_screenshot('display-timeout_values', top_frame=True)
        display_page.tap_timeout_confirmation()
        settings.return_to_prev_menu(settings.screen_element,
                                     display_page.screen_element)

        #################### Homescreen ######################
        homescreen_page = settings.open_homescreen()
        self.take_screenshot('homescreen')

        homescreen_page.pick_wallpaper()
        self.take_screenshot('wallpaper')
        homescreen_page.cancel_pick_wallpaper()

        homescreen_page.select_change_icon_layout()
        self.take_screenshot('layout', top_frame=True)
        homescreen_page.confirm_icon_layout()

        homescreen_page.open_change_home_screen()
        self.take_screenshot('homescreen-change_homescreen')
        homescreen_page.open_get_more_home_screen()
        self.take_screenshot('homescreen-get_more_homescreen', top_frame=True)
        homescreen_page.cancel_get_more_home_screen()
        settings.return_to_prev_menu(
            homescreen_page.screen_element,
            homescreen_page.change_homescreen_screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     homescreen_page.screen_element)

        ################### Search ######################
        search_page = settings.open_search()
        self.take_screenshot('search')
        search_page.open_select_search_engine()
        self.take_screenshot('search-engine_list')
        search_page.close_select_search_engine()
        settings.return_to_prev_menu(settings.screen_element,
                                     search_page.screen_element)

        ################## Navigation ######################
        nav_page = settings.open_navigation()
        self.take_screenshot('navigation')
        settings.return_to_prev_menu(settings.screen_element,
                                     nav_page.screen_element)

        ################# Notifications ######################
        notif_page = settings.open_notification()
        self.take_screenshot('notification')
        settings.return_to_prev_menu(settings.screen_element,
                                     notif_page.screen_element)

        ################ Date and Time ######################
        # Only the main page and Time Format selection is checked
        date_time_page = settings.open_date_and_time()
        self.take_screenshot('date_and_time')
        GaiaImageCompareTestCase.scroll(
            self.marionette,
            'down',
            date_time_page.screen_element.size['height'],
            screen=date_time_page.screen_element)
        self.take_screenshot('date_and_time')
        date_time_page.disable_default_format()
        date_time_page.open_time_format()
        self.take_screenshot('date_and_time-time_format', top_frame=True)
        date_time_page.close_time_format()
        settings.return_to_prev_menu(settings.screen_element,
                                     date_time_page.screen_element)

        ############### Language ######################
        # 'Get more languages' menu cannot be opened due to css bug
        language_page = settings.open_language()
        self.take_screenshot('language')
        language_page.open_select_language()
        self.take_screenshot('language-select', top_frame=True)
        language_page.close_select_language()
        settings.return_to_prev_menu(settings.screen_element,
                                     language_page.screen_element)

        # This involves app switching, and often would cause whitescreen issue under 319MB memory config
        # Please run in 512 or 1024 MB mode to avoid this issue
        ############### Keyboards ######################
        keyboard_page = settings.open_keyboard()
        self.take_screenshot('keyboard')
        builtin_page = keyboard_page.tap_built_in_keyboards()
        self.take_screenshot('keyboard-built_in')
        builtin_page.tap_user_dictionary()
        self.take_screenshot('keyboard-user-dict')
        builtin_page.tap_user_dict_exit()
        builtin_page.tap_exit()
        keyboard_page.wait_until_page_ready()
        morekb_page = keyboard_page.tap_add_more_keyboards()
        self.take_screenshot('keyboard-more_kb')
        settings.return_to_prev_menu(keyboard_page.screen_element,
                                     morekb_page.screen_element)
        settings.return_to_prev_menu(settings.screen_element,
                                     keyboard_page.screen_element)

        ############## Themes ######################
        themes_page = settings.open_themes()
        self.take_screenshot('themes')
        settings.return_to_prev_menu(settings.screen_element,
                                     themes_page.screen_element)

        ############# Addons ######################
        addons_page = settings.open_addons()
        self.take_screenshot('addons')

        addons_page.tap_item(0)
        self.take_screenshot('addons-addon_enabled')
        addons_page.toggle_addon_status()  # addons are enabled by default
        Wait(self.marionette).until(lambda m: not addons_page.is_addon_enabled)
        self.take_screenshot('addons-addon_disabled')
        addons_page.toggle_addon_status()  # revert to original state
        settings.return_to_prev_menu(addons_page.screen_element,
                                     addons_page.details_screen_element)

        addons_page.tap_item(1)
        self.take_screenshot('addons-nouse_addon')
        settings.return_to_prev_menu(addons_page.screen_element,
                                     addons_page.details_screen_element)

        addons_page.tap_item(2)
        self.take_screenshot('addons-obsolete_addon')
        settings.return_to_prev_menu(addons_page.screen_element,
                                     addons_page.details_screen_element)