Commit 37ec79be by Jonathan Piacenti

Added 'wait until exists' method.

parent 7d7201fb
...@@ -61,12 +61,16 @@ class SeleniumBaseTest(SeleniumTest): ...@@ -61,12 +61,16 @@ class SeleniumBaseTest(SeleniumTest):
def wait_until_clickable(self, elem): def wait_until_clickable(self, elem):
wait = WebDriverWait(elem, self.timeout) wait = WebDriverWait(elem, self.timeout)
wait.until(lambda e: e.is_displayed() and e.is_enabled(), u"{} should be cliclable".format(elem.text)) wait.until(lambda e: e.is_displayed() and e.is_enabled(), u"{} should be clickable".format(elem.text))
def wait_until_text_in(self, text, elem): def wait_until_text_in(self, text, elem):
wait = WebDriverWait(elem, self.timeout) wait = WebDriverWait(elem, self.timeout)
wait.until(lambda e: text in e.text, u"{} should be in {}".format(text, elem.text)) wait.until(lambda e: text in e.text, u"{} should be in {}".format(text, elem.text))
def wait_until_exists(self, selector):
wait = WebDriverWait(self.browser, self.timeout)
wait.until(lambda driver: driver.find_element_by_css_selector(selector), u"Selector '{}' should exist.")
def go_to_page(self, page_name, css_selector=None): def go_to_page(self, page_name, css_selector=None):
""" """
Navigate to the page `page_name`, as listed on the workbench home Navigate to the page `page_name`, as listed on the workbench home
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment