mirror of
https://github.com/status-im/status-react.git
synced 2025-01-10 19:16:59 +00:00
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()
|
return self.find_element()
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
self.driver.info('Scrolling %s to %s' % (direction, self.name))
|
self.driver.info('Scrolling %s to %s' % (direction, self.name))
|
||||||
|
size = self.driver.get_window_size()
|
||||||
if direction == 'down':
|
if direction == 'down':
|
||||||
self.driver.swipe(500, 1000, 500, 500)
|
self.driver.swipe(500, size["height"]*0.4, 500, size["height"]*0.05)
|
||||||
else:
|
else:
|
||||||
self.driver.swipe(500, 500, 500, 1000)
|
self.driver.swipe(500, size["height"]*0.1, 500, size["height"]*0.8)
|
||||||
else:
|
else:
|
||||||
raise NoSuchElementException(
|
raise NoSuchElementException(
|
||||||
"Device %s: '%s' is not found on the screen" % (self.driver.number, self.name)) from None
|
"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):
|
def logcat(self):
|
||||||
logcat = self.driver.get_log("logcat")
|
logcat = self.driver.get_log("logcat")
|
||||||
if len(logcat) > 1000:
|
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')
|
raise TimeoutError('Logcat is empty')
|
||||||
|
|
||||||
def confirm(self):
|
def confirm(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user