• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python expected.element_present函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中marionette_driver.expected.element_present函数的典型用法代码示例。如果您正苦于以下问题:Python element_present函数的具体用法?Python element_present怎么用?Python element_present使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了element_present函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: search

    def search(self, term):
        iframe = Wait(self.marionette).until(
            expected.element_present(*self._marketplace_iframe_locator))
        Wait(self.marionette).until(expected.element_displayed(iframe))
        self.marionette.switch_to_frame(iframe)

        # This sleep seems necessary, otherwise on device we get timeout failure on display search_box sometimes, see bug 1136791
        import time
        time.sleep(10)

        search_toggle = Wait(self.marionette).until(
            expected.element_present(*self._search_toggle_locator))
        Wait(self.marionette).until(expected.element_displayed(search_toggle))
        search_toggle.tap()

        search_box = Wait(self.marionette).until(
            expected.element_present(*self._search_locator))
        Wait(self.marionette).until(expected.element_displayed(search_box))

        # This sleep is necessary, otherwise the search results are not shown on desktop b2g
        import time
        time.sleep(0.5)

        # search for the app
        search_box.send_keys(term)
        search_box.send_keys(Keys.RETURN)
        return SearchResults(self.marionette)
开发者ID:anubhav7495,项目名称:gaia,代码行数:27,代码来源:app.py


示例2: wait_for_enable_switch_to_be_turned_on

 def wait_for_enable_switch_to_be_turned_on(self):
     findmydevice = Wait(self.marionette, timeout=60).until(
         expected.element_present(*self._findmydevice_locator))
     Wait(self.marionette).until(expected.element_displayed(findmydevice))
     checkbox = Wait(self.marionette, timeout=60).until(
         expected.element_present(*self._checkbox_locator))
     Wait(self.marionette).until(expected.element_selected(checkbox))
开发者ID:AaskaShah,项目名称:gaia,代码行数:7,代码来源:findmydevice.py


示例3: launch

    def launch(self):
        Base.launch(self)
        Wait(self.marionette).until(
            expected.element_present(*self._app_loaded_locator))

        # this is located at the end of the page.  If this is shown, everything is rendered.
        Wait(self.marionette).until(
            expected.element_present(*self._bluetooth_menu_item_locator))
开发者ID:TheHollidayInn,项目名称:gaia,代码行数:8,代码来源:app.py


示例4: a11y_click_month_display_button

 def a11y_click_month_display_button(self):
     self.accessibility.click(self.marionette.find_element(*self._month_display_button_locator))
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._current_monthly_calendar_locator))))
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._current_month_day_agenda_locator))))
开发者ID:Archaeopteryx,项目名称:gaia,代码行数:8,代码来源:app.py


示例5: launch

 def launch(self):
     Base.launch(self)
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._visible_clock_locator))))
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._alarm_create_new_locator))))
开发者ID:DouglasSherk,项目名称:gaia,代码行数:8,代码来源:app.py


示例6: unlock_to_passcode_pad

 def unlock_to_passcode_pad(self):
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._lockscreen_handle_locator))))
     self._slide_to_unlock('homescreen')
     Wait(self.marionette).until(expected.element_displayed(
         Wait(self.marionette).until(expected.element_present(
             *self._lockscreen_passcode_code_locator))))
     return PasscodePad(self.marionette)
开发者ID:AaskaShah,项目名称:gaia,代码行数:9,代码来源:app.py


示例7: tap_unlink_contact

    def tap_unlink_contact(self):
        facebook_unlink_button = Wait(self.marionette).until(expected.element_present(*self._facebook_link_locator))
        Wait(self.marionette).until(expected.element_displayed(facebook_unlink_button))
        facebook_unlink_button.tap()

        facebook_confirm_unlink_button = Wait(self.marionette).until(expected.element_present(*self._confirm_unlink_button_locator))
        Wait(self.marionette).until(expected.element_displayed(facebook_confirm_unlink_button))
        facebook_confirm_unlink_button.tap()
        self.apps.switch_to_displayed_app()
开发者ID:behappycc,项目名称:b2g-monkey,代码行数:9,代码来源:contact_details.py


示例8: tap_import_from_sim

 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))
开发者ID:AaskaShah,项目名称:gaia,代码行数:10,代码来源:settings_form.py


示例9: switch_to_settings_iframe

    def switch_to_settings_iframe(self):
        # go into iframe of usage app settings
        frame = Wait(self.marionette).until(expected.element_present(
            *self._settings_iframe_locator))
        Wait(self.marionette).until(expected.element_displayed(frame))
        self.marionette.switch_to_frame(frame)

        Wait(self.marionette).until(expected.element_displayed(
            Wait(self.marionette).until(expected.element_present(
                *self._settings_title_locator))))
开发者ID:behappycc,项目名称:b2g-monkey,代码行数:10,代码来源:settings.py


示例10: __init__

    def __init__(self, marionette):
        Base.__init__(self, marionette)

        # wait for the pop up screen to open
        view = Wait(self.marionette).until(
            expected.element_present(*self._iframe_locator))
        self.marionette.switch_to_frame(view)

        # wait for the page to load
        email = Wait(self.marionette).until(
            expected.element_present(*self._email_locator))
        Wait(self.marionette).until(lambda m: email.get_attribute('value') != '')
开发者ID:Amrltqt,项目名称:gaia,代码行数:12,代码来源:google.py


示例11: tap_next

    def tap_next(self):
        next = Wait(self.marionette).until(expected.element_present(*self._next_locator))
        Wait(self.marionette).until(lambda m: next.get_attribute('disabled') != 'true')
        next.tap()

        account = Wait(self.marionette).until(
            expected.element_present(*self._account_prefs_section_locator))
        Wait(self.marionette).until(lambda m: account.location['x'] == 0)

        Wait(self.marionette, timeout=120).until(expected.element_displayed(
            Wait(self.marionette, timeout=120).until(expected.element_present(
                *self._account_prefs_next_locator))))
开发者ID:AaskaShah,项目名称:gaia,代码行数:12,代码来源:setup.py


示例12: reset_mobile_usage

    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()

        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))
开发者ID:Anirudh0,项目名称:gaia,代码行数:14,代码来源:settings.py


示例13: tap_delete_button

    def tap_delete_button(self, confirm=True):
        delete_button = Wait(self.marionette).until(
            expected.element_present(*self._delete_thumbnail_locator))
        Wait(self.marionette).until(expected.element_displayed(delete_button))
        delete_button.tap()

        if confirm:
            confirm_decision_button = Wait(self.marionette).until(
                expected.element_present(*self._delete_confirm_locator))
        else:
            confirm_decision_button = Wait(self.marionette).until(
                expected.element_present(*self._delete_cancel_locator))
        Wait(self.marionette).until(expected.element_displayed(confirm_decision_button))
        confirm_decision_button.tap()
开发者ID:AaskaShah,项目名称:gaia,代码行数:14,代码来源:multiple_selection_view.py


示例14: gmail_login

 def gmail_login(self, user, passwd):
     email = Wait(self.marionette).until(
         expected.element_present(*self._email_locator))
     Wait(self.marionette).until(expected.element_displayed(email))
     email.tap()
     email.send_keys(user)
     self.marionette.find_element(*self._next_locator).tap()
     password = Wait(self.marionette).until(
         expected.element_present(*self._password_locator))
     Wait(self.marionette).until(expected.element_displayed(password))
     password.tap()
     password.send_keys(passwd)
     self.keyboard.dismiss()
     self.marionette.find_element(*self._sign_in_locator).tap()
开发者ID:Archaeopteryx,项目名称:gaia,代码行数:14,代码来源:gmail.py


示例15: tap_back_button

 def tap_back_button(self):
     element = Wait(self.marionette).until(
         expected.element_present(*self._test_panel_header_locator))
     Wait(self.marionette).until(expected.element_displayed(element))
     # TODO: remove tap with coordinates after Bug 1061698 is fixed
     element.tap(25, 25)
     Wait(self.marionette).until(expected.element_not_displayed(element))
开发者ID:AaskaShah,项目名称:gaia,代码行数:7,代码来源:app.py


示例16: __init__

 def __init__(self, marionette, url, autostart=True, **kwargs):
     self.player = None
     self._last_seen_player_state = None
     super(YouTubePuppeteer,
           self).__init__(marionette, url,
                          video_selector='.html5-video-player video',
                          autostart=False,
                          **kwargs)
     wait = Wait(self.marionette, timeout=30)
     with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
         verbose_until(wait, self,
                       expected.element_present(By.CLASS_NAME,
                                                'html5-video-player'))
         self.player = self.marionette.find_element(By.CLASS_NAME,
                                                    'html5-video-player')
         self.marionette.execute_script("log('.html5-video-player "
                                        "element obtained');")
     # When an ad is playing, self.player_duration indicates the duration
     # of the spliced-in ad stream, not the duration of the main video, so
     # we attempt to skip the ad first.
     for attempt in range(5):
         sleep(1)
         self.process_ad()
         if (self._last_seen_player_state.player_ad_inactive and
                 self._last_seen_video_state.duration and not
                 self._last_seen_player_state.player_buffering):
             break
     self._update_expected_duration()
     if autostart:
         self.start()
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:30,代码来源:youtube_puppeteer.py


示例17: _search_ad_duration

    def _search_ad_duration(self):
        """
        Try and determine ad duration. Refreshes state.

        :return: ad duration in seconds, if currently displayed in player
        """
        self._refresh_state()
        if not (self._last_seen_player_state.player_ad_playing or
                self._player_measure_progress() == 0):
            return None
        if (self._last_seen_player_state.player_ad_playing and
                self._last_seen_video_state.duration):
            return self._last_seen_video_state.duration
        selector = '.html5-video-player .videoAdUiAttribution'
        wait = Wait(self.marionette, timeout=5)
        try:
            with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
                wait.until(expected.element_present(By.CSS_SELECTOR,
                                                    selector))
                countdown = self.marionette.find_element(By.CSS_SELECTOR,
                                                         selector)
                ad_time = self._time_pattern.search(countdown.text)
                if ad_time:
                    ad_minutes = int(ad_time.group('minute'))
                    ad_seconds = int(ad_time.group('second'))
                    return 60 * ad_minutes + ad_seconds
        except (TimeoutException, NoSuchElementException):
            self.marionette.log('Could not obtain '
                                'element: {}'.format(selector),
                                level='WARNING')
        return None
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:31,代码来源:youtube_puppeteer.py


示例18: tap_share_to_messages

 def tap_share_to_messages(self):
     element = Wait(self.marionette).until(
         expected.element_present(*self._share_to_messages_button_locator))
     Wait(self.marionette).until(expected.element_displayed(element))
     element.tap()
     from gaiatest.apps.messages.regions.new_message import NewMessage
     return NewMessage(self.marionette)
开发者ID:AaskaShah,项目名称:gaia,代码行数:7,代码来源:browser.py


示例19: tap_delete_contacts

 def tap_delete_contacts(self):
     delete_contacts = Wait(self.marionette).until(
         expected.element_present(*self._delete_contacts_locator))
     Wait(self.marionette).until(expected.element_displayed(delete_contacts))
     delete_contacts.tap()
     select_contacts = self.marionette.find_element(*self._select_contacts_locator)
     Wait(self.marionette).until(lambda m: select_contacts.location['y'] == 0)
开发者ID:AaskaShah,项目名称:gaia,代码行数:7,代码来源:settings_form.py


示例20: tap_import_from_gmail

 def tap_import_from_gmail(self):
     import_from_gmail = Wait(self.marionette).until(
         expected.element_present(*self._import_from_gmail_button_locator))
     Wait(self.marionette).until(expected.element_displayed(import_from_gmail))
     import_from_gmail.tap()
     from gaiatest.apps.contacts.regions.gmail import GmailLogin
     return GmailLogin(self.marionette)
开发者ID:AaskaShah,项目名称:gaia,代码行数:7,代码来源:settings_form.py



注:本文中的marionette_driver.expected.element_present函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python marionette.Actions类代码示例发布时间:2022-05-27
下一篇:
Python expected.element_not_present函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap