Skip to content

Instantly share code, notes, and snippets.

@startling
Forked from els-pnw/error
Created April 25, 2012 22:31
Show Gist options
  • Save startling/2494005 to your computer and use it in GitHub Desktop.
Save startling/2494005 to your computer and use it in GitHub Desktop.
program.py
products = {
"sam": "Subscription Asset Manager - Subscription Management",
"headpin": "Headpin - Open Source Subscription Management",
"katello", "Katello - Open Source Systems Management"
}
class Page(object):
"Base class for all Pages"
def __init__(self, testsetup):
"Initializer."
self.testsetup = testsetup
self.base_url = testsetup.base_url
self.selenium = testsetup.selenium
self.timeout = testsetup.timeout
self.project = testsetup.project
def is_the_current_page(self):
product = products.get(self.products, None)
if product:
WebDriverWait(self.selenium, 10).until(lambda s: self.selenium.title)
if self.selenium.title != product:
raise NameError("Expected page title: %s. Actual page title: %s" %
(self.product, self.selenium.title))
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment