Спасибо за советы! Реализоовал вот так, только цикл почему то не останавливается:
def swipe_to_down(self, locator: str, timeout=2):
by = get_locator_by_string(locator)
element_none = WebDriverWait(self._driver, timeout).until(
ex_cond.invisibility_of_element_located(by), ' : '.join(by))
while element_none is True:
self._driver.execute_script('mobile: scroll', {'direction': 'down'})
return WebDriverWait(self._driver, timeout).until(
ex_cond.visibility_of_element_located(by), ' : '.join(by))
Пойдуу повторю цикклы, что ли 😅
def swipe_to_down(self, locator: str, timeout=2):
by = get_locator_by_string(locator)
element_none = WebDriverWait(self._driver, timeout).until(
ex_cond.invisibility_of_element_located(by), ' : '.join(by))
element_vis = WebDriverWait(self._driver, timeout).until(
ex_cond.invisibility_of_element_located(by), ' : '.join(by))
while element_none is True:
self._driver.execute_script('mobile: scroll', {'direction': 'down'})
if element_vis is True:
return element_vis
Изначально передавал не совсеем корректный локатор. Теперь всё работает корректно 🙂