Index: tst_ConfirmPrimingBegin/test.py =================================================================== diff -u -rc15701755e407fff174072b9a5de3aee4e598b2f -raf2448c2d4c24abb78ad01f890dbbe6a23b72aef --- tst_ConfirmPrimingBegin/test.py (.../test.py) (revision c15701755e407fff174072b9a5de3aee4e598b2f) +++ tst_ConfirmPrimingBegin/test.py (.../test.py) (revision af2448c2d4c24abb78ad01f890dbbe6a23b72aef) @@ -4,7 +4,7 @@ from dialin.squish import utils from dialin.ui.hd_simulator import HDSimulator from dialin.common.msg_defs import RequestRejectReasons -from time import sleep +from dialin.squish.utils import waitForGUI def skip_create_treatment(hd_simulator: HDSimulator): """ @@ -30,54 +30,47 @@ 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") flick(waitForObject(names.o_confirm_treatment_flickable), 0, 700) - mouseClick(waitForObject(names.o_create_treatment_confirm)) # wait for priming simulation to complete - sleep(7) + waitForGUI(7) # advance to start the treatment - test.compare(waitForObjectExists(names.o_priming_flickable).visible, True, "Found priming flickable") + test.compare(waitForObject(names.o_priming_flickable).visible, True, "Found priming flickable") flick(waitForObject(names.o_priming_flickable), 0, 123) - test.compare(waitForObjectExists(names.o_priming_continue_button).visible, True, "Found priming continue button") + test.compare(waitForObject(names.o_priming_continue_button).visible, True, "Found priming continue button") mouseClick(waitForObject(names.o_priming_continue_button)) - sleep(0.1) - test.compare(waitForObjectExists(names.o_treatment_begin_back_button).visible, True, "Found treatment begin back button") + test.compare(waitForObject(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") + test.compare(waitForObject(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") + 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)) - sleep(0.1) - test.compare(waitForObjectExists(names.o_create_treatment_back_button).visible, True, "Found create treatment 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)) - sleep(0.1) + waitForGUI(0.1) mouseClick(waitForObject(names.o_create_treatment_button)) + waitForGUI(0.1) skip_create_treatment(hd_simulator) - sleep(0.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)) - sleep(7) - test.compare(waitForObjectExists(names.o_priming_continue_button).visible, True, "Found priming continue button") + # wait for priming simulation to complete + waitForGUI(7) + test.compare(waitForObject(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") + test.compare(waitForObject(names.o_treatment_begin_start_button).visible, True, "Found treatment start button") mouseClick(waitForObject(names.o_treatment_begin_start_button)) - sleep(2) + waitForGUI(0.1) mouseClick(waitForObject(names.o_treatmentStart_back)) - mouseClick(waitForObjectExists(names.o_mainMenu_settings)) + mouseClick(waitForObject(names.o_mainMenu_settings)) mouseClick(waitForObject(names.o_settings_end_treatment)) - sleep(3) def test_ultrafiltration_slider(hd_simulator: HDSimulator): """ @@ -100,12 +93,12 @@ "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")) - mouseClick(waitForObject(slider_object), waitForObjectExists(slider_object).width, 0, Qt.LeftButton) + 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"))