本文整理汇总了Python中pages.desktop.base.Base.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Base.__init__方法的具体用法?Python Base.__init__怎么用?Python Base.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.desktop.base.Base
的用法示例。
在下文中一共展示了Base.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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
示例3: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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))
示例4: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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
)
示例5: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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))
示例6: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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)
示例7: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
def __init__(self, testsetup, path):
Base.__init__(self, testsetup)
self.selenium.get("%s/%s" % (self.api_base_url, path))
示例8: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
def __init__(self, testsetup):
Base.__init__(self, testsetup)
WebDriverWait(self.selenium, self.timeout).until(
lambda s: (s.find_element(*self._account_locator)).is_displayed())
示例9: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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))
示例10: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
def __init__(self, testsetup, element):
Base.__init__(self, testsetup)
self._root_element = element
示例11: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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())
示例12: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
def __init__(self, testsetup, path):
Base.__init__(self, testsetup)
self.selenium.get(self.base_url + path)
示例13: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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)
示例14: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
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)
示例15: __init__
# 需要导入模块: from pages.desktop.base import Base [as 别名]
# 或者: from pages.desktop.base.Base import __init__ [as 别名]
def __init__(self, base_url, selenium, element):
Base.__init__(self, base_url, selenium)
self._root_element = element