Index: tst_cloud_sync - treatment_screen/test.py =================================================================== diff -u -rfbc00387efe0d10dea9ac41d5cde7e5c84716528 -rd91281a999d531ec87d575545b226e44dbae58a1 --- tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision fbc00387efe0d10dea9ac41d5cde7e5c84716528) +++ tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision d91281a999d531ec87d575545b226e44dbae58a1) @@ -30,25 +30,13 @@ hd_simulator = HDSimulator() POST_TREATMENT_INSTRUCTION_COUNT = 2 -CLOUD_SYNC_LOG_LOCATION = '/home/denali/Desktop/sd-card/cloudsync/' -MESSAGE_1 = '1639391827,1,0,2008,1,Tx_code' +CODE_DISPLAY_REQUEST = '1639391827,1,0,2008,1,Tx_code' +DEVICE_STATE_REQUEST = '1639391827,1,0,2006,0' +DEVICE_STATE_RESPONSE = '1639391827,1,0, 1006, 2, Op-Mode, Sub-Mode' -def get_cloud_sync_input_file(): - """ - 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}_inp.log' - @return latest_file - (string) returns latest file that append on log folder from sd-data - """ - try: - current_date = utility.get_current_date_and_time(date_format = "%Y_%m_%d") - latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_inp.buf' - return latest_file - except: - return False - def verify_code_from_treatment_response(): """ This function is used for verify the treatment log changes @@ -59,32 +47,13 @@ mouseClick(waitForObject(names.o_patient_Disconnection_right_arrow)) utils.waitForGUI(1.5) mouseClick(names.o_patientDisconnectionConfirm_CONFIRM_Text) - message_text = MESSAGE_1.split(',') + message_text = CODE_DISPLAY_REQUEST.split(',') utils.waitForGUI(3) #delay for fetching the effect text_code_label = str(waitForObjectExists(names.o_treatmentReviewConfirm_Code_Tx_code_Label).text) test.compare(message_text[5], text_code_label.split(': ')[1], "CS2UI message should be verified") - - snooze(2) - - - -def get_cloud_sync_output_file(): - """ - 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 - """ - try: - current_date = utility.get_current_date_and_time(date_format = "%Y_%m_%d") - latest_file = CLOUD_SYNC_LOG_LOCATION+current_date+'_out.buf' - return latest_file - except: - return False - - def retrive_log_data(): """ This function is the handler for getting file from log folder. @@ -126,11 +95,11 @@ 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_CODE_DISPLAY) + cloud_out_log = utility.get_cloud_sync_output_file() + set_data_in_cloud_sync_output_file(cloud_out_log, CODE_DISPLAY_REQUEST) verify_code_from_treatment_response() - set_data_in_cloud_sync_output_file(cloud_out_log, MESSAGE_2) + set_data_in_cloud_sync_output_file(cloud_out_log, DEVICE_STATE_REQUEST) verify_log_response()