ensure element.type: types to the end (i.e. append); waits for visibility and not covered by other (like preloader cover)
Kind of just aliasing it to self.click().send_keys(keys) would help, but:
- should we click on input all times? at least we should add a corresponding configuration option...
- and where should we click then? start? end? when typing - we have to click at end... How to implement this? in a simple and proper way?
I will do
There was an idea to provide the following implementation
def _actual_not_overlapped_element(self):
element = self()
element_html = re.sub('\\s+', ' ', element.get_attribute('outerHTML'))
def maybe_cover():
if not element.is_displayed():
raise ElementNotVisibleException(
f'Element {element_html} is not visible'
)
window_position = self.config.driver.get_window_position()
element_position_x = int(
element.location['x']
+ window_position['x']
+ element.size['width'] / 2
)
element_position_y = int(
element.location['y']
+ window_position['y']
+ element.size['height'] / 2
)
element_from_point: WebElement = self.config.driver.execute_script(
'''
return document.elementFromPoint(arguments[0], arguments[1]);
''',
element_position_x,
element_position_y,
)
if element == element_from_point:
return None
else:
return element_from_point
if maybe_cover() is not None:
cover_html = re.sub(
'\\s+', ' ', maybe_cover().get_attribute('outerHTML')
)
raise ElementNotInteractableException(
f'Element {element_html} is overlapped by {cover_html}'
)
return element
instead something like this via js...
but the problem with "raw webdriver approach" is in much more calles via driver – that should be much less efficient in context of speed...
so we definitely have to use js for now... maybe later we can provide a "no js" option just in case... but for now - the pure js is what is needed here...
Found PR #309 and linked to the issue. @rina-tenitska @yashaka all tests have been written for this issue? Issue can be closed?