return True
for tryCnt in range(10):
- stub.flick(ReqFlick(startPoint=Point(x=160, y=350), endPoint=Point(x=160, y=10), durationMs=100))
+ stub.flick(ReqFlick(startPoint=Point(x=160, y=350), endPoint=Point(x=160, y=10), durationMs=500))
response = stub.findElement(ReqFindElement(textField='Entry/Editfield, Entry/Text Input'))
if len(response.elements) <= 0: continue
targetObj = response.elements[0].elementId
break
for tryCnt in range(10):
- stub.flick(ReqFlick(startPoint=Point(x=160, y=350), endPoint=Point(x=160, y=10), durationMs=100))
+ stub.flick(ReqFlick(startPoint=Point(x=160, y=350), endPoint=Point(x=160, y=10), durationMs=500))
response = stub.findElement(ReqFindElement(textField='Editable'))
if len(response.elements) <= 0: continue
targetObj = response.elements[0].elementId
response = stub.getSize(ReqGetSize(elementId=targetObj))
- if inScreen(response.size):
+ isShowing = stub.getAttribute(ReqGetAttribute(elementId=targetObj, attribute='SHOWING')).boolValue
+ if inScreen(response.size) or isShowing:
stub.click(ReqClick(type='ELEMENTID', elementId=targetObj))
break
return stub.getAppInfo(ReqGetAppInfo(packageName='org.example.uicomponents')).isRunning != True
def sendKeyTest(stub):
- response = stub.sendKey(ReqKey(type='HOME', actionType='STROKE'))
+ response = stub.sendKey(ReqKey(type='POWER', actionType='STROKE'))
+ time.sleep(3)
+ response = stub.sendKey(ReqKey(type='POWER', actionType='STROKE'))
time.sleep(3)
response = stub.sendKey(ReqKey(type='BACK', actionType='STROKE'))
time.sleep(5)
+ response = stub.sendKey(ReqKey(type='WHEELUP', actionType='STROKE'))
+ time.sleep(0.3)
+ response = stub.sendKey(ReqKey(type='WHEELUP', actionType='STROKE'))
+ time.sleep(0.3)
+ response = stub.sendKey(ReqKey(type='WHEELDOWN', actionType='STROKE'))
+ time.sleep(0.3)
return True
def scrollToTest(stub):
runTest(stub, touchTest)
runTest(stub, sendKeyTest)
runTest(stub, setValueClearTest)
-
runTestWithoutSetupAndTearDown(stub, installAppTest)
runTestWithoutSetupAndTearDown(stub, launchAppTest)
runTestWithoutSetupAndTearDown(stub, getAppInfoTest)
import aurum_pb2_grpc
import logging
import grpc
+import time
def run():
with grpc.insecure_channel('127.0.0.1:50051') as channel:
stub = aurum_pb2_grpc.BootstrapStub(channel)
- print(stub.getLocation(ReqGetLocation()).status)
- print(stub.sync(ReqEmpty()))
- print(stub.getDeviceTime(ReqGetDeviceTime(type='WALLCLOCK')))
- # stub.killServer(aurum_pb2.ReqEmpty())
+# print(stub.getLocation(ReqGetLocation()).status)
+# print(stub.sync(ReqEmpty()))
+# print(stub.getDeviceTime(ReqGetDeviceTime(type='WALLCLOCK')))
+# print(stub.sendKey(ReqKey(type='WHEELUP')))
+# time.sleep(0.1)
+# print(stub.sendKey(ReqKey(type='WHEELDOWN')))
+# time.sleep(0.1)
+# print(stub.sendKey(ReqKey(type='HOME')))
+# print(stub.sendKey(ReqKey(type='POWER')))
+# stub.killServer(aurum_pb2.ReqEmpty())
if __name__ == '__main__':
logging.basicConfig()