Пример #1
0
 def is_enabled(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY):
     try:
         Wait(self.driver).element_visible(self.locator, timeout, frequency)
         Browser(self.driver)._get_element(self.locator).is_enabled()
         return True
     except (TimeoutException, NoSuchElementException):
         return False
Пример #2
0
 def get_attribute(self,
                   attribute,
                   timeout=WAIT_UNTIL_TIMEOUT,
                   frequency=WAIT_FREQUENCY):
     Wait(self.driver).element_present(self.locator, timeout, frequency)
     value = Browser(self.driver)._get_element(
         self.locator).get_attribute(attribute)
     return value
Пример #3
0
 def get_size(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY):
     Wait(self.driver).element_clickable(self.locator, timeout, frequency)
     size = Browser(self.driver)._get_element(self.locator).size
     return size
Пример #4
0
 def get_text(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY):
     Wait(self.driver).element_visible(self.locator, timeout, frequency)
     text = Browser(self.driver)._get_element(self.locator).text
     return text
Пример #5
0
 def submit(self, timeout=WAIT_UNTIL_TIMEOUT, frequency=WAIT_FREQUENCY):
     Wait(self.driver).element_clickable(self.locator, timeout, frequency)
     Browser(self.driver)._get_element(self.locator).submit()
Пример #6
0
 def __init__(self, driver):
     self.driver = driver
     self.browser = Browser(self.driver)
     self.wait = Wait(self.driver)