Index: tst_ConfirmPrimingBegin/test.py =================================================================== diff -u -rf29743f1a3b34472a3df5eaa4f8861fbc425f9ee -r310f51a5ed4921f184572f90d07b350ec41c0bae --- tst_ConfirmPrimingBegin/test.py (.../test.py) (revision f29743f1a3b34472a3df5eaa4f8861fbc425f9ee) +++ tst_ConfirmPrimingBegin/test.py (.../test.py) (revision 310f51a5ed4921f184572f90d07b350ec41c0bae) @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*-" import names -from dialin.squish import utils +from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from dialin.common.msg_defs import RequestRejectReasons +from dialin.ui.utils import waitForGUI def skip_create_treatment(hd_simulator: HDSimulator): """ @@ -29,57 +30,51 @@ skip_create_treatment(hd_simulator) - test.compare(waitForObjectExists(names.o_confirm_treatment_flickable).visible, True, "Found confirm treatment flickable") + test.compare(waitForObject(names.o_confirm_treatment_flickable).visible, True, "Found confirm treatment flickable") - utils.waitForGUI(1) # object not ready flick(waitForObject(names.o_confirm_treatment_flickable), 0, 700) mouseClick(waitForObject(names.o_create_treatment_confirm)) # wait for priming simulation to complete - utils.waitForGUI(7) + waitForGUI(7) # advance to start the treatment - test.compare(waitForObject(names.o_priming_flickable).visible, True, "Found priming flickable") - flick(waitForObject(names.o_priming_flickable), 0, 123) test.compare(waitForObject(names.o_priming_continue_button).visible, True, "Found priming continue button") mouseClick(waitForObject(names.o_priming_continue_button)) - utils.waitForGUI(0.5) # object not ready - test.compare(waitForObjectExists(names.o_treatment_begin_back_button).visible, True, "Found treatment begin back button") mouseClick(waitForObject(names.o_treatment_begin_back_button)) - utils.waitForGUI(0.5) # object not ready test.compare(waitForObject(names.o_priming_back_button).visible, True, "Found priming back button") - mouseClick(waitForObject(names.o_priming_back_button)) - utils.waitForGUI(0.5) # object not ready test.compare(waitForObject(names.o_create_treatment_confirm_back_button).visible, True, "Found create treatment confirm back button") - - mouseClick(waitForObject(names.o_create_treatment_confirm_back_button)) - utils.waitForGUI(0.5) + mouseClick(waitForObject(names.o_create_treatment_confirm_back_button)) test.compare(waitForObject(names.o_create_treatment_back_button).visible, True, "Found create treatment back button") - mouseClick(waitForObject(names.o_create_treatment_back_button)) - utils.waitForGUI(0.5) + waitForGUI(0.1) mouseClick(waitForObject(names.o_create_treatment_button)) - utils.waitForGUI(0.5) + waitForGUI(0.1) skip_create_treatment(hd_simulator) - utils.waitForGUI(1) - test.compare(waitForObjectExists(names.o_create_treatment_confirm).visible, True, "Found treatment confirm button") + test.compare(waitForObject(names.o_create_treatment_confirm).visible, True, "Found treatment confirm button") mouseClick(waitForObject(names.o_create_treatment_confirm)) # wait for priming simulation to complete - utils.waitForGUI(7) + waitForGUI(7) test.compare(waitForObject(names.o_priming_continue_button).visible, True, "Found priming continue button") mouseClick(waitForObject(names.o_priming_continue_button)) test_ultrafiltration_slider(hd_simulator) + + # Wait for the BLE alert + mouseClick(waitForObject(names.o_treatment_begin_start_button)) + test.compare(waitForObject(names.o_alert).visible, True, "Found alert") + mouseClick(waitForObject(names.o_alert_confirm)) + test.compare(waitForObject(names.o_treatment_begin_start_button).visible, True, "Found treatment start button") mouseClick(waitForObject(names.o_treatment_begin_start_button)) - utils.waitForGUI(0.1) + waitForGUI(0.2) mouseClick(waitForObject(names.o_treatmentStart_back)) mouseClick(waitForObject(names.o_mainMenu_settings)) mouseClick(waitForObject(names.o_settings_end_treatment)) - utils.waitForGUI(3) + waitForGUI(3) def test_ultrafiltration_slider(hd_simulator: HDSimulator): """ @@ -88,9 +83,9 @@ @param hd_siulator: The HDSimulator object @return: None """ - slider_name = "_ultrafiltration" + slider_name = "_treatmentBeginUltrafiltration" slider_object_name = slider_name + "Slider" - # test.log("Slider Under Test", slider_object_name) + 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, @@ -102,15 +97,15 @@ "type": "Text" } - test.compare(waitForObjectExists(selected_value_object).visible, True) + test.compare(waitForObject(selected_value_object).visible, True) mouseClick(waitForObject(slider_object), 0, 0, Qt.LeftButton) - test.compare(waitForObject(selected_value_object).text, "{0} {1}".format(0, "mL")) + test.compare(waitForObject(selected_value_object).text, "0.000") mouseClick(waitForObject(slider_object), waitForObject(slider_object).width, 0, Qt.LeftButton) test.compare(waitForObject(selected_value_object).visible, True) - test.compare(waitForObject(selected_value_object).text, "{0} {1}".format(8, "mL")) + test.compare(waitForObject(selected_value_object).text, "8.000") def main(): utils.tstStart(__file__)