def wait_has_attribute(self, attribute, timeout=30): """Wait for element to have attribute :Returns: The element """ wait = WebDriverWait(self.parent, timeout) message = f'Timeout waiting for element {self.name} to have attribute {attribute}' wait.until(gec.element_to_have_attribute(self, attribute), message=message) return self
def wait_has_not_attribute(self, attribute, timeout=30): """Wait for element to not have attribute :Returns: The element """ wait = WebDriverWait(self.parent, timeout) message = ( 'Timeout waiting for element {} to not have attribute {}'.format( self.name, attribute)) wait.until_not(gec.element_to_have_attribute(self, attribute), message=message) return self