Index: shared/scripts/configuration/config.py =================================================================== diff -u -r94e535b209b30b9aaae8174e92ea802f4a6c5452 -rb634bdd10b66a9b76dd6c3898b27f60bd25bcbdc --- shared/scripts/configuration/config.py (.../config.py) (revision 94e535b209b30b9aaae8174e92ea802f4a6c5452) +++ shared/scripts/configuration/config.py (.../config.py) (revision b634bdd10b66a9b76dd6c3898b27f60bd25bcbdc) @@ -20,11 +20,6 @@ COMMON_PATH = os.environ['HOME']+"/Projects" -COLOR_CODES = {"Aqua": "#81ffff", "Blue": "#017dea", "Blue 2": "#1090d5", "Green": "#29fd2d", "Grey": "#d3d3d3", - "Lavender": "#db98f5", "Light Blue": "#acd7f1", "Light Teal": "#29f1da","Lime": "#b7fc36", - "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", - "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} - #standby mode GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r94e535b209b30b9aaae8174e92ea802f4a6c5452 -rb634bdd10b66a9b76dd6c3898b27f60bd25bcbdc --- shared/scripts/configuration/utility.py (.../utility.py) (revision 94e535b209b30b9aaae8174e92ea802f4a6c5452) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision b634bdd10b66a9b76dd6c3898b27f60bd25bcbdc) @@ -12,8 +12,8 @@ # ############################################################################ -import test import csv +import test import os from datetime import datetime @@ -48,16 +48,15 @@ path = os.path.join(CLOUD_CREDENTIALS_LOCATION, PEM_FILES[file_handler]) with open(path, 'w') as file_reader: pass - - except OSError as error: + except OSError: test.log("Directory can not be created") 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 + @return latest_file - (string) returns latest input log file path from sd-data """ try: current_date = get_current_date_and_time(date_format = "%Y_%m_%d") @@ -71,7 +70,7 @@ """ 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 + @return latest_file - (string) returns latest output log file path from sd-data """ try: current_date = get_current_date_and_time(date_format = "%Y_%m_%d") @@ -85,7 +84,8 @@ """ This function is the handler for getting file from log folder. Application log data is automatically appended on '/home/denali/Desktop/sd-card/cloudsync/ {current_date}_out.log' - @return latest_file - (list) returns latest file that append on log folder from sd-data + @input readline_count (int) - number of line to be read from cloud-sync log. + @return cloudsync_data - (list) returns extracted log data. """ cloudsync_data = [] count = 0 @@ -109,8 +109,8 @@ """ This function is verify consistancy of epoch value. @input current_epoch_value (float) - current epoch time - @input expected_epoch_value (str) - epoch time from the cloud-sync log. - @return (bool) - True/False + @input expected_epoch_value (str) - epoch time from cloud-sync log. + @return (bool) - True - if expected value is in range. else, return False """ expected_epoch_value = int(expected_epoch_value) maximum_epoch_value = int(current_epoch_value + 25) Index: tst_cloud_sync - treatment_screen/test.py =================================================================== diff -u -r94e535b209b30b9aaae8174e92ea802f4a6c5452 -rb634bdd10b66a9b76dd6c3898b27f60bd25bcbdc --- tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision 94e535b209b30b9aaae8174e92ea802f4a6c5452) +++ tst_cloud_sync - treatment_screen/test.py (.../test.py) (revision b634bdd10b66a9b76dd6c3898b27f60bd25bcbdc) @@ -17,8 +17,8 @@ import csv import names -import time import os +import time from dialin.ui.hd_simulator import HDSimulator from dialin.ui import utils from configuration import utility @@ -40,40 +40,44 @@ DEVICE_FACTORY_RESET_CONFIRM = '1639391827,1,0,1005,1,0' DEVICE_INFO_REQUEST = '1639391827,1,9,2002,0' + def verify_code_from_treatment_response(): """ This function is used for verify the code text from treatment log. """ 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, POST_TREATMENT_INSTRUCTION_COUNT, 1): + for indicator in range(1, POST_TREATMENT_INSTRUCTION_COUNT): if indicator != POST_TREATMENT_INSTRUCTION_COUNT: mouseClick(waitForObject(names.o_patient_Disconnection_right_arrow)) - utils.waitForGUI(2) + utils.waitForGUI() mouseClick(names.o_patientDisconnectionConfirm_CONFIRM_Text) message_text = CODE_DISPLAY_REQUEST.split(',') - utils.waitForGUI(3) #delay for fetching the effect + utils.waitForGUI(1) #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") + test.compare(message_text[config.PARAMETER_INDEX], text_code_label.split(': ')[1], "CS2UI message text for code 2008 should be verified") def set_data_in_cloud_sync_output_file(message): """ This function is capable to write message into cloud sync folder. Through this method file reader act as a handler and it will write custom messages into {current_date}_out.buf - @input: (string) message -expected message to be write on out.buf file. + @input: (string) message - expected message to be write on out.buf file. """ cloud_out_log = utility.get_cloud_sync_output_file() with open(cloud_out_log, "w") as filereader: filereader.write(message) - utils.waitForGUI(5) + test.log("User written message - %s into out.buf file" %message) + utils.waitForGUI(1) def verify_log_response(actual_cloudsync_data, expected_cloudsync_data): """ This function is used for verifying the expected and actual cloud-sync log data. + @input: (string) actual_cloudsync_data - cloud sync log from in device. + @input: (string) expected_cloudsync_data - expected cloud sync log. """ test.startSection("Verification of cloud response for code %s" %actual_cloudsync_data[config.CODE_INDEX]) expected_cloudsync_data = expected_cloudsync_data.split(',') @@ -86,8 +90,6 @@ test.compare(expected_cloudsync_data[index], actual_cloudsync_data[index], "cloud sync data %s is verified" %expected_cloudsync_data[index]) test.endSection() - - def main(): @@ -101,17 +103,13 @@ verify_code_from_treatment_response() set_data_in_cloud_sync_output_file(DEVICE_CREDENTIALS_REQUEST) - utils.waitForGUI(3) device_credentials_response = utility.retrive_log_data() verify_log_response(device_credentials_response[0], DEVICE_CREDENTIALS_RESPONSE) - set_data_in_cloud_sync_output_file(DEVICE_FACTORY_RESET_REQUEST) - utils.waitForGUI(3) factory_reset_response = utility.retrive_log_data() verify_log_response(factory_reset_response[0], DEVICE_FACTORY_RESET_CONFIRM) - utils.tstDone() \ No newline at end of file