Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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
     )
Ejemplo n.º 4
0
 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))
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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
Ejemplo n.º 7
0
 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))
Ejemplo n.º 8
0
 def _go_to_page_with_login_redirect(self, page_object, user='******'):
     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
Ejemplo n.º 9
0
 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))
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 def _go_to_page_with_login_redirect(self, page_object, user='******'):
     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
Ejemplo n.º 12
0
 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))
Ejemplo n.º 13
0
    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)
Ejemplo n.º 14
0
 def __init__(self, base_url, selenium):
     Base.__init__(self, base_url, selenium)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: (s.find_element(*self._account_locator)).is_displayed())
Ejemplo n.º 15
0
 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())
Ejemplo n.º 16
0
 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))
Ejemplo n.º 17
0
 def __init__(self, testsetup):
     Base.__init__(self, testsetup)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: (s.find_element(*self._about_locator)).is_displayed())
Ejemplo n.º 18
0
 def __init__(self, testsetup, path):
     Base.__init__(self, testsetup)
     self.selenium.get(self.base_url + path)
Ejemplo n.º 19
0
 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)
Ejemplo n.º 20
0
 def __init__(self, testsetup):
     Base.__init__(self, testsetup)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: (s.find_element(*self._account_locator)).is_displayed())
Ejemplo n.º 21
0
 def __init__(self, base_url, selenium, element):
     Base.__init__(self, base_url, selenium)
     self._root_element = element
Ejemplo n.º 22
0
 def __init__(self, testsetup, element):
     Base.__init__(self, testsetup)
     self._root_element = element
Ejemplo n.º 23
0
 def __init__(self, base_url, selenium, element):
     Base.__init__(self, base_url, selenium)
     self._root_element = element
Ejemplo n.º 24
0
 def __init__(self, testsetup, element):
     Base.__init__(self, testsetup)
     self._root_element = element
Ejemplo n.º 25
0
def test_legal_links(selenium, base_url, i, name):
    """Test links in footer load correct pages."""
    page = Base(selenium, base_url).open()
    page.footer.links[i].click()
    assert name in selenium.current_url
Ejemplo n.º 26
0
 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)
Ejemplo n.º 27
0
 def __init__(self, base_url, selenium):
     Base.__init__(self, base_url, selenium)
     WebDriverWait(self.selenium, self.timeout).until(
         lambda s: self.is_no_results_present or
         len(s.find_elements(*self._results_locator)) > 0)
Ejemplo n.º 28
0
 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))
Ejemplo n.º 29
0
 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)
Ejemplo n.º 30
0
 def __init__(self, testsetup, path):
     Base.__init__(self, testsetup)
     self.selenium.get("%s/%s" % (self.api_base_url, path))
Ejemplo n.º 31
0
 def __init__(self, testsetup, path):
     Base.__init__(self, testsetup)
     self.selenium.get("%s/%s" % (self.api_base_url, path))