Index: .gitignore =================================================================== diff -u -r407243a222323f55d17687e72b50ec9769c03c69 -rd98c5ca0c23aec102058af19bc136d37685177ab --- .gitignore (.../.gitignore) (revision 407243a222323f55d17687e72b50ec9769c03c69) +++ .gitignore (.../.gitignore) (revision d98c5ca0c23aec102058af19bc136d37685177ab) @@ -8,3 +8,4 @@ venv* .idea/ shared/scripts/squishapi +*.log Index: shared/scripts/names.py =================================================================== diff -u -re14947f2a75df6341b987b3aa4a3c97a9c6eef9b -rd98c5ca0c23aec102058af19bc136d37685177ab --- shared/scripts/names.py (.../names.py) (revision e14947f2a75df6341b987b3aa4a3c97a9c6eef9b) +++ shared/scripts/names.py (.../names.py) (revision d98c5ca0c23aec102058af19bc136d37685177ab) @@ -369,14 +369,20 @@ o_create_treatment_dialyzer_3 = {"container": o_create_treatment_container, "objectName": "_dialyzerTypeRect3", "type": "TouchRect"} o_create_treatment_continue = {"container": o_create_treatment_container, "objectName": "_continueButton", "type": "TouchRect"} o_create_treatment_rinseback = {"container": o_create_treatment_container, "objectName": "_rinsebackFlowRate", "type": "SliderCreateTreatment"} +o_create_treatment_back_button = {"container": o_create_treatment_container, "objectName": "_backButton", "type": "BackButton"} o_create_treatment_confirm_container = {"container": o_qquickview_alarm, "objectName": "TreatmentConfirm", "type": "TreatmentConfirm" } o_create_treatment_confirm = {"container": o_create_treatment_confirm_container, "objectName": "_continueRect", "type": "TouchRect"} +o_create_treatment_confirm_back_button = {"container": o_create_treatment_confirm_container, "objectName": "_backButton", "type": "BackButton"} # Confirm + Priming + Begin Treatment o_confirm_treatment_flickable = {"container": o_create_treatment_confirm_container, "objectName": "_confirmTreatmentFlickable", "type": "Flickable"} o_priming_container = {"container": o_qquickview_alarm, "objectName": "_treatmentPrime", "type": "TreatmentPrime"} +o_priming_back_button = {"container": o_priming_container, "objectName": "_backButton", "type": "BackButton"} o_priming_flickable = {"container": o_priming_container, "objectName": "_treatmentPrimeFlickable", "type": "Flickable"} o_priming_continue_button = {"container": o_priming_container, "objectName": "_treatmentPrimeContinueButton", "type": "TouchRect"} o_treatment_begin_container = {"container": o_qquickview_alarm, "objectName": "_treatmentBegin", "type": "TreatmentBegin"} +o_treatment_begin_flickable = {"container": o_treatment_begin_container, "objectName": "_treatmentBeginFlickable", "type": "TreatmentBegin"} o_treatment_begin_start_button = {"container": o_treatment_begin_container, "objectName": "_treatmentBeginStart", "type": "TouchRect"} +o_treatment_begin_back_button = {"container": o_treatment_begin_container, "objectName": "_backButton", "type": "BackButton"} + Index: tst_ConfirmPrimingBegin/config.xml =================================================================== diff -u --- tst_ConfirmPrimingBegin/config.xml (revision 0) +++ tst_ConfirmPrimingBegin/config.xml (revision d98c5ca0c23aec102058af19bc136d37685177ab) @@ -0,0 +1,10 @@ + + + + + + +ConfirmPrimingBegin + + + 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() Index: tst_CreateTreatment/test.py =================================================================== diff -u -rac88b33834b21228e3dd2764b5fa6ff13cbababe -rd98c5ca0c23aec102058af19bc136d37685177ab --- tst_CreateTreatment/test.py (.../test.py) (revision ac88b33834b21228e3dd2764b5fa6ff13cbababe) +++ tst_CreateTreatment/test.py (.../test.py) (revision d98c5ca0c23aec102058af19bc136d37685177ab) @@ -3,7 +3,6 @@ import names from dialin.squish import utils -from dialin.ui.hd_simulator import HDSimulator from dialin.common.msg_defs import RequestRejectReasons from dialin import HDSimulator from time import sleep @@ -173,8 +172,14 @@ 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(slider_info["max"], slider_info["units"])) + if "LimitsLow" in slider_name: + mouseClick(waitForObject(slider_object), -40, 0, Qt.LeftButton) + sleep(0.01) + test.compare(waitForObjectExists(selected_value_object).visible, True) + test.compare(waitForObjectExists(selected_value_object).text, "{0} {1}".format(slider_info["min"], slider_info["units"])) + else: + test.compare(waitForObjectExists(selected_value_object).visible, True) + test.compare(waitForObjectExists(selected_value_object).text, "{0} {1}".format(slider_info["max"], slider_info["units"])) def check_button_group(buttons, slider_ranges_key): @@ -225,11 +230,12 @@ check_button_group(dialyzer_options, "dialyzerTypeOptions") -def test_continue_failure(): +def test_continue_failure(hd_simulator: HDSimulator): """ Tests that continue is disabled by default Simulates a FW response that all parameters are invalid prior to selection. + @param hd_simulator: the HDSimulator object @return: None """ flick(waitForObject(names.o_create_treatment_flickable), 0, 2000) @@ -241,7 +247,6 @@ test.compare(waitForObject(names.o_create_treatment_rinseback).visible, True) # simulate FW response that all parameters are invalid - hd_simulator = HDSimulator() reject_reasons = [ RequestRejectReasons.REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE @@ -256,42 +261,12 @@ Tests that selecting the continue button moves to the treatment confirm page Assumes all treatment parameters have already been selected + @param hd_simulator: the HDSimulator object @return: None """ - flick(waitForObject(names.o_create_treatment_flickable), 0, 700) - mouseClick(waitForObject(names.o_create_treatment_continue)) - - sleep(0.05) - - # simulate FW response that all parameters are valid - reject_reasons = [ - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # overall response - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # blood flow - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # dialysate flow - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # duration - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # heparin dispensing rate - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # heparin bolus volume - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # heparin stop time - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # saline bolus - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # acid concentrate - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # bicarbonate concentrate - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # dialyzer type - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # dialysate temperature - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # arterial pressure limit low - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # arterial pressure limit high - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # venous pressure limit low - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # venous pressure limit high - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # blood pressure measurement interval - RequestRejectReasons.REQUEST_REJECT_REASON_NONE, # rinseback flow rate - - ] - - hd_simulator.cmd_send_treatment_parameter_validation_response(reject_reasons) - - sleep(0.01) - + sleep(1) test.compare(waitForObjectExists(names.o_create_treatment_confirm).visible, True) def main(): @@ -301,7 +276,7 @@ sleep(1) test_load_create_treatment() sleep(1) - test_continue_failure() + test_continue_failure(hd_simulator) sleep(1) test_parameters_exist()