Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r8e0a85bb2892e136dba36c9280bb3c9076017781 -r87f1659006faf49cfe16109ab7151b2f7f84c2fb --- shared/scripts/configuration/utility.py (.../utility.py) (revision 8e0a85bb2892e136dba36c9280bb3c9076017781) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 87f1659006faf49cfe16109ab7151b2f7f84c2fb) @@ -99,13 +99,6 @@ return False - -def pressure_pop_up_text_obj(text): - names.o_pop_up_pressure_text_obj["text"] = text - return names.o_pop_up_pressure_text_obj - return names.o_bullet_object - - def verify_bullet_navigation(num, num_of_instructions, screen_obj): """ Method to verify status of bullets based @@ -166,25 +159,11 @@ def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): date = datetime.now() return str(date.strftime(date_format)) - def vitals_reading_obj(reading): names.o_vitals_reading["text"] = reading return names.o_vitals_reading - -def enter_keypad_value(entry): - """ - Method to enter user desired - value using keypad - @param entry: (int) User expected value - """ - test.startSection("Entering {}".format(entry)) - entry = pyStr(entry) - for value in entry: - squish.mouseClick(squish.waitForObject(keypad_input(value))) - test.endSection() - def erase_entered_value(input_field): """ Method to erase the entered value @@ -198,15 +177,6 @@ squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) test.compare(str(input_field.text), "", "Input field should be empty") test.endSection() - -def vitals_reading_obj(reading): - names.o_vitals_reading["text"] = reading - return names.o_vitals_reading - -def keypad_input(key_value): - names.o_keypad_input["text"] = key_value - return names.o_keypad_input - def scroll_to_zone(zone=None, screen_object=None, direction = None): """ @@ -249,43 +219,6 @@ names.o_rejection_msg["text"] = text return names.o_rejection_msg -def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): - """ - Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] - @param treatment_step : indicates the Current treatment step - """ - test.startSection("verification of page step indicators") - for page in range(len(treatment_screens)): - bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) - bullet_circle_color = bullet_children[0].color.name - bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(get_text_object(screen_obj, treatment_screens[page])) - - #To verify the step indicators of the completed treatment screens - if page < treatment_step: - test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) - test.compare(bullet_circle_color, config.COMPLETE_COLOR) - test.compare(bullet_border_color,config.COMPLETE_COLOR) - test.compare(step_title.color.name,config.ENABLED_COLOR) - #To verify the step indicators of the current treatment screen - elif page == treatment_step: - test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) - test.compare(bullet_circle_color, config.CURRENT_COLOR) - test.compare(bullet_border_color, config.COMPLETE_COLOR) - test.compare(step_title.color.name, config.ENABLED_COLOR) - test.verify(step_title.font.bold) - #To verify the step indicators of the remaining treatment screens - else: - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) - test.compare(step_title.color.name, config.INCOMPLETE_COLOR) - test.compare(bullet_circle_color, config.CURRENT_COLOR) - test.compare(bullet_border_color, config.INCOMPLETE_COLOR) - test.endSection() - - def set_arterial_ranges_min_val(art_low): """ Method to set the Arterial range maximum value to user expected value @@ -469,13 +402,11 @@ else: test.compare(ven_min, ven_low, "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) test.endSection() - def expected_heparin_value(val): names.o_heparin_value["text"] = val return names.o_heparin_value - def msg(string): """ Added ### at the right side of the string to make sure that it is a message. @@ -599,32 +530,8 @@ test.compare(step_title.color.name, config.INCOMPLETE_COLOR) test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color, config.INCOMPLETE_COLOR) - test.endSection() - -def verify_missing_object(object_to_check): - """ - Method to verify the given object is invisible or is not present on the screen - @param object_to_check: the object whose invisibility must be verified - """ - try: - squish.testSettings.objectNotFoundDebugging = False - squish.waitForObject(object_to_check,3000) - test.fail("Given object should not be present initially") - except LookupError as _: - test.passes("object is not present as expected") - squish.testSettings.objectNotFoundDebugging = True + test.endSection() -def get_text_object(screen_obj, txt): - """ - To obtain a text object based on text provided - @param screen_obj: provides the container on which the txt must be present - @returns a real name object - """ - names.o_text_object["container"] = screen_obj - names.o_text_object["text"] = txt - return names.o_text_object - - def verify_color_of_entry(entry, vital_parameter, input_field): """ Method to verify the color of entry @@ -666,7 +573,6 @@ test.log("Invalid text for object.") names.o_keypad_input["text"] = None - def enter_keypad_value(entry): """ Method to enter user desired @@ -829,7 +735,6 @@ except: test.fail("Log file is not created or log file is not created based on standard log naming format.") - def get_current_log_details(message_ack = False, message_text = None): """ This function is capable to perform data analysis from application log folder. @@ -889,28 +794,6 @@ def vitals_interval_obj(interval): names.o_time_interval_obj["text"] = interval return names.o_time_interval_obj - -def keyboard_input(key_value): - names.o_keyboard_object["text"] = key_value - return names.o_keyboard_object - -def enter_keyboard_numeric_value(entry): - """ - Method to enter user desired - value using keypad - @param entry: (str) User expected value - """ - test.startSection("Entering {}".format(entry)) - for value in entry: - if value.isalpha(): - value = pyStr(value) - else: - value = pyInt(value) - key_val = squish.waitForObject(keyboard_input(value)) - squish.mouseClick(key_val) - utils.waitForGUI(0.1) - test.endSection() - def end_treatment_states_rejection_msg(text): names.o_end_treatment_state_rejection_msg["text"] = text @@ -954,28 +837,15 @@ except: test.fail("log file is not created during application interaction") return False - def rinseback_rejection_msg(text): names.o_rinseback_rejection_msg["text"] = text return names.o_rinseback_rejection_msg squish.testSettings.objectNotFoundDebugging = True - def recirculate_rejection_msg(text): names.o_recirculate_rejection_msg["text"] = text return names.o_recirculate_rejection_msg - - -def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): - """ - Method to get current date and time. - @input date_format (str) - format of date to be retrieved. - @return (str) - date in specified format. - """ - date = datetime.now(timezone.utc) - return str(date.strftime(date_format)) - def get_disinfect_bullet_object(id, screen_obj): """ @@ -988,7 +858,6 @@ names.o_disinfect_dynamic_StepBullet["id"] = id return names.o_disinfect_dynamic_StepBullet - def verify_page_step_indicator_for_disinfect(screen_obj, treatment_id, treatment_step, treatment_screens): """ Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] @@ -1027,7 +896,6 @@ test.compare(bullet_border_color, config.INCOMPLETE_COLOR) test.endSection() - def get_disinfect_text_object(text, screen_obj): """ To set a custom object based on item from parameters @@ -1039,7 +907,6 @@ names.o_disinfect_dynamic_StepBullet_Text["text"] = text return names.o_disinfect_dynamic_StepBullet_Text - def append_cloudsync_credentials_file(): """ This function is used for creating .pem files in the cloudsync folder. @@ -1055,7 +922,6 @@ 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. @@ -1067,8 +933,7 @@ latest_file = config.INP_BUF_FILE_LOCATION+current_date+'_inp.buf' return latest_file except: - return False - + return False def get_cloud_sync_output_file(): """ @@ -1081,8 +946,7 @@ latest_file = config.INP_BUF_FILE_LOCATION+current_date+'_out.buf' return latest_file except: - return False - + return False def get_current_date_and_time_in_utc(date_format='%Y/%m/%d - %H:%M:%S'): """ @@ -1093,7 +957,6 @@ date = datetime.now(timezone.utc) return str(date.strftime(date_format)) - def get_extracted_input_buf_file(): """ This function is the handler for getting file from cloudsync folder. @@ -1183,7 +1046,6 @@ except: return False - def scroll_to_value_on_pop_up(value=None, container=None): """ scroll to the to the value if object is hidden @@ -1208,7 +1070,6 @@ squish.mouseWheel(ScreenObj, screenWidth//2, screenHeight//2, 0, -50, squish.Qt.NoModifier) raise LookupError("value object is not in view to the user after trying 100 times") - def get_extracted_error_file(): """ This function is the handler for getting error file from service folder.