# -*- 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_main_treatment_vitals # date 2022/feb/11 # author Papiya Mandal import names from configuration.config import * from configuration.utility import * from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator hd = HDSimulator() SYSTOLIC_PRESSSURE_120 = "120" SYSTOLIC_PRESSSURE_249 = "249" SYSTOLIC_PRESSSURE_60 = "60" SYSTOLIC_PRESSSURE_200 = "200" SYSTOLIC_PRESSSURE_175 = "175" SYSTOLIC_PRESSSURE_80 = "80" DIASTOLIC_PRESSSURE_50 = "50" DIASTOLIC_PRESSSURE_249 = "249" DIASTOLIC_PRESSSURE_60 = "60" DIASTOLIC_PRESSSURE_200 = "200" DIASTOLIC_PRESSSURE_175 = "175" DIASTOLIC_PRESSSURE_80 = "80" DIASTOLIC_TEXT = "diastolic" SYSTOLIC_TEXT = "systolic" SYSTOLIC_LOWER_LIMIT = 60 SYSTOLIC_UPPER_LIMIT = 250 def open_vitals_pop_up(): """ Method to open the vitals pop up and verify 'Vitals' pop is opened """ test.startSection("Opening 'Vitals' pop up") vitals_touch_area = object.parent(waitForObject(names.o_vitals_title)) mouseClick(vitals_touch_area) test.log("Verifying the 'Vitals' pop up is displayed") if object.exists(names.o_vitals_confrim_btn): vitals_pop_up_title = waitForObject(names.o_vitals_pop_up_title) vitals_pop_up_title = vitals_pop_up_title.text.toUtf8().constData() test.compare(vitals_pop_up_title, VITALS_TITLE,"Vitals pop screen is displayed") test.endSection() # def verify_color_of_entry(entry, vital_parameter): # # if def verify_systolic_value_in_pop_up(value): """ method to verify the entered systolic value @param value: user entered systolic value """ test.startSection("Verify the user entered systolic value") systolic = waitForObject(names.o_pop_up_systolic_input_field) systolic_value = systolic.text.toUtf8().constData() test.compare(systolic_value, value, "Expected Systolic value: {value} ".format(value=value) + "should be equal to Actual Systolic value: " + "{actual_value}".format(actual_value=systolic_value)) test.endSection() def verify_blood_pressure_range(systolic=None, in_range=None): if in_range: if systolic is True: systolic = waitForObject(names.o_pop_up_systolic_input_field) mouseClick(systolic) for value in range(SYSTOLIC_LOWER_LIMIT, SYSTOLIC_UPPER_LIMIT): enter_keypad_value(entry=str(value), input_field=systolic) verify_systolic_value_in_pop_up(value=value) erase_entered_value(input_field=systolic) def main(): utils.tstStart(__file__) start_application(AUT_NAME) hd.cmd_send_power_on_self_test_version_request() hd.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0, rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, treatment_end_state=0, treatment_stop_state= 0) utils.waitForGUI(delay_s=3) open_vitals_pop_up() test.log("Done") verify_blood_pressure_range(systolic=True, in_range=True) current_date_time = get_current_date_and_time() test.log(current_date_time)