Index: suite_leahi/tst_ultrafiltration/test.py =================================================================== diff -u -r6d83d7cbea9b040ee4717d7b90fdc44bf618bdcf -r1b0dfcc0a4907f1aad84794e1d1fc60ea9649e40 --- suite_leahi/tst_ultrafiltration/test.py (.../test.py) (revision 6d83d7cbea9b040ee4717d7b90fdc44bf618bdcf) +++ suite_leahi/tst_ultrafiltration/test.py (.../test.py) (revision 1b0dfcc0a4907f1aad84794e1d1fc60ea9649e40) @@ -12,8 +12,10 @@ # 7 Check the New UF Volume and New UF rate values in Confirm Ultrafiltration popup # 8 Check the back button functionality in the popup screen # 9 Check the rejection reason message in the popup screen +#10 Comparison of Ultrafiltration Paused State and Ultrafiltration Complete State texts + import names from configuration import utility @@ -29,29 +31,8 @@ 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) @@ -92,8 +73,51 @@ test.compare(waitForObjectExists(names.o_uf_Rate_LabelValue).bottomText, "{:.2f}".format(float(uf_rate)), "UF Rate value should be :" + str(uf_rate)) test.compare(waitForObjectExists(names.o_volume_Delivered).text, "{:.2f}".format(float(volume_delivered)) +" L", "Volume delivered value should be :" + str(volume_delivered)) - +def ultrfiltration_paused_completed_state(): + """ + Comparison of Ultrafiltration Paused State and Ultrafiltration Complete State texts + """ + mouseClick(waitForObject(names.o_editButton_ultrafiltration_IconButton, 2000)) + mouseClick(waitForObject(names.o_ultrafiltration_pauseResumeButton_TouchRect, 2000)) + td.td_ultrafiltration(10, 0.53, 0.37, 1) + notification_row_object = waitForObjectExists(names.o_PopupItem, 3000) + ultrafiltration_paused_state = utility.findChildByText( + notification_row_object, config.ULTRAFILTRATION_PAUSED_STATE + ) + test.compare( + ultrafiltration_paused_state.text, + config.ULTRAFILTRATION_PAUSED_STATE, + "Comparison Ultrafiltration Paused State text in Ultrafiltration popup", + ) + mouseClick(waitForObject(names.o_Popup_CloseButton, 3000)) + + ultrafiltration_status_object = waitForObjectExists( + names.o_treatmentHome_ultrafiltration_status, 3000 + ) + ultrafiltration_paused_state = utility.findChildByText( + ultrafiltration_status_object, config.ULTRAFILTRATION_PAUSED_STATE + ) + test.compare( + ultrafiltration_paused_state.text, + config.ULTRAFILTRATION_PAUSED_STATE, + "Comparison Ultrafiltration Paused State text in Main Treatment Screen", + ) + + td.td_ultrafiltration(10, 0.53, 10, 0) + ultrafiltration_status_object = waitForObjectExists( + names.o_treatmentHome_ultrafiltration_status, 3000 + ) + ultrafiltration_complete_state = utility.findChildByText( + ultrafiltration_status_object, config.ULTRAFILTRATION_COMPLETE_STATE + ) + test.compare( + ultrafiltration_complete_state.text, + config.ULTRAFILTRATION_COMPLETE_STATE, + "Comparison Ultrafiltration Complete State text in Main Treatment Screen", + ) + + def main(): utils.tstStart(__file__) @@ -106,7 +130,6 @@ # 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 +149,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,12 +197,10 @@ 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 - test.compare(new_uf_volume_value, "0.04","Text Value should be ->" +str("0.04")) + new_uf_volume_text = waitForObjectExists(names.o_left_LabelUnitText).label + test.compare(new_uf_volume_text,config.UF_VOLUME_REMOVED ,"Text Value should be ->" +str(config.NEW_UF_VOLUME)) + new_uf_rate_text = waitForObjectExists(names.o_right_LabelUnitText).label + test.compare(new_uf_rate_text,config.UF_VOLUME_GOAL ,"Text Value should be ->" +str(config.NEW_UF_RATE)) #click on the continue button mouseClick(waitForObject(names.o_confirmButton_TouchRect)) @@ -197,6 +218,13 @@ REJECT_TEXT = repo.get("1", "Title") test.compare(reject_text,"[1] "+REJECT_TEXT ,"Text should be ->" +str(REJECT_TEXT)) test.endSection() + + test.startSection( + "Comparison of Ultrafiltration Paused State and Ultrafiltration Complete State texts" + ) + ultrfiltration_paused_completed_state() + test.endSection() + utils.tstDone()