# -*- coding: utf-8 -*- ## # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # copyright # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # file tst_Treatment_Adjustment_Saline # date 2020/08/10 # author Behrouz NematiPour # import names if names.DIALIN_LINK: from dialin.squish import utils, denaliMessages else: import utils import denaliMessages def gotoScreenNtest_Contains_TreatmentSalineBolusData(): mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "START BOLUS") test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).title ), "SALINE BOLUS") test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).visible , True) def test_state(vAccept, vText): mReason = 0 if (not vAccept): mReason = 16 mouseClick(waitForObject(names.o_treatmentStart_SalineStart)) denaliMessages.setSalineBolusResponse(vAccept, mReason, 50) test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "{} BOLUS".format(vText)) def test_Ultrafiltration(): pass def main(): utils.tstStart(__file__) startApplication(names.AUT_NAME) utils.waitForGUI(1) #initially is stopped (Text => START) gotoScreenNtest_Contains_TreatmentSalineBolusData() utils.waitForGUI(1) # Init stopped, stopped =(accepted)=> running (Text => STOP ) test_state(True , "STOP" ) # Now running, running =(rejected)== running (Text == STOP ) test_state(False, "STOP" ) # Still running, running =(accepted)=> stopped (Text == START) test_state(True , "START") # Now stopped, stopped =(rejected)== stopped (Text == START) test_state(False, "START") # Now stopped, stopped =(accepted)=> running (Text == STOP ) test_state(True , "STOP" ) # Still running, running =(accepted)=> stopped (Text == START) test_state(True, "START") utils.tstDone()