Пример #1
0
 def reject_call(self):
     Wait(self.marionette).until(
         expected.element_displayed(*self._lockscreen_handle_locator))
     self._handle_incoming_call('reject')
     self.marionette.switch_to_frame()
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._call_screen_locator))
Пример #2
0
 def a11y_click_next_to_wifi_section(self):
     progress = self.marionette.find_element(*self._progress_activity_locator)
     self.a11y_click_next()
     Wait(self.marionette).until(expected.element_not_displayed(progress))
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._section_wifi_locator))))
Пример #3
0
    def tap_tile_view_button(self):
        fullscreen = self.marionette.find_element(*self._fullscreen_view_locator)
        self.marionette.find_element(*self._tile_view_locator).tap()
        Wait(self.marionette).until(expected.element_not_displayed(fullscreen))
        from gaiatest.apps.gallery.app import Gallery

        return Gallery(self.marionette)
Пример #4
0
 def tap_next_to_wifi_section(self):
     progress = self.marionette.find_element(*self._loading_overlay_locator)
     self.tap_next()
     Wait(self.marionette).until(expected.element_not_displayed(progress))
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._section_wifi_locator))))
Пример #5
0
 def tap_done(self):
     time_picker = self.marionette.find_element(*self._time_picker_locator)
     self.marionette.find_element(*self._done_button_locator).tap()
     Wait(self.marionette).until(expected.element_not_displayed(time_picker))
     # TODO: wait for the time picker to fade out Bug 1038186
     time.sleep(2)
     self.apps.switch_to_displayed_app()
Пример #6
0
    def select(self, match_string):
        # This needs to be duplicated from base.py because when we return from the frame
        # we don't return to the Settings app in its initial state,
        # so the wait for in its launch method times out

        # have to go back to top level to get the B2G select box wrapper
        self.marionette.switch_to_frame()

        Wait(self.marionette).until(
            expected.elements_present(
                By.CSS_SELECTOR, '.value-selector-container li'))

        options = self.marionette.find_elements(By.CSS_SELECTOR, '.value-selector-container li')
        close = self.marionette.find_element(By.CSS_SELECTOR, 'button.value-option-confirm')

        # loop options until we find the match
        for li in options:
            if match_string == li.text:
                li.tap()
                break
        else:
            raise Exception("Element '%s' could not be found in select wrapper" % match_string)

        close.tap()
        Wait(self.marionette).until(expected.element_not_displayed(close))

        # TODO we should find something suitable to wait for, but this goes too
        # fast against desktop builds causing intermittent failures
        time.sleep(0.2)

        # now back to app
        self.apps.switch_to_displayed_app()
Пример #7
0
    def tap_settings(self):
        settings = self.marionette.find_element(*self._settings_button_locator)
        settings.tap()
        Wait(self.marionette).until(expected.element_not_displayed(settings))
        from gaiatest.apps.contacts.regions.settings_form import SettingsForm

        return SettingsForm(self.marionette)
Пример #8
0
Файл: event.py Проект: 6a68/gaia
 def tap_save_event(self):
     event_start_time = self.marionette.find_element(*self._event_start_time_value_locator).text
     event_start_date = self.marionette.find_element(*self._event_start_date_value_locator).text
     el = self.marionette.find_element(*self._modify_event_view_locator)
     self.marionette.find_element(*self._save_event_button_locator).tap()
     Wait(self.marionette).until(expected.element_not_displayed(el))
     return datetime.strptime(event_start_time + event_start_date, '%I:%M %p%m/%d/%Y')
Пример #9
0
 def reset_mobile_usage(self):
     self.marionette.find_element(*self._reset_button_locator).tap()
     reset_mobile_usage = Wait(self.marionette).until(
         expected.element_present(*self._reset_mobile_usage_button_locator))
     Wait(self.marionette).until(expected.element_displayed(reset_mobile_usage))
     reset_dialog = self.marionette.find_element(*self._reset_dialog_locator)
     reset_mobile_usage.tap()
     Wait(self.marionette).until(expected.element_not_displayed(reset_dialog))
Пример #10
0
 def tap_edit(self):
     edit = Wait(self.marionette).until(expected.element_present(
         *self._edit_contact_button_locator))
     Wait(self.marionette).until(expected.element_displayed(edit))
     edit.tap()
     Wait(self.marionette).until(expected.element_not_displayed(edit))
     from gaiatest.apps.contacts.regions.contact_form import EditContact
     return EditContact(self.marionette)
Пример #11
0
 def tap_back(self):
     el = self.marionette.find_element(*self._details_header_locator)
     Wait(self.marionette).until(expected.element_displayed(el))
     # TODO: remove tap with coordinates after Bug 1061698 is fixed
     el.tap(25, 25)
     Wait(self.marionette).until(expected.element_not_displayed(el))
     from gaiatest.apps.contacts.app import Contacts
     return Contacts(self.marionette)
Пример #12
0
 def wait_for_content_ready(self):
     app = Gallery(self.device.marionette)
     Wait(self.device.marionette, timeout=240).until(
         lambda m: len(m.find_elements(
             By.CSS_SELECTOR, '.thumbnail')) == self.picture_count)
     Wait(self.device.marionette, timeout=60).until(
         expected.element_not_displayed(self.device.marionette.find_element(
             *app._progress_bar_locator)))
Пример #13
0
    def tap_edit_save_button(self):
        element = Wait(self.marionette).until(expected.element_present(*self._edit_save_locator))
        Wait(self.marionette).until(expected.element_displayed(element))
        element.tap()
        progress = self.marionette.find_element(*self._save_progress_bar_locator)
        Wait(self.marionette).until(expected.element_not_displayed(progress))
        from gaiatest.apps.gallery.app import Gallery

        return Gallery(self.marionette)
Пример #14
0
 def tap_cancel(self):
     actions_menu = Wait(self.marionette).until(
         expected.element_present(*self._actions_menu_locator))
     Wait(self.marionette).until(
         expected.element_displayed(actions_menu))
     self.marionette.find_element(*self._cancel_button_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(actions_menu))
     self.apps.switch_to_displayed_app()
Пример #15
0
 def before_scroll(self):
     B2GPerfScrollTest.before_scroll(self)
     # TODO Replace with a suitable wait
     self.logger.debug('Sleep for 5 seconds to allow scan to start')
     time.sleep(5)
     self.logger.debug('Waiting for progress bar to be hidden')
     Wait(self.marionette, timeout=240).until(
         expected.element_not_displayed(
             self.marionette.find_element(By.ID, 'scan-progress')))
Пример #16
0
 def share_to_messages(self):
     actions_menu = Wait(self.marionette).until(
         expected.element_present(*self._actions_menu_locator))
     Wait(self.marionette).until(
         expected.element_displayed(actions_menu))
     self.marionette.find_element(*self._messages_button_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(actions_menu))
     from gaiatest.apps.messages.regions.new_message import NewMessage
     return NewMessage(self.marionette)
Пример #17
0
 def tap_import_from_sim(self):
     import_from_sim = Wait(self.marionette).until(
         expected.element_present(*self._import_from_sim_button_locator))
     Wait(self.marionette).until(expected.element_displayed(import_from_sim))
     import_from_sim.tap()
     from gaiatest.apps.contacts.app import Contacts
     status_message = Wait(self.marionette).until(
         expected.element_present(*Contacts._status_message_locator))
     Wait(self.marionette).until(expected.element_displayed(status_message))
     Wait(self.marionette).until(expected.element_not_displayed(status_message))
Пример #18
0
 def tap_wallpaper(self):
     Wait(self.marionette).until(
         expected.element_displayed(*self._actions_menu_locator))
     self.marionette.find_element(*self._wallpaper_button_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._actions_menu_locator))
     from gaiatest.apps.wallpaper.app import Wallpaper
     wallpaper = Wallpaper(self.marionette)
     Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == wallpaper.name)
     self.apps.switch_to_displayed_app()
     return wallpaper
Пример #19
0
 def tap_update(self, return_details=True):
     self.wait_for_update_button_enabled()
     update = self.marionette.find_element(*self._update_locator)
     update.tap()
     if return_details:
         Wait(self.marionette).until(expected.element_not_displayed(update))
         from gaiatest.apps.contacts.regions.contact_details import ContactDetails
         return ContactDetails(self.marionette)
     else:
         # else we drop back to the underlying app
         Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != self.name)
         self.apps.switch_to_displayed_app()
Пример #20
0
 def before_scroll(self):
     B2GPerfScrollTest.before_scroll(self)
     # TODO Replace with a suitable wait
     self.logger.debug('Sleep for 5 seconds to allow scan to start')
     time.sleep(5)
     self.logger.debug('Waiting for correct number of pictures')
     Wait(self.marionette, timeout=240).until(
         lambda m: len(m.find_elements(
             *self.gallery._gallery_items_locator)) == self.picture_count)
     self.logger.debug('Waiting for progress bar to be hidden')
     Wait(self.marionette, timeout=60).until(expected.element_not_displayed(
         self.marionette.find_element(*self.gallery._progress_bar_locator)))
Пример #21
0
 def tap_gallery(self):
     actions_menu = Wait(self.marionette).until(
         expected.element_present(*self._actions_menu_locator))
     Wait(self.marionette).until(
         expected.element_displayed(actions_menu))
     self.marionette.find_element(*self._gallery_button_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(actions_menu))
     from gaiatest.apps.gallery.app import Gallery
     gallery = Gallery(self.marionette)
     Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == gallery.name)
     self.apps.switch_to_displayed_app()
     return gallery
Пример #22
0
 def before_scroll(self):
     B2GPerfScrollTest.before_scroll(self)
     # TODO Replace with a suitable wait
     self.logger.debug('Sleep for 5 seconds to allow scan to start')
     time.sleep(5)
     self.logger.debug('Waiting for correct number of videos')
     Wait(self.marionette, timeout=120).until(
         lambda m: len(m.find_elements(
             By.CSS_SELECTOR,
             '#thumbnails .thumbnail')) == self.video_count)
     self.logger.debug('Waiting for progress bar to be hidden')
     Wait(self.marionette, timeout=60).until(expected.element_not_displayed(
         self.marionette.find_element(By.ID, 'throbber')))
Пример #23
0
    def wait_for_notification_message(self, message):
        """This will wait for the specified message to appear in the DOM element
           for the notification message, not for that message to be visible.

           This is required as often the message is no longer visible when we check,
           but the expected text still exists in the DOM element.

           This is also the reason that we wait for the element to no longer be
           visible at the end of this method, whereas we do not wait for it to
           first be visible.
        """
        element = self.marionette.find_element(*self._notification_locator)
        Wait(self.marionette).until(self._element_inner_html_contains(element, message))
        Wait(self.marionette).until(expected.element_not_displayed(element))
Пример #24
0
 def _return_class_from_tap(self, return_class='ContactDetails'):
     if return_class == 'ContactDetails':
         Wait(self.marionette).until(lambda m: expected.element_not_displayed(self.root_element))
         from gaiatest.apps.contacts.regions.contact_details import ContactDetails
         return ContactDetails(self.marionette)
     elif return_class == 'EditContact':
         # This may seem superfluous but we can enter EditContact from Contacts, or from ActivityPicker
         Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == Contacts.name)
         self.apps.switch_to_displayed_app()
         from gaiatest.apps.contacts.regions.contact_form import EditContact
         return EditContact(self.marionette)
     else:
         # We are using contacts picker in activity - after choosing, fall back to open app
         Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != Contacts.name)
         self.apps.switch_to_displayed_app()
Пример #25
0
 def tap_camera(self):
     actions_menu = Wait(self.marionette).until(
         expected.element_present(*self._actions_menu_locator))
     Wait(self.marionette).until(
         expected.element_displayed(actions_menu))
     self.marionette.find_element(*self._camera_button_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(actions_menu))
     from gaiatest.apps.camera.app import Camera
     camera = Camera(self.marionette)
     Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == camera.name)
     self.apps.switch_to_displayed_app()
     camera.wait_for_loading_spinner_displayed()
     camera.wait_for_loading_spinner_hidden()
     camera.wait_for_capture_ready()
     return camera
Пример #26
0
    def reset_wifi_usage(self):
        self.marionette.find_element(*self._reset_button_locator).tap()

        reset_wifi_usage = Wait(self.marionette).until(
            expected.element_present(*self._reset_wifi_usage_button_locator))
        Wait(self.marionette).until(
            expected.element_displayed(reset_wifi_usage))
        reset_dialog = self.marionette.find_element(
            *self._reset_dialog_locator)
        reset_wifi_usage.tap()

        confirm_reset_button = Wait(self.marionette).until(
            expected.element_present(*self._confirm_reset_button_locator))
        Wait(self.marionette).until(
            expected.element_displayed(confirm_reset_button))
        confirm_reset_button.tap()

        Wait(self.marionette).until(
            expected.element_not_displayed(reset_dialog))
Пример #27
0
 def _return_class_from_tap(self, return_class='ContactDetails'):
     if return_class == 'ContactDetails':
         Wait(self.marionette).until(
             lambda m: expected.element_not_displayed(self.root_element
                                                      ))
         from gaiatest.apps.contacts.regions.contact_details import ContactDetails
         return ContactDetails(self.marionette)
     elif return_class == 'EditContact':
         # This may seem superfluous but we can enter EditContact from Contacts, or from ActivityPicker
         Wait(self.marionette).until(
             lambda m: self.apps.displayed_app.name == Contacts.name)
         self.apps.switch_to_displayed_app()
         from gaiatest.apps.contacts.regions.contact_form import EditContact
         return EditContact(self.marionette)
     else:
         # We are using contacts picker in activity - after choosing, fall back to open app
         Wait(self.marionette).until(
             lambda m: self.apps.displayed_app.name != Contacts.name)
         self.apps.switch_to_displayed_app()
Пример #28
0
    def select(self, match_string):
        # This needs to be duplicated from base.py because when we return from the frame
        # we don't return to the Settings app in its initial state,
        # so the wait for in its launch method times out

        # have to go back to top level to get the B2G select box wrapper
        self.marionette.switch_to_frame()

        Wait(self.marionette).until(
            expected.elements_present(By.CSS_SELECTOR,
                                      '.value-selector-container li'))

        options = self.marionette.find_elements(
            By.CSS_SELECTOR, '.value-selector-container li')
        close = self.marionette.find_element(By.CSS_SELECTOR,
                                             'button.value-option-confirm')

        # loop options until we find the match
        for li in options:
            if match_string == li.text:
                li.tap()
                break
        else:
            raise Exception(
                "Element '%s' could not be found in select wrapper" %
                match_string)

        close.tap()
        Wait(self.marionette).until(expected.element_not_displayed(close))

        # TODO we should find something suitable to wait for, but this goes too
        # fast against desktop builds causing intermittent failures
        time.sleep(0.2)

        # now back to app
        self.apps.switch_to_displayed_app()
Пример #29
0
 def confirm_suggestion_notice(self):
     confirm = Wait(self.marionette).until(expected.element_present(
         *self._search_suggestion_ok_button_locator))
     Wait(self.marionette).until(expected.element_displayed(confirm))
     confirm.tap()
     Wait(self.marionette).until(expected.element_not_displayed(confirm))
Пример #30
0
 def tap_back_from_import_contacts(self):
     header = self.marionette.find_element(*self._import_settings_header)
     # TODO: remove tap with coordinates after Bug 1061698 is fixed
     header.tap(25, 25)
     Wait(self.marionette).until(expected.element_not_displayed(header))
Пример #31
0
 def tap_done(self):
     close = self.marionette.find_element(*self._settings_close_button_locator)
     close.tap()
     Wait(self.marionette).until(expected.element_not_displayed(close))
     from gaiatest.apps.contacts.app import Contacts
     return Contacts(self.marionette)
Пример #32
0
 def wait_for_system_banner_not_displayed(self):
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._system_banner_locator))
Пример #33
0
 def wait_for_software_home_button_not_displayed(self, timeout=10):
     Wait(self.marionette, timeout=timeout).until(
         expected.element_not_displayed(
             *self._software_home_button_locator))
Пример #34
0
 def tap_back_from_import_contacts(self):
     header = self.marionette.find_element(*self._import_settings_header)
     # TODO: remove tap with coordinates after Bug 1061698 is fixed
     header.tap(25, 25)
     Wait(self.marionette).until(expected.element_not_displayed(header))
Пример #35
0
 def tap_update_device_name_ok(self):
     element = Wait(self.marionette).until(
         expected.element_present(*self._update_device_name_form_locator))
     self.marionette.find_element(
         *self._update_device_name_ok_locator).tap()
     Wait(self.marionette).until(expected.element_not_displayed(element))
Пример #36
0
 def __init__(self, marionette):
     Base.__init__(self, marionette)
     Wait(self.marionette).until(lambda m: self.apps.displayed_app.src == self._src)
     self.apps.switch_to_displayed_app()
     loading = self.marionette.find_element(*self._collection_loading_locator)
     Wait(self.marionette).until(expected.element_not_displayed(loading))
Пример #37
0
 def wait_for_cards_view_not_displayed(self):
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._cards_view_locator))
Пример #38
0
 def wait_for_content_ready(self):
     Wait(self.device.marionette, timeout=240).until(
         expected.element_not_displayed(
             self.device.marionette.find_element(By.ID, 'scan-progress')))
Пример #39
0
 def a11y_wheel_utility_tray_grippy(self):
     self.accessibility.wheel(self.marionette.find_element(*self._grippy_locator), 'up')
     Wait(self.marionette).until(
         expected.element_not_displayed(*System(self.marionette)._utility_tray_locator))
Пример #40
0
 def tap_continue(self):
     element = self.marionette.find_element(*self._continue_button_locator)
     element.tap()
     Wait(self.marionette).until(expected.element_not_displayed(element))
     Wait(self.marionette).until(
         expected.element_displayed(*self._password_input_locator))
Пример #41
0
 def tap_settings(self):
     settings = self.marionette.find_element(*self._settings_button_locator)
     settings.tap()
     Wait(self.marionette).until(expected.element_not_displayed(settings))
     from gaiatest.apps.contacts.regions.settings_form import SettingsForm
     return SettingsForm(self.marionette)
Пример #42
0
 def wait_for_notification_toaster_not_displayed(self, timeout=10):
     Wait(self.marionette, timeout).until(
         expected.element_not_displayed(
             *self._notification_toaster_locator))
Пример #43
0
 def wait_for_software_home_button_not_displayed(self, timeout=10):
     Wait(self.marionette, timeout=timeout).until(
         expected.element_not_displayed(*self._software_home_button_locator))
Пример #44
0
 def launch(self):
     Base.launch(self)
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._loading_spinner_locator))
Пример #45
0
 def tap_confirm_deletion_button(self):
     element = self.marionette.find_element(*self._confirm_delete_locator)
     element.tap()
     Wait(self.marionette).until(expected.element_not_displayed(element))
Пример #46
0
 def __init__(self, marionette):
     Phone.__init__(self, marionette)
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._upgrade_progress_locator))
     Wait(self.marionette).until(
         expected.element_displayed(*self._all_calls_tab_link_locator))
Пример #47
0
 def wait_for_loading_spinner_hidden(self):
     loading_spinner = self.marionette.find_element(*self._loading_screen_locator)
     Wait(self.marionette).until(expected.element_not_displayed(loading_spinner))
Пример #48
0
 def tap_cancel(self):
     element = self.marionette.find_element(
         *self._attachment_options_locator)
     self.marionette.find_element(*self._cancel_button_locator).tap()
     Wait(self.marionette).until(expected.element_not_displayed(element))
Пример #49
0
 def hang_up(self):
     self.marionette.find_element(*self._hangup_bar_locator).tap()
     self.marionette.switch_to_frame()
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._call_screen_locator))
Пример #50
0
 def dismiss_banner(self):
     banner = Wait(self.marionette).until(
         expected.element_present(*self._banner_countdown_notification_locator))
     Wait(self.marionette).until(expected.element_displayed(banner))
     # We can't tap to clear the banner as sometimes it taps the underlying alarm changing the UI
     Wait(self.marionette).until(expected.element_not_displayed(banner))
Пример #51
0
 def a11y_keypad_hang_up(self):
     self.a11y_click_keypad_hang_up()
     self.marionette.switch_to_frame()
     Wait(self.marionette).until(
         expected.element_not_displayed(*self._call_screen_locator))
Пример #52
0
 def tap_confirm_deletion_button(self):
     element = self.marionette.find_element(*self._confirm_delete_locator)
     element.tap()
     Wait(self.marionette).until(expected.element_not_displayed(element))
Пример #53
0
 def remove(self):
     frequency = self.marionette.find_element(*self._frequency_locator)
     self.root_element.find_element(*self._remove_locator).tap()
     Wait(self.marionette).until(
         expected.element_not_displayed(frequency))