Index: suite_leahi/tst_main_treatment/test.py =================================================================== diff -u -rb0c0d20adce234e6693bc4f376949cf581638b9a -r6c793bf295d7ca93dc19e04a7105faf926086f75 --- suite_leahi/tst_main_treatment/test.py (.../test.py) (revision b0c0d20adce234e6693bc4f376949cf581638b9a) +++ suite_leahi/tst_main_treatment/test.py (.../test.py) (revision 6c793bf295d7ca93dc19e04a7105faf926086f75) @@ -191,9 +191,9 @@ """ @return: N/A """ - test.compare(waitForObjectExists(names.treatmentUltrafiltration).visible, True, "UltraFiltration section is visible") - test.compare(waitForObjectExists(names.UF_Volume_Text).text, "UF Volume", "UF Volume text verified") - test.compare(waitForObjectExists(names.UF_Rate_Text).text, "UF Rate", "UF Rate text verified") + test.compare(utility.get_object_from_names(names.treatmentUltrafiltration).visible, True, "UltraFiltration section is visible") + test.compare(utility.get_object_from_names(names.UF_Volume_Text).text, "UF Volume", "UF Volume text verified") + test.compare(utility.get_object_from_names(names.UF_Rate_Text).text, "UF Rate", "UF Rate text verified") def start_test_treatment_ultrafiltration(uf_volume,uf_rate,vol_delivered): """ @@ -204,9 +204,9 @@ """ td.td_ultrafiltration(uf_volume,uf_rate,vol_delivered,0) - test.compare(waitForObjectExists(names.UF_Volume_LabelValue).bottomText, "{:.2f}".format(float(uf_volume)), "UF Volume value should be :" + str(uf_volume)) - test.compare(waitForObjectExists(names.UF_Rate_LabelValue).bottomText, "{:.2f}".format(float(uf_rate)), "UF Rate value should be :" + str(uf_rate)) - test.compare(waitForObjectExists(names.Volume_Delivered).text, "{:.2f}".format(float(vol_delivered)) +" L", "Volume delivered value should be :" + str(vol_delivered)) + test.compare(utility.get_object_from_names(names.UF_Volume_LabelValue).bottomText, "{:.2f}".format(float(uf_volume)), "UF Volume value should be :" + str(uf_volume)) + test.compare(utility.get_object_from_names(names.UF_Rate_LabelValue).bottomText, "{:.2f}".format(float(uf_rate)), "UF Rate value should be :" + str(uf_rate)) + test.compare(utility.get_object_from_names(names.Volume_Delivered).text, "{:.2f}".format(float(vol_delivered)) +" L", "Volume delivered value should be :" + str(vol_delivered)) #TX time def start_treatment_time_verification(vTotal): @@ -217,8 +217,8 @@ """ for count in range(0,vTotal+1): td.td_treatment_time(vTotal, count, vTotal - count) - test.compare(waitForObjectExists(names.treatment_duration).progressValue, count, "progress value should be {}".format(count)) - test.compare(waitForObjectExists(names.treatment_duration).timeTextValue, vTotal - count, "Expected Time on UI should be in seconds {}".format(vTotal - count)) + test.compare(utility.get_object_from_names(names.treatment_duration).progressValue, count, "progress value should be {}".format(count)) + test.compare(utility.get_object_from_names(names.treatment_duration).timeTextValue, vTotal - count, "Expected Time on UI should be in seconds {}".format(vTotal - count)) def reset_treatment_time_verification(vTotal): """ @@ -228,8 +228,8 @@ """ td.td_treatment_time(vTotal, 0, vTotal) - test.compare(waitForObjectExists(names.treatment_duration).maximum, vTotal, "Reset maximum value and compare it expected value {}".format(vTotal)) - test.compare(waitForObjectExists(names.treatment_duration).minimum, 0, "Reset minimum value and compare it expected value {}".format(0)) + test.compare(utility.get_object_from_names(names.treatment_duration).maximum, vTotal, "Reset maximum value and compare it expected value {}".format(vTotal)) + test.compare(utility.get_object_from_names(names.treatment_duration).minimum, 0, "Reset minimum value and compare it expected value {}".format(0)) def treatment_time_verification(total): test.startSection("Verify the seconds values inside Progress bar and on timer 'Time in seconds'") @@ -248,11 +248,11 @@ ] #Verify the title values in the set points - test.compare(waitForObjectExists(names.Treatment_Parameters_Text).text, "Treatment Parameters", "Treatement Parameters text verified") - test.compare(waitForObjectExists(names.blood_flow_title_Text).text, "Blood Flow", "Blood flow text verified" ) - test.compare(waitForObjectExists(names.dialyste_flow_title_Text).text, "Dialysate Flow", "Dialysate Flow text verified" ) - test.compare(waitForObjectExists(names.dialyste_tmp_title_Text).text, "Dialysate Temp.", "Dialysate trancememberance text verified" ) - test.compare(waitForObjectExists(names.dialyste_cond_title_Text).text, "Dialysate Cond.", "Dialysate cond text verified" ) + test.compare(utility.get_object_from_names(names.Treatment_Parameters_Text).text, "Treatment Parameters", "Treatement Parameters text verified") + test.compare(utility.get_object_from_names(names.blood_flow_title_Text).text, "Blood Flow", "Blood flow text verified" ) + test.compare(utility.get_object_from_names(names.dialyste_flow_title_Text).text, "Dialysate Flow", "Dialysate Flow text verified" ) + test.compare(utility.get_object_from_names(names.dialyste_tmp_title_Text).text, "Dialysate Temp.", "Dialysate trancememberance text verified" ) + test.compare(utility.get_object_from_names(names.dialyste_cond_title_Text).text, "Dialysate Cond.", "Dialysate cond text verified" ) for index in range(0, len(TREATMENT_PARAMETER_SETPOINTS_TD_TEST_VALUES), 1): test.startSection("Checking the value of the set points".format(index)) @@ -266,15 +266,15 @@ dialysate_flow = target_dial_flow, dialysate_temp = target_dial_tmp) - bloodFlow = waitForObject(names.blood_flow_value) + bloodFlow = utility.get_object_from_names(names.blood_flow_value) bloodFlow_properties = object.properties(bloodFlow) test.compare(str(bloodFlow_properties["value"]), str(target_blood_flow), "Blood Flow value should be :" + str(target_blood_flow)) - dialFlow = waitForObject(names.dial_flow_value) + dialFlow = utility.get_object_from_names(names.dial_flow_value) dialFlow_properties = object.properties(dialFlow) test.compare(str(dialFlow_properties["value"]), str(target_dial_flow), "Dialyste flow value should be :" + str(target_dial_flow)) - dialTmp = waitForObject(names.dial_tmp_value) + dialTmp = utility.get_object_from_names(names.dial_tmp_value) dialTmp_properties = object.properties(dialTmp) test.compare(str(dialTmp_properties["value"]), str(target_dial_tmp), "Dialyste Tmp value should be :" + str(target_dial_tmp)) @@ -284,14 +284,14 @@ D43 = 0, D74 = 0) - dialCond = waitForObject(names.dial_cond_value) + dialCond = utility.get_object_from_names(names.dial_cond_value) dialCond_properties = object.properties(dialCond) test.compare(str(dialCond_properties["value"]), str(target_dial_cond), "Dialyste conductivity value should be :" + str(target_dial_cond)) def main(): utils.tstStart(__file__) - startApplication("leahi") + startApplication(names.AUT_NAME + " -q") td.td_operation_mode(TDOpModes.MODE_STAN.value,0) @@ -314,6 +314,7 @@ test.verify(waitForObjectExists(names.mainTreatmentScreen), "In Main Treatment") # Pressure State + test.startSection("Verifying Pressure values on main treatment screen") test_pressure_displayed_in_treatment_screen_range_bar() td.td_pressure(H2_arterial_pressure = 0, H14_venous_pressure = 0 , @@ -329,6 +330,7 @@ tmp_max = TMP_HIGH_VAL_210) verify_arterial_and_venous_value_in_main_treatment_screen(ACCEPTED,ART_LOW_VAL_MINUS_390,ART_HIGH_VAL_220,VENOUS_LOW_VAL_MINUS_90,VENOUS_HIGH_VAL_410,TMP_LOW_VAL_MINUS_640,TMP_HIGH_VAL_210) + test.endSection() #UltraFiltration state test.startSection("Verifying Ultrafiltration values on main treatment screen") @@ -343,7 +345,7 @@ for value in total_time_list: treatment_time_verification(value) #Check the treatment complete text message - test.compare(waitForObjectExists(names.treatmentTimeNotificationBarSmall).text, "Treatment Complete", "Tx time completed text should be :" + str("Treatment Complete")) + test.compare(utility.get_object_from_names(names.treatmentTimeNotificationBarSmall).text, "Treatment Complete", "Tx time completed text should be :" + str("Treatment Complete")) td.td_treatment_time( tx_duration_s = 51 , tx_elapsed_s = 5 , tx_remaining_s = 6 ) @@ -357,12 +359,12 @@ 0 , 0 , 0 ) - test.compare(waitForObjectExists(names.treatmentTimeNotificationBarSmall).text, "Treatment Paused", "Tx time paused text should be :" + str("Treatment Paused")) + test.compare(utility.get_object_from_names(names.treatmentTimeNotificationBarSmall).text, "Treatment Paused", "Tx time paused text should be :" + str("Treatment Paused")) test.endSection() #TX Parameter Set Points test.startSection("Verifying blood flow, dialysate temp,dialysate flow and dialyste cond on main treatment screen") verify_setPoints_from_main_treatement() utils.tstDone() - + test.endSection()