Index: suite_leahi/tst_trends_and_screensaver/test.py =================================================================== diff -u -rbc89d06b8c352f3992c43dc4522ad720ec4e24ed -r3cf9dbe47566f44e8b0186297be4ccbb029678f0 --- suite_leahi/tst_trends_and_screensaver/test.py (.../test.py) (revision bc89d06b8c352f3992c43dc4522ad720ec4e24ed) +++ suite_leahi/tst_trends_and_screensaver/test.py (.../test.py) (revision 3cf9dbe47566f44e8b0186297be4ccbb029678f0) @@ -142,75 +142,6 @@ ) -def set_value_based_on_target_patientvitals(obj, target_value): - """ - obj: dictionary containing object paths - Example: - { - "value_obj": ":mainTreatmentScreen.PressureText", - "left_arrow": ":mainTreatmentScreen.LeftArrow", - "right_arrow": ":mainTreatmentScreen.RightArrow" - } - - target_value: integer or string number, e.g. 220 - """ - target_value = target_value - - # Wait for all objects - parent_obj = waitForObjectExists(obj) - # change range as per your screen count - - left_arrow = utility.findObjectById(parent_obj, "_leftArrow") - right_arrow = utility.findObjectById(parent_obj, "_rightArrow") - - # Read current value (supports invisible text too) - parent = waitForObject(parent_obj) - current_value = utility.findObjectById(parent, "_currentItem") - current_value = str(current_value.text) - - # Determine direction - while float(current_value) != float(target_value): - if float(current_value) < float(target_value): - mouseClick(waitForObject(right_arrow)) - - elif float(current_value) > float(target_value): - mouseClick(waitForObject(left_arrow)) - - parent = waitForObject(parent_obj) - current_value = utility.findObjectById(parent, "_currentItem") - current_value = str(current_value.text) - - -def keyboard_object_map_helper(text): - """ - Method for setting custom object property's for keyboard keys - @return: required object property's for keys - """ - if text is not None: - names.keyboard_input["text"] = text - return names.keyboard_input - else: - test.log("Invalid ", text, " for object.") - names.o_keyboard_input["text"] = "Q" - - -def verify_valid_vitals_through_keypad( - title_name, input_field_obj, expected_value, actual_value -): - """ - Tests verifies valid patient id set through application keyboard setup . - @return: N/A - """ - input_field = waitForObject(input_field_obj) - mouseClick(input_field) - - for text in expected_value: - keyboard_value = keyboard_object_map_helper(text) - utils.waitForGUI(0.2) - mouseClick(waitForObjectExists(keyboard_value)) - utils.waitForGUI(0.2) - - # handler for messages from UI to FW def handle_patient_vitals_request(message, timestamp=0.0): """ @@ -275,7 +206,7 @@ mouseClick( utility.get_object_from_names(names.o_treatmentHome_editButton_IconButton) ) - set_value_based_on_target_patientvitals( + utility.set_value_based_on_target_patientvitals( names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 5 ) mouseClick(utility.get_object_from_names(names.o_confirm_button)) @@ -287,13 +218,13 @@ trends_data(1.73, 1.26, 160, 250, 190, 170, 144, 147, 13.4, 700) mouseClick(utility.get_object_from_names(names.o_vitalsButton_VitalsButton)) - verify_valid_vitals_through_keypad( + utility.verify_valid_vitals_through_keypad( config.SYSTOLIC, names.o_bloodPressureSystolic_TextEntry, "122", "122" ) - verify_valid_vitals_through_keypad( + utility.verify_valid_vitals_through_keypad( config.DIASTOLIC, names.o_bloodPressureDiastolic_TextEntry, "82", "82" ) - verify_valid_vitals_through_keypad( + utility.verify_valid_vitals_through_keypad( config.HEARTRATE, names.o_heartRate_TextEntry, "72", "72" ) mouseClick(waitForObject(names.o_measureVitalsButton_TouchRect))