# -*- 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_TreatmentHeparinData # date 2020/11/23 # author Behrouz NematiPour # import names from dialin.ui import HDSimulator, utils HDSimulator = 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(names.o_treatmentStart_HeparinSection).buttonText), "HEPARIN DELIVERY") test.compare(str(waitForObjectExists(names.o_treatmentStart_HeparinSection).title ), "HEPARIN") test.compare( waitForObjectExists(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): HDSimulator.cmd_set_treatment_heparin_data(value * 0.1) test_values (value * 0.1) HDSimulator.cmd_set_treatment_heparin_data(10.0) test_values (10.0) HDSimulator.cmd_set_treatment_heparin_data(10.0) test_values (10.0) HDSimulator.cmd_set_treatment_heparin_data(0) test_values ( 0) utils.tstDone()