Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Merge pull request #162 from willkg/move-page
Browse files Browse the repository at this point in the history
Move page out of the root directory
  • Loading branch information
willkg committed May 28, 2014
2 parents 73b97c6 + 6d4afae commit 366632d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 38 deletions.
36 changes: 0 additions & 36 deletions page.py

This file was deleted.

29 changes: 28 additions & 1 deletion pages/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,35 @@

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from unittestzero import Assert

from page import Page

class Page(object):

def __init__(self, testsetup):
self.testsetup = testsetup
self.base_url = testsetup.base_url
self.selenium = testsetup.selenium
self.timeout = testsetup.timeout

@property
def is_the_current_page(self):
if self._page_title:
WebDriverWait(self.selenium, self.timeout).until(lambda s: s.title)

Assert.equal(self.selenium.title, self._page_title,
"Expected page title: %s. Actual page title: %s" % (self._page_title, self.selenium.title))
return True

def is_element_visible(self, locator):
try:
return self.selenium.find_element(*locator).is_displayed()
except:
return False

@property
def current_page_url(self):
return(self.selenium.current_url)


class BasePage(Page):
Expand Down
2 changes: 1 addition & 1 deletion pages/desktop/regions/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from selenium.webdriver.common.by import By

from page import Page
from pages.base import Page


class Message(Page):
Expand Down

0 comments on commit 366632d

Please sign in to comment.