Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (27 sloc) 1.133 kb
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at
from import WebDriverWait
from unittestzero import Assert
class Page(object):
def __init__(self, testsetup):
self.testsetup = testsetup
self.base_url = testsetup.base_url
self.selenium = testsetup.selenium
self.timeout = testsetup.timeout
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):
return self.selenium.find_element(*locator).is_displayed()
return False
def current_page_url(self):
Jump to Line
Something went wrong with that request. Please try again.