example: enhance a test script and mismatching protocol
authorWonki Kim <wonki_.kim@samsung.com>
Fri, 24 Apr 2020 13:05:21 +0000 (22:05 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Sat, 25 Apr 2020 05:58:37 +0000 (14:58 +0900)
this patch add a bit more tests

Change-Id: Ib3c82e2e3789302583e60db805b620b9e7116efa

org.tizen.aurum-bootstrap/src/Commands/GetLocationCommand.cc
protocol/aurum.proto
protocol/examples/python/testFeatures.py
protocol/examples/python/testInternal.py

index a8a5aff..b92ff80 100644 (file)
@@ -11,5 +11,10 @@ GetLocationCommand::GetLocationCommand(const ::aurum::ReqGetLocation* request,
 {
     LOG_SCOPE_F(INFO, "CliGetLocation --------------- ");
     // ObjectMapper *mObjMap = ObjectMapper::getInstance();
+
+    mResponse->set_alt(-1);
+    mResponse->set_lat(-1);
+    mResponse->set_status(::aurum::RspStatus::ERROR);
+
     return grpc::Status::OK;
 }
\ No newline at end of file
index 254690b..e678b38 100644 (file)
@@ -325,8 +325,8 @@ message ReqGetLocation{
 }
 message RspGetLocation{
    RspStatus status = 1;
-   string alt = 2;
-   string lat = 3;
+   double alt = 2;
+   double lat = 3;
 }
 
 message ReqKey{
index 6a383b3..3b27fc9 100644 (file)
@@ -148,6 +148,9 @@ def clickTest(stub):
     return True
 
 def longClickTest(stub):
+    response = stub.sendKey(ReqKey(type='HOME', actionType='STROKE'))
+    stub.click(ReqClick(coordination=Point(x=160, y=160), type='COORD'))
+    # TODO : find out something changed
     return False
 
 def flickTest(stub):
@@ -244,13 +247,15 @@ def scrollToTest(stub):
 def getDeviceTimeTest(stub):
     response1 = stub.getDeviceTime(ReqGetDeviceTime(type='WALLCLOCK'))
     response2 = stub.getDeviceTime(ReqGetDeviceTime(type='WALLCLOCK'))
-
     print(response1, response2)
-    return response2.timeStampUTC > response1.timeStampUTC;
+    return response2.timestampUTC > response1.timestampUTC;
 
 def getLocationTest(stub):
-    print('getLocation command not implemented')
-    return False
+    response = stub.getLocation(ReqGetLocation())
+
+    if response.alt < 0: return False
+    if response.lat < 0: return False
+    return True
 
 def defaultSetup(stub):
     if stub.getAppInfo(ReqGetAppInfo(packageName='com.samsung.ui-widget-sample')).isRunning:
@@ -300,11 +305,11 @@ def run():
         runTestWithoutSetupAndTearDown(stub, closeAppTest)
         runTestWithoutSetupAndTearDown(stub, removeAppTest)
 
-
-        runTest(stub, scrollToTest, alwaySucceed=True)
         runTest(stub, longClickTest, alwaySucceed=True)
         runTest(stub, getLocationTest, alwaySucceed=True)
 
+        runTest(stub, scrollToTest, alwaySucceed=True)
+
 if __name__ == '__main__':
     logging.basicConfig()
     run()
index 23f2faa..c81c839 100644 (file)
@@ -8,9 +8,10 @@ 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())
+        # stub.killServer(aurum_pb2.ReqEmpty())
 
 if __name__ == '__main__':
     logging.basicConfig()