Update scroll to element
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
bda7386747
commit
68a07740d8
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue