-
-
Save startling/2494005 to your computer and use it in GitHub Desktop.
program.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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