Example #1
0
 def waitForText(self, target, value):
     locator = create_locator(target)
     pattern = create_pattern(value)
     for i in range(self.timeout):
         sleep(1)
         try:
             pattern.compare(locator.get_element(self.webdriver).text)
         except: continue
         return True
     return False
Example #2
0
 def waitForText(self, target, value):
     locator = create_locator(target)
     pattern = create_pattern(value)
     print locator.get_element(self.webdriver).text
     return pattern.compare(locator.get_element(self.webdriver).text)
Example #3
0
 def assertTitle(self, target, value):
     pattern = create_pattern(target)
     return pattern.compare(self.webdriver.title)
Example #4
0
 def verifyText(self, target, value):
     locator = create_locator(target)
     pattern = create_pattern(value)
     return pattern.compare(locator.get_element(self.webdriver).text)
Example #5
0
 def assertTextPresent(self, target, value):
     pattern = create_pattern(target)
     return pattern.compare(self.webdriver.find_element_by_tag_name('body').text)
Example #6
0
 def assertLocation(self, target, value):
     return create_pattern(target).compare(self.webdriver.current_url)
Example #7
0
 def assertCssCount(self, target, value):
     elements = self.webdriver.find_elements_by_css_selector(target)
     return create_pattern(value).compare(len(elements))
Example #8
0
 def assertAllFields(self, target, value):
     return create_pattern(target).compare(self._getAllFields())
Example #9
0
 def assertAlert(self, target, value):
     return create_pattern(target).compare(self.webdriver.switch_to_alert().text)