# -*- coding: utf-8 -*- ########################################################################### # # Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. # # 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 test.py # # @author (last) Peter Lucia # @date (last) 22-Feb-2021 # @author (original) Behrouz NematiPour # @date (original) 24-Nov-2020 # ############################################################################ import names from dialin.ui import HDSimulator, utils hd_sim = HDSimulator() def getUnit(): global saline_unit saline_unit = str(waitForObjectExists(names.o_treatmentStart_HeparinSection).unit) def gotoScreenNtest_Contains_TreatmentHeparinData(): mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) test.compare(str(waitForObjectExists(utils.dict_update(names.o_treatmentStart_HeparinSection, "buttonText", "HEPARIN DELIVERY")).buttonText), "HEPARIN DELIVERY") test.compare(str(waitForObjectExists(utils.dict_update(names.o_treatmentStart_HeparinSection, "title", "HEPARIN")).title), "HEPARIN") test.compare( waitForObject(names.o_treatmentStart_HeparinSection).visible , True) def test_values(vDelivered): fDelivered = "{:.1f}".format(vDelivered) iDelivered = "{}".format(int(vDelivered)) value = waitForObjectExists(names.o_treatmentStart_HeparinSection).valueDelivered if value.is_integer(): print(iDelivered) test.compare(str(waitForObjectExists(names.o_treatmentStart_HeparinDelivered ).text), iDelivered) else: test.compare(str(waitForObjectExists(names.o_treatmentStart_HeparinDelivered ).text), fDelivered) def main(): utils.tstStart(__file__) startApplication(names.AUT_NAME) utils.waitForGUI(1) gotoScreenNtest_Contains_TreatmentHeparinData() utils.waitForGUI(1) getUnit() for value in range(0, 101): hd_sim.cmd_set_treatment_heparin_data(value * 0.1) test_values (value * 0.1) hd_sim.cmd_set_treatment_heparin_data(10.0) test_values (10.0) hd_sim.cmd_set_treatment_heparin_data(10.0) test_values (10.0) hd_sim.cmd_set_treatment_heparin_data(0) test_values ( 0) utils.tstDone()