Index: tst_ConfirmPrimingBegin/test.py =================================================================== diff -u -re14947f2a75df6341b987b3aa4a3c97a9c6eef9b -rd98c5ca0c23aec102058af19bc136d37685177ab --- tst_ConfirmPrimingBegin/test.py (.../test.py) (revision e14947f2a75df6341b987b3aa4a3c97a9c6eef9b) +++ tst_ConfirmPrimingBegin/test.py (.../test.py) (revision d98c5ca0c23aec102058af19bc136d37685177ab) @@ -6,17 +6,7 @@ from dialin.common.msg_defs import RequestRejectReasons from time import sleep -def test_confirm_priming_begin(hd_simulator: HDSimulator): - """ - Simulates the HD actions during confirm priming and begin (pre-treatment). - - @param hd_simulator: the HDSimulator object - @return: None - """ - - # bypass selecting parameters and their validation (see tst_CreateTreatment) - hd_simulator.cmd_send_start_treatment_response(1, 0) - +def skip_create_treatment(hd_simulator: HDSimulator): rejections = [ RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # requestValid RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # bloodFlowRate @@ -40,6 +30,19 @@ hd_simulator.cmd_send_treatment_parameter_validation_response(rejections) +def test_confirm_priming_begin(hd_simulator: HDSimulator): + """ + Simulates the HD actions during confirm priming and begin (pre-treatment). + + @param hd_simulator: the HDSimulator object + @return: None + """ + + # bypass selecting parameters and their validation (see tst_CreateTreatment) + hd_simulator.cmd_send_start_treatment_response(1, 0) + + skip_create_treatment(hd_simulator) + test.compare(waitForObjectExists(names.o_confirm_treatment_flickable).visible, True, "Found confirm treatment flickable") flick(waitForObject(names.o_confirm_treatment_flickable), 0, 700) @@ -58,19 +61,71 @@ mouseClick(waitForObject(names.o_priming_continue_button)) sleep(0.1) - test.compare(waitForObjectExists(names.o_treatment_begin_start_button).visible, True, "Found start treatment button") + test.compare(waitForObjectExists(names.o_treatment_begin_back_button).visible, True, "Found treatment begin back button") + mouseClick(waitForObject(names.o_treatment_begin_back_button)) + sleep(0.1) + test.compare(waitForObjectExists(names.o_priming_back_button).visible, True, "Found priming back button") + mouseClick(waitForObject(names.o_priming_back_button)) + sleep(0.1) + test.compare(waitForObjectExists(names.o_create_treatment_confirm_back_button).visible, True, "Found create treatment confirm back button") + mouseClick(waitForObject(names.o_create_treatment_confirm_back_button)) + sleep(0.1) + test.compare(waitForObjectExists(names.o_create_treatment_back_button).visible, True, "Found create treatment back button") + mouseClick(waitForObject(names.o_create_treatment_back_button)) + sleep(0.1) + mouseClick(waitForObject(names.o_create_treatment_button)) + skip_create_treatment(hd_simulator) + sleep(0.1) + test.compare(waitForObjectExists(names.o_create_treatment_confirm).visible, True, "Found treatment confirm button") + mouseClick(waitForObject(names.o_create_treatment_confirm)) + sleep(7) + test.compare(waitForObjectExists(names.o_priming_continue_button).visible, True, "Found priming continue button") + mouseClick(waitForObject(names.o_priming_continue_button)) + sleep(0.1) + test_ultrafiltration_slider(hd_simulator) + sleep(0.1) + test.compare(waitForObjectExists(names.o_treatment_begin_start_button).visible, True, "Found treatment start button") mouseClick(waitForObject(names.o_treatment_begin_start_button)) + sleep(2) + +def test_ultrafiltration_slider(hd_simulator: HDSimulator): + """ + Tests the ultrafiltration slider + + @param hd_siulator: The HDSimulator object + @return: None + """ + slider_name = "_ultrafiltration" + slider_object_name = slider_name + "Slider" + test.log("Slider Under Test", slider_object_name) + slider_selected_value_object_name = slider_name + "Value" + slider_object = {"container": names.o_treatment_begin_container, + "objectName": slider_object_name, + "type": "Slider" } - # advance to treatment monitor page - hd_simulator.cmd_send_start_treatment_response(1, 0) + selected_value_object = { + "container": names.o_treatment_begin_container, + "objectName": slider_selected_value_object_name, + "type": "Text" + } + + test.compare(waitForObjectExists(selected_value_object).visible, True) + mouseClick(waitForObject(slider_object), -40, 0, Qt.LeftButton) + sleep(0.01) + test.compare(waitForObjectExists(selected_value_object).text, "{0} {1}".format(0, "mL")) + mouseClick(waitForObject(slider_object), waitForObjectExists(slider_object).width, 0, Qt.LeftButton) + sleep(0.01) + test.compare(waitForObjectExists(selected_value_object).visible, True) + test.compare(waitForObjectExists(selected_value_object).text, "{0} {1}".format(8, "mL")) + def main(): utils.tstStart(__file__) startApplication(names.AUT_NAME + " -q") hd_simulator = HDSimulator() test_confirm_priming_begin(hd_simulator) - + utils.tstDone()