Created
April 13, 2016 19:05
-
-
Save djmunro/38b25e4c35d14be517e15e5c7eece16f to your computer and use it in GitHub Desktop.
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
from pageobjects.basepageobject import BasePageObject | |
from pageobjects.basepageelement import BasePageElement | |
class BrowseElement(BasePageElement): | |
def __init__(self, type="all", driver): | |
self.driver = driver | |
if type.lower() is "all": | |
self.all() | |
elif type.lower() is "presets": | |
self.presets() | |
def all(self): | |
self.driver.click(RadioScreen.Browse.Refresh) | |
return '@TODO' | |
def presets(self): | |
self.driver.click(RadioScreen.Browse.Presets) | |
return '@TODO' | |
def refresh(self): | |
self.driver.click(RadioScreen.Browse.Refresh) | |
return '@TODO' | |
class TuneElement(BasePageElement): | |
def __init__(self, type="all", driver): | |
self.driver = driver | |
def enter_station(self, station): | |
for num in station: | |
self.driver.click(RadioScreen.Tune.THENUMBER) | |
time.sleep(.5) | |
return '@TODO' | |
def tune_up(self): | |
self.driver.click(RadioScreen.Tune.Up) | |
def tune_down(self): | |
self.driver.click(RadioScreen.Tune.Down) | |
class RadioPageObject(BasePageObject): | |
def __init__(self, driver): | |
self.driver = driver | |
#self.assertTrue(self.driver.connected) #need to implment this | |
# Navigate to radio screen | |
try: | |
self.assertEqual("RadioScreen", self.driver.screen_name()) | |
except AssertionError: | |
self.driver.click(RadioScreen) | |
self.driver.wait_for(RadioScreen, timeout=10) | |
self.assertEqual("RadioScreen", self.driver.current_screen()) | |
self.browse = BrowseElement(self.driver) | |
self.tune = TuneElement(self.driver) | |
def tune(self): | |
return self.tune | |
def browse(self): | |
return self.browse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment