当前位置: 首页>>代码示例>>Python>>正文


Python base.Base类代码示例

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


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

示例1: __init__

 def __init__(self, base_url, selenium, path):
     Base.__init__(self, base_url, selenium)
     self.selenium.get(self.base_url + path)
     self.selenium.maximize_window()
     # resizing this page for elements that disappear when the window is < 1000
     # self.selenium.set_window_size(1000, 1000) Commented because this selenium call is still in beta
     WebDriverWait(self.selenium, self.timeout).until(lambda s: self.selenium.find_element(*self._promo_box_locator).size['height'] == 273)
开发者ID:AnetaStoycheva,项目名称:Addon-Tests,代码行数:7,代码来源:discovery.py

示例2: __init__

 def __init__(self, testsetup):
     Base.__init__(self, testsetup)
     try:  # the result could legitimately be zero, but give it time to make sure
         WebDriverWait(self.selenium, self.timeout).until(
             lambda s: len(s.find_elements(*self._results_locator)) > 0
         )
     except Exception:
         pass
开发者ID:AlinT,项目名称:Addon-Tests,代码行数:8,代码来源:search.py

示例3: __init__

 def __init__(self, testsetup, addon_name=None):
     #formats name for url
     Base.__init__(self, testsetup)
     if (addon_name != None):
         self.addon_name = addon_name.replace(" ", "-")
         self.addon_name = re.sub(r'[^A-Za-z0-9\-]', '', self.addon_name).lower()
         self.addon_name = self.addon_name[:27]
         self.selenium.get("%s/addon/%s" % (self.base_url, self.addon_name))
开发者ID:eanxgeek,项目名称:Addon-Tests,代码行数:8,代码来源:details.py

示例4: __init__

 def __init__(self, testsetup, open_url=True):
     """Creates a new instance of the class and gets the page ready for testing."""
     Base.__init__(self, testsetup)
     if open_url:
         self.selenium.get(self.base_url)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: s.find_element(*self._promo_box_locator).size["height"] == 271
     )
开发者ID:gburle,项目名称:Addon-Tests,代码行数:8,代码来源:home.py

示例5: __init__

 def __init__(self, base_url, selenium, addon_name=None):
     # formats name for url
     Base.__init__(self, base_url, selenium)
     if addon_name is not None:
         self.addon_name = addon_name.replace(" ", "-")
         self.addon_name = re.sub(r"[^A-Za-z0-9\-]", "", self.addon_name).lower()
         self.addon_name = self.addon_name[:27]
         self.selenium.get("%s/addon/%s" % (self.base_url, self.addon_name))
     WebDriverWait(self.selenium, self.timeout).until(lambda s: self.is_element_visible(*self._title_locator))
开发者ID:ypetrovsky,项目名称:Addon-Tests,代码行数:9,代码来源:details.py

示例6: _go_to_page_with_login_redirect

 def _go_to_page_with_login_redirect(self, page_object, user='default'):
     from pages.desktop.base import Base
     self.selenium.maximize_window()
     self.selenium.get(self.base_url + page_object._page_url)
     bid_login = Base(self.testsetup)
     bid_login.sign_in(user)
     page_object.is_the_current_page
     page_object.header.dismiss_staging_site_warning_if_present()
     return page_object
开发者ID:Saiko-Sen,项目名称:sumo-tests,代码行数:9,代码来源:page_provider.py

示例7: __init__

    def __init__(self, testsetup, path):
        '''
            The default behavior of the class is to use --baseurl. If --servicesbaseurl
            is passed as an argument to pytest, --baseurl will be overridden.

            The web workers use the same config as addons.mozilla.org workers
            but we heavily restrict what can be served from SAMO --
            https://github.com/mozilla-services/svcops-puppet/blob/dev/modules/marketplace/templates/nginx/services_addons.conf#L20

            Due to the Discovery Pane being accessible from a web browser, it can
            be served from a separate domain for security and performance reasons.
        '''
        Base.__init__(self, testsetup)
        if self.services_base_url:
            self.selenium.get(self.services_base_url + path)
        else:
            self.selenium.get(self.base_url + path)
        self.selenium.maximize_window()
        # resizing this page for elements that disappear when the window is < 1000
        # self.selenium.set_window_size(1000, 1000) Commented because this selenium call is still in beta
        WebDriverWait(self.selenium, self.timeout).until(lambda s: self.selenium.find_element(*self._promo_box_locator).size['height'] == 273)
开发者ID:GorillaTester,项目名称:Addon-Tests,代码行数:21,代码来源:discovery.py

示例8: __init__

 def __init__(self, testsetup, path):
     Base.__init__(self, testsetup)
     self.selenium.get("%s/%s" % (self.api_base_url, path))
开发者ID:AlinT,项目名称:Addon-Tests,代码行数:3,代码来源:discovery.py

示例9: __init__

 def __init__(self, testsetup):
     Base.__init__(self, testsetup)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: (s.find_element(*self._account_locator)).is_displayed())
开发者ID:adini121,项目名称:Addon-Tests,代码行数:4,代码来源:user.py

示例10: __init__

 def __init__(self, testsetup, search_extension='firebug'):
     Base.__init__(self, testsetup)
     self.search_url = '%s/en-us/firefox/api/1.5/search/%s' % (testsetup.api_base_url, search_extension)
     self.parsed_xml = BeautifulStoneSoup(urllib2.urlopen(self.search_url))
开发者ID:AlexLakatos,项目名称:Addon-Tests,代码行数:4,代码来源:addons_api.py

示例11: __init__

 def __init__(self, testsetup, element):
     Base.__init__(self, testsetup)
     self._root_element = element
开发者ID:Marlena,项目名称:Addon-Tests,代码行数:3,代码来源:addons_site.py

示例12: __init__

 def __init__(self, base_url, selenium):
     Base.__init__(self, base_url, selenium)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: (s.find_element(*self._about_locator)).is_displayed())
开发者ID:Antosha,项目名称:Addon-Tests,代码行数:4,代码来源:user.py

示例13: __init__

 def __init__(self, testsetup, path):
     Base.__init__(self, testsetup)
     self.selenium.get(self.base_url + path)
开发者ID:Acidburn0zzz,项目名称:Addon-Tests,代码行数:3,代码来源:discovery.py

示例14: __init__

 def __init__(self, testsetup, open_url=True):
     """Creates a new instance of the class and gets the page ready for testing."""
     Base.__init__(self, testsetup)
     if open_url:
         self.selenium.get(self.base_url)
开发者ID:pengsu,项目名称:Addon-Tests,代码行数:5,代码来源:home.py

示例15: __init__

 def __init__(self, testsetup):
     Base.__init__(self, testsetup)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: self.is_no_results_present or
         len(s.find_elements(*self._results_locator)) > 0)
开发者ID:GorillaTester,项目名称:Addon-Tests,代码行数:5,代码来源:search.py


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