Index: tst_cloud_sync - treatment_screen/test.py =================================================================== diff -u -r4116688cf45cec15d6ac8dec0d3030a0df5c36a5 -r2c475e06cf2d9f156b3853b547ddaec2ea102913 --- tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision 4116688cf45cec15d6ac8dec0d3030a0df5c36a5) +++ tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision 2c475e06cf2d9f156b3853b547ddaec2ea102913) @@ -6,7 +6,7 @@ # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # -# file tst_inhandled_message_log +# file tst_cloud_sync-treatment_screen # date 2022/04/09 # author Amritha debnath # joseph varghese @@ -27,14 +27,11 @@ hd_simulator = HDSimulator() -CLOUD_CREDENTIALS_LOCATION = '/home/denali/Desktop/cloudsync/credentials' -CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync' + +CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' MESSAGE_1 = '1639391827,1,0,2008,1,Tx_code' -PEM_FILES = ['1.pem', '2.pem', '3.pem' ] - - def get_cloud_sync_input_file(): """ This function is the handler for getting file from log folder. @@ -48,7 +45,22 @@ except: return False +def verify_ui_response(): + """ + This function is used for verify the treatment log changes + """ + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_POST.value, sub_mode=PostTreatmentStates.HD_POST_TREATMENT_PATIENT_DISCONNECTION_STATE.value) + for indicator in range(1, num_of_instructions, 1): + if indicator != num_of_instructions: + mouseClick(waitForObject(names.o_patient_Disconnection_right_arrow)) + + + snooze(2) + + + + def get_cloud_sync_output_file(): """ This function is the handler for getting file from log folder. @@ -63,23 +75,12 @@ return False -def append_cloudsync_credentials_file(): - - try: - os.makedirs(CLOUD_CREDENTIALS_LOCATION, exist_ok = True) - test.log("Directory created successfully") - for file_handler in range(len(PEM_FILES)): - path = os.path.join(CLOUD_CREDENTIALS_LOCATION, PEM_FILES[file_handler]) - with open(path, 'w') as file_reader: - pass - - except OSError as error: - test.log("Directory can not be created") - - - def retrive_log_data(): - + """ + This function is the handler for getting file from log folder. + Application log file is automatically created on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_out.log' + @return latest_file - (string) returns latest file that append on log folder from sd-data + """ file_name = utility.get_extracted_file_inp_buf() try: with open(file_name,mode = 'r') as f: @@ -105,22 +106,20 @@ utils.waitForGUI(5) - - - def main(): - append_cloudsync_credentials_file() + utility.append_cloudsync_credentials_file() utils.tstStart(__file__) startApplication(config.AUT_NAME) utils.waitForGUI(1.5) cloud_out_log = get_cloud_sync_output_file() set_data_in_cloud_sync_output_file(cloud_out_log, MESSAGE_1) - retrive_log_data + verify_ui_response() + verify_log_response() utils.tstDone()