Index: shared/scripts/configuration/config.py =================================================================== diff -u -r9b3e2170cacd0aab59984e93aea8d054d67279d7 -r5c9825f73e3d8daf6070b64d2c54cf8da61cbef4 --- shared/scripts/configuration/config.py (.../config.py) (revision 9b3e2170cacd0aab59984e93aea8d054d67279d7) +++ shared/scripts/configuration/config.py (.../config.py) (revision 5c9825f73e3d8daf6070b64d2c54cf8da61cbef4) @@ -1768,5 +1768,3 @@ } - - \ No newline at end of file Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r9b3e2170cacd0aab59984e93aea8d054d67279d7 -r5c9825f73e3d8daf6070b64d2c54cf8da61cbef4 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 9b3e2170cacd0aab59984e93aea8d054d67279d7) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 5c9825f73e3d8daf6070b64d2c54cf8da61cbef4) @@ -239,7 +239,7 @@ value = pyInt(value) key_val = squish.waitForObject(keypad_input(value)) squish.mouseClick(key_val) - utils.waitForGUI(1) + utils.waitForGUI(0.1) test.endSection() def erase_entered_value(input_field): @@ -251,7 +251,7 @@ input_field= squish.waitForObject(input_field) entered_value = str(input_field.text) for value in range(len(entered_value)+1): - utils.waitForGUI(1) + utils.waitForGUI(0.1) squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) test.compare(str(input_field.text), "", "Input field should be empty") Index: tst_main_treatment_vitals/test.py =================================================================== diff -u -rc83cda15c7929a0e9c374d00df5256f1a9e9acba -r5c9825f73e3d8daf6070b64d2c54cf8da61cbef4 --- tst_main_treatment_vitals/test.py (.../test.py) (revision c83cda15c7929a0e9c374d00df5256f1a9e9acba) +++ tst_main_treatment_vitals/test.py (.../test.py) (revision 5c9825f73e3d8daf6070b64d2c54cf8da61cbef4) @@ -8,11 +8,12 @@ # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # file tst_main_treatment_vitals -# date 02/16/2022 +# date 05/31/2022 # author Papiya Mandal import builtins import names +import time from configuration.config import * from configuration.utility import * @@ -52,6 +53,7 @@ art_low = -240 art_high = -20 + def keyboard_object_map_helper(text): """ Method for setting custom object property's for keyboard keys @@ -121,6 +123,7 @@ """ test.startSection("Opening 'Vitals' pop up") vitals_touch_area = object.parent(waitForObject(names.o_vitals_title)) + start_time = time.time() mouseClick(vitals_touch_area) test.log("Verifying the 'Vitals' pop up is displayed") if object.exists(names.o_vitals_pop_up_title): @@ -140,7 +143,9 @@ hr_uom = str(hr_uom.text) test.compare(hr_uom, HEART_RATE_UNIT,"Heart Rate unit should be {}".format(HEART_RATE_UNIT)) test.endSection() + return start_time + def verify_color_of_entry(entry, vital_parameter, input_field): """ Method to verify the color of entry @@ -372,7 +377,7 @@ """ Method to set create custom treatment slider value based on slider buffer """ - test.startSection("Method to set create custom treatment slider based on positive slider buffer") + test.startSection("Set create custom treatment slider based on positive slider buffer") test.compare(waitForObject(names.o_PreTreatmentCreate_Create_a_Custom_Treatment_Text).text, config.TREATMENT_TITLE, "Title text should be -> "+str(config.TREATMENT_TITLE)) test.compare(waitForObject(names.o_PreTreatmentCreate_PRESCRIPTION_Text).text, config.PRESCRIPTION_TITLE, "Title text should be -> "+str(config.PRESCRIPTION_TITLE)) @@ -488,7 +493,7 @@ test.startSection("verification of blood pressure measurement interval values") test.compare(waitForObject(names.o_PreTreatmentCreate_bloodPressureMeasurementInterval_SliderCreateTreatment).label, config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL, "Parameter should be -> "+str(config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL)) - test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, 25, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) + test_custom_treatment_slider(names.o_PreTreatmentCreate_bloodPressureMeasurementIntervalSlider_Slider, 5, config.CREATE_TREATMENT_SLIDER_VALUES["blood_pressure_measurement_interval"], config.BLOOD_PRESSURE_MEASUREMENT_INTERVAL) test.endSection() @@ -625,7 +630,7 @@ and navigate to patient connection screen and set bp/hr navigate to main treatment screen to reset vital """ - test.startSection("Method to verify last read and interval of blood pressure and heart rate") + test.startSection("Verify last read and interval of blood pressure and heart rate") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_TPAR.value , sub_mode = HDOpSubModes.SUBMODE_START.value) mouseClick(waitForObject(names.o_input_patient_id)) type(waitForObject(names.o_input_patient_id), "abcd") @@ -652,6 +657,9 @@ hd_simulator.cmd_set_treatment_states_data(sub_mode = 2, uf_state= 0, saline_state=0, heparin_state= 0, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) + mouseClick(waitForObject(names.o_vitals_close_btn)) + utils.waitForGUI(1) + verify_vitals_pop_up_is_opened_automatically_after_an_interval(interval=5) test.endSection() @@ -661,16 +669,14 @@ from main treatment to patient connection verifying the same by navigating from patient connection to main treatment to reset """ - test.startSection("Method to reset and verify the blood pressure and heart rate") hd_simulator.cmd_send_hd_operation_mode(op_mode = 6 , sub_mode = 2) - utils.waitForGUI(2) + utils.waitForGUI(1) hd_simulator.cmd_set_treatment_states_data(sub_mode = 1, uf_state= 0, saline_state=0, heparin_state= 0, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) hd_simulator.cmd_set_treatment_states_data(sub_mode = 2, uf_state= 0, saline_state=0, heparin_state= 0, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) - test.endSection() def set_parameter_type(text): """ @@ -699,7 +705,41 @@ utils.waitForGUI(0.3) mouseClick(findObject(slider_object), float(slider_width) , 3, Qt.LeftButton) test.compare(waitForObjectExists(slider_object).value, value, str(parameter)+" slider value should set to"+str(value)) - + +def verify_vitals_pop_up_automatic_close_functionality(): + """ + Method to verify the vitals pop up + is closed automatically after 1 min + """ + test.startSection("Verify the vitals pop up closed automatically after 1 min") + sec = 70 + start_time = open_vitals_pop_up() + time.sleep(sec) + bp_uom = waitForObject(names.o_bp_uom) + end_time = time.time() + total_elapsed_time = end_time - start_time + test.log("Total elapsed time : {}".format(total_elapsed_time)) + test.compare(bp_uom.text, BLOOD_PRESSURE_UNIT, "{} should displayed when pop up is closed".format(BLOOD_PRESSURE_UNIT)) + test.endSection() + +def verify_vitals_pop_up_is_opened_automatically_after_an_interval(interval): + """ + Method to verify the vitals pop up + is opened automatically once the + BPM interval time is elapsed + @param interval - (int) interval in min + """ + test.startSection("Verify the vitals pop up opened automatically after interval time is elapsed") + sec = interval*60 + start_time = time.time() + utils.waitForGUI(sec) + close_btn = waitForObject(names.o_vitals_close_btn) + end_time = time.time() + total_elapsed_time = end_time - start_time + test.log("Total elapsed time : {}".format(total_elapsed_time)) + test.compare(close_btn.visible, VISIBLE, "Dialog close button should be visible after the vitals pop up is opened automatically") + test.endSection() + def main(): utils.tstStart(__file__) @@ -714,16 +754,16 @@ min_uf_volume=0.0, max_uf_volume=8000.0, min_dialysate_flow_rate=100, max_dialysate_flow_rate=600) - utils.waitForGUI(1) + verify_vitals_pop_up_automatic_close_functionality() + utils.waitForGUI(1) open_vitals_pop_up() verify_entered_valid_vital_entries_in_main_treatment_screen(sys_val=SYSTOLIC_PRESSSURE_120, dia_val=DIASTOLIC_PRESSSURE_80, heart_rate=HEART_RATE_VAL_101, save=True) utils.waitForGUI(1) - open_vitals_pop_up() verify_entered_value_in_pop_up(value=SYSTOLIC_PRESSSURE_120, input_field=names.o_pop_up_systolic_input_field,