@@ -549,6 +549,14 @@ def get_device_runs(self, project_id, test_run_id, limit=0):
549549 def get_device_run_screenshots_list (self , project_id , test_run_id , device_run_id , limit = 0 ):
550550 return self .get ("me/projects/%s/runs/%s/device-runs/%s/screenshots" % (project_id , test_run_id , device_run_id ), payload = {'limit' : limit })
551551
552+ """ Get list of files for device run
553+ """
554+ def get_device_run_files (self , project_id , test_run_id , device_session_id , tags = None ):
555+ if tags is None :
556+ return self .get ("me/projects/%s/runs/%s/device-sessions/%s/output-file-set/files" % (project_id , test_run_id , device_session_id ))
557+ else :
558+ return self .get ("me/projects/%s/runs/%s/device-sessions/%s/output-file-set/files?tag[]=%s" % (project_id , test_run_id , device_session_id , tags ))
559+
552560 """ Downloads test run files to a directory hierarchy
553561 """
554562 def download_test_run (self , project_id , test_run_id ):
@@ -566,7 +574,7 @@ def download_test_run(self, project_id, test_run_id):
566574 if run_status in ("SUCCEEDED" , "FAILED" , "EXCLUDED" ):
567575 directory = "%s-%s/%d-%s" % (test_run_id , test_run ['displayName' ], device_run ['id' ], device_run ['device' ]['displayName' ])
568576 session_id = device_run ['deviceSessionId' ]
569- files = self . get ( "me/projects/%s/runs/%s/device-sessions/%s/output-file-set/files" % ( project_id , test_run_id , session_id ) )
577+ files = get_device_run_files ( project_id , test_run_id , session_id )
570578 for file in files ['data' ]:
571579 if file ['state' ] == "READY" :
572580 full_path = "%s/%s" % (directory , file ['name' ])
@@ -713,6 +721,7 @@ def get_commands(self):
713721 "test-run" : self .get_test_run ,
714722 "test-runs" : self .print_project_test_runs ,
715723 "device-runs" : self .get_device_runs ,
724+ "device-run-files" : self .get_device_run_files ,
716725 "download-test-run" : self .download_test_run ,
717726 "download-test-screenshots" : self .download_test_screenshots
718727 }
0 commit comments