Index: suite_leahi/tst_ultrafiltration/test.py =================================================================== diff -u -r6d83d7cbea9b040ee4717d7b90fdc44bf618bdcf -r4f9e56b35635368ce440e2cfffdaba7631b5d120 --- suite_leahi/tst_ultrafiltration/test.py (.../test.py) (revision 6d83d7cbea9b040ee4717d7b90fdc44bf618bdcf) +++ suite_leahi/tst_ultrafiltration/test.py (.../test.py) (revision 4f9e56b35635368ce440e2cfffdaba7631b5d120) @@ -29,29 +29,7 @@ td =TD_Messaging() -MAX_UF_VOLUME = 10.00 -MAX_UF_RATE = 10.00 -MAX_VOLUME_DELIVERED = 8.00 -MIN_UF_VOLUME = 0.35 -MIN_UF_RATE = 0.22 -MIN_VOLUME_DELIVERED = 0.09 - -MID_UF_VOLUME = 5.00 -MID_UF_RATE = 5.00 -MID_VOLUME_DELIVERED = 4.00 - -ULTRAFILTRATION_VOLUME = "Ultrafiltration Volume (L)" -UF_VOLUME_REMOVED = "UF Volume Removed" -UF_VOLUME_GOAL = "UF Volume Goal" -NEW_UF_VOLUME = "New UF Volume" -NEW_UF_RATE = "New UF Rate" - - - -MAX_NEW_UF_VOLUME = 8.0 -MAX_NEW_UF_RATE = 2.0 - def continue_edit_changes(accept,rejectionReason): payload = conversions.integer_to_bytearray(accept) payload += conversions.integer_to_bytearray(rejectionReason) @@ -100,13 +78,12 @@ conf_path = "/home/denali/Public/luis/config/configurations/Alarms/Rejections.conf" repo = ScopedRejectionRepository(path=conf_path) - startApplication(config.AUT_NAME) + startApplication(utility.aut("-q")) td.td_operation_mode(TDOpModes.MODE_STAN.value) # verify Standby screen test.verify(waitForObjectExists(names.o_standByScreen_MainHome), "In Standby") - td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0) td.td_operation_mode(TDOpModes.MODE_TREA.value, 0) td.td_tx_state(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value , 0 , @@ -126,37 +103,37 @@ max_dial_rate_mLH = 0) test.startSection("Check the maximum values in Ultrafiltration") - check_values_ultrfiltration_main_treatment(uf_volume = MAX_UF_VOLUME, - uf_rate = MAX_UF_RATE, - volume_delivered = MAX_VOLUME_DELIVERED) + check_values_ultrfiltration_main_treatment(uf_volume = config.MAX_UF_VOLUME, + uf_rate = config.MAX_UF_RATE, + volume_delivered = config.MAX_VOLUME_DELIVERED) test.endSection() test.startSection("Check the mid values in Ultrafiltration") - check_values_ultrfiltration_main_treatment(uf_volume = MID_UF_VOLUME, - uf_rate = MID_UF_RATE, - volume_delivered = MID_VOLUME_DELIVERED) + check_values_ultrfiltration_main_treatment(uf_volume = config.MID_UF_VOLUME, + uf_rate = config.MID_UF_RATE, + volume_delivered = config.MID_VOLUME_DELIVERED) test.endSection() test.startSection("Check the minimum values in Ultrafiltration") - check_values_ultrfiltration_main_treatment(uf_volume = MIN_UF_VOLUME, - uf_rate = MIN_UF_RATE, - volume_delivered = MIN_VOLUME_DELIVERED) + check_values_ultrfiltration_main_treatment(uf_volume = config.MIN_UF_VOLUME, + uf_rate = config.MIN_UF_RATE, + volume_delivered = config.MIN_VOLUME_DELIVERED) test.endSection() test.startSection("Check the values in the Ultrafiltration Volume Popup") mouseClick(waitForObject(names.o_editButton_ultrafiltration_IconButton)) #check the title in edit popup - title = waitForObjectExists(utility.setObjectText(obj=names.o_title_Text,text = ULTRAFILTRATION_VOLUME)) - test.compare(title.text, ULTRAFILTRATION_VOLUME, "Title text should be -> "+ str(ULTRAFILTRATION_VOLUME)) + title = waitForObjectExists(utility.setObjectText(obj=names.o_title_Text,text = config.ULTRAFILTRATION_VOLUME)) + test.compare(title.text, config.ULTRAFILTRATION_VOLUME, "Title text should be -> "+ str(config.ULTRAFILTRATION_VOLUME)) #check the value in the edit popup - uf_volume_removed_text = waitForObjectExists(names.o_ufVolumeRemovedItem_ValueItem).label - test.compare(uf_volume_removed_text,UF_VOLUME_REMOVED ,"Text Value should be ->" +str(UF_VOLUME_REMOVED)) - uf_volume_removed_value = waitForObjectExists(names.o_ufVolumeRemovedItem_ValueItem).value - test.compare(str(uf_volume_removed_value), str(MIN_VOLUME_DELIVERED), "UF Volume Removed value should be ->"+str(uf_volume_removed_value)) - uf_volume_goal_text =waitForObjectExists(names.o_ufVolumeGoalItem_ValueItem).label - test.compare(uf_volume_goal_text,UF_VOLUME_GOAL ,"Text Value should be ->" +str(UF_VOLUME_GOAL)) - uf_volume_goal_value = waitForObjectExists(names.o_ufVolumeGoalItem_ValueItem).value - test.compare(str(uf_volume_goal_value), str(MIN_UF_VOLUME), "UF Volume Removed value should be ->"+str(uf_volume_goal_value)) + uf_volume_removed_text = waitForObjectExists(names.o_left_LabelUnitText).label + test.compare(uf_volume_removed_text,config.UF_VOLUME_REMOVED ,"Text Value should be ->" +str(config.UF_VOLUME_REMOVED)) + uf_volume_removed_value = waitForObjectExists(names.o_left_LabelUnitText).value + test.compare(str(uf_volume_removed_value), str(config.MIN_VOLUME_DELIVERED), "UF Volume Removed value should be ->"+str(uf_volume_removed_value)) + uf_volume_goal_text =waitForObjectExists(names.o_right_LabelUnitText).label + test.compare(uf_volume_goal_text,config.UF_VOLUME_GOAL ,"Text Value should be ->" +str(config.UF_VOLUME_GOAL)) + uf_volume_goal_value = waitForObjectExists(names.o_right_LabelUnitText).value + test.compare(str(uf_volume_goal_value), str(config.MIN_UF_VOLUME), "UF Volume Removed value should be ->"+str(uf_volume_goal_value)) test.endSection() test.startSection("Check the values in the Confirm Ultrafiltration Volume Popup ") @@ -174,11 +151,12 @@ confirm_ultrafiltrationtitle = waitForObjectExists(utility.setObjectText(text="Confirm Ultrafiltration Volume (L)",obj = names.o_title_Text)) test.compare(confirm_ultrafiltrationtitle.text, "Confirm Ultrafiltration Volume (L)", "Title text should be -> "+ str("Confirm Ultrafiltration Volume (L)")) - new_uf_volume_text = waitForObjectExists(names.o_newVolumeContainer_ValueContainer).text - test.compare(new_uf_volume_text,NEW_UF_VOLUME ,"Text Value should be ->" +str(NEW_UF_VOLUME)) - new_uf_rate_text = waitForObjectExists(names.o_newRateContainer_ValueContainer).text - test.compare(new_uf_rate_text,NEW_UF_RATE ,"Text Value should be ->" +str(NEW_UF_RATE)) - new_uf_volume_value = waitForObjectExists(names.o_newRateContainer_ValueContainer).value + new_uf_volume = waitForObject(names.o_newValues_TreatmentAdjustmentUltrafiltrationMetrics) + new_uf_volume_text = utility.findObjectById(new_uf_volume, "_left").label + test.compare(new_uf_volume_text,config.NEW_UF_VOLUME ,"Text Value should be ->" +str(config.NEW_UF_VOLUME)) + new_uf_rate_text = utility.findObjectById(new_uf_volume, "_right").label + test.compare(new_uf_rate_text,config.NEW_UF_RATE ,"Text Value should be ->" +str(config.NEW_UF_RATE)) + new_uf_volume_value = utility.findObjectById(new_uf_volume, "_right").value test.compare(new_uf_volume_value, "0.04","Text Value should be ->" +str("0.04")) #click on the continue button