Update scroll to element

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2020-07-09 18:24:19 +03:00
parent bda7386747
commit 68a07740d8
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
2 changed files with 4 additions and 3 deletions

View File

@ -116,10 +116,11 @@ class BaseElement(object):
return self.find_element()
except NoSuchElementException:
self.driver.info('Scrolling %s to %s' % (direction, self.name))
size = self.driver.get_window_size()
if direction == 'down':
self.driver.swipe(500, 1000, 500, 500)
self.driver.swipe(500, size["height"]*0.4, 500, size["height"]*0.05)
else:
self.driver.swipe(500, 500, 500, 1000)
self.driver.swipe(500, size["height"]*0.1, 500, size["height"]*0.8)
else:
raise NoSuchElementException(
"Device %s: '%s' is not found on the screen" % (self.driver.number, self.name)) from None

View File

@ -449,7 +449,7 @@ class BaseView(object):
def logcat(self):
logcat = self.driver.get_log("logcat")
if len(logcat) > 1000:
return str([i for i in logcat if 'appium' not in str(i).lower()])
return str([i for i in logcat if 'appium' or ':1.000000.' not in str(i).lower()])
raise TimeoutError('Logcat is empty')
def confirm(self):