Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Run tests marked as impala against the impala URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Jul 22, 2011
1 parent 260fd0f commit 179a6a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
11 changes: 5 additions & 6 deletions addons_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class AddonsHomePage(AddonsBasePage):
def __init__(self, testsetup):
''' Creates a new instance of the class and gets the page ready for testing '''
AddonsBasePage.__init__(self, testsetup)
self.selenium.open("/")
self.selenium.open("%s/" % self.site_version)
self.selenium.window_maximize()

def page_forward(self):
Expand Down Expand Up @@ -118,7 +118,7 @@ def click_themes(self):
return AddonsThemesPage(self.testsetup)

def open_details_page_for_id(self, id):
self.selenium.open("/en-US/firefox/addon/%s" % id)
self.selenium.open("%s/addon/%s" % (self.site_version, id))
self.selenium.wait_for_page_to_load(self.timeout)

def click_all_reviews_link(self):
Expand Down Expand Up @@ -210,7 +210,6 @@ def _extract_integers(self, xpath_locator, regex_pattern, count):

class AddonsDetailsPage(AddonsHomePage):

_addon_detail_base_url = "/firefox/addon/"
_name_locator = "css=h2.addon > span"
_version_number_locator = "css=span.version"
_authors_locator = "//h4[@class='author']/a"
Expand All @@ -235,7 +234,7 @@ def __init__(self, testsetup, addon_name):
#formats name for url
self.addon_name = addon_name.replace(' ', '-').lower()
AddonsBasePage.__init__(self, testsetup)
self.selenium.open(self._addon_detail_base_url + self.addon_name)
self.selenium.open("%s/addon/" % self.site_version + self.addon_name)

@property
def page_title(self):
Expand Down Expand Up @@ -464,7 +463,7 @@ def click_persona(self, index):
return AddonsPersonasDetailPage(self.testsetup)

def open_persona_detail_page(self, persona_key):
self.selenium.open("/en-us/firefox/addon/" + str(persona_key))
self.selenium.open("%s/addon/%s" + (self.site_version, persona_key))
self.selenium.wait_for_page_to_load(self.timeout)
return AddonsPersonasDetailPage(self.testsetup)

Expand Down Expand Up @@ -623,7 +622,7 @@ class DiscoveryPane(AddonsBasePage):

def __init__(self, testsetup, path):
AddonsBasePage.__init__(self, testsetup)
self.selenium.open(testsetup.base_url + path)
self.selenium.open("%s/%s" % (self.site_version, path))
#resizing this page for elements that disappear when the window is < 1000
self.selenium.get_eval("window.resizeTo(10000,10000); window.moveTo(0,0)")

Expand Down
2 changes: 2 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def pytest_runtest_setup(item):
item.sauce_labs_username = item.config.option.sauce_labs_username
item.sauce_labs_api = item.config.option.sauce_labs_api

TestSetup.site_version = 'impala' in item.keywords and '/i' or ''

if not 'skip_selenium' in item.keywords:
TestSetup.skip_selenium = False
if item.sauce_labs_username:
Expand Down
1 change: 1 addition & 0 deletions page.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(self, testsetup):
self.selenium = testsetup.selenium
self.timeout = testsetup.timeout
self.credentials = testsetup.credentials
self.site_version = testsetup.site_version

@property
def is_the_current_page(self):
Expand Down

0 comments on commit 179a6a2

Please sign in to comment.