Index: shared/scripts/configuration/config.py =================================================================== diff -u -r09949a5215418ec122b15e757558232158b707f5 -r2aff4bbf5a1749195064cfc9b8acc9f55aab601d --- shared/scripts/configuration/config.py (.../config.py) (revision 09949a5215418ec122b15e757558232158b707f5) +++ shared/scripts/configuration/config.py (.../config.py) (revision 2aff4bbf5a1749195064cfc9b8acc9f55aab601d) @@ -31,6 +31,10 @@ GOODEVENING_START_TIME_SEC = 43200 #tst_treatment_saline_data + +#testing options for main treatment saline +SALINE_BOLUS_TARGET = [0, 1, 150, 155, 299, 300] #Boundary Value Analysis + NUM_OF_REQUEST_REJECT_REASONS = 43 #dictionary contains saline cumulative and saline delivered value #key : saline cumulative value. Index: shared/scripts/configuration/strings.py =================================================================== diff -u -r09949a5215418ec122b15e757558232158b707f5 -r2aff4bbf5a1749195064cfc9b8acc9f55aab601d --- shared/scripts/configuration/strings.py (.../strings.py) (revision 09949a5215418ec122b15e757558232158b707f5) +++ shared/scripts/configuration/strings.py (.../strings.py) (revision 2aff4bbf5a1749195064cfc9b8acc9f55aab601d) @@ -14,7 +14,9 @@ ############################################################################ BLOOD_PRIMING_TEXT = "Blood Priming" -BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +BLOOD_PRIMING_UNIT = "mL" +BLOOD_PRIMING_VALUE_0 = "0" +BLOOD_PRIMING_DEFAULT_VALUE = BLOOD_PRIMING_VALUE_0 + " " + BLOOD_PRIMING_UNIT #tst_treatment_saline_data SALINE_UNIT = "mL" Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r7d87d4d539d329ece83668bcdf775bb1a96ebf47 -r2aff4bbf5a1749195064cfc9b8acc9f55aab601d --- shared/scripts/configuration/utility.py (.../utility.py) (revision 7d87d4d539d329ece83668bcdf775bb1a96ebf47) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 2aff4bbf5a1749195064cfc9b8acc9f55aab601d) @@ -16,7 +16,6 @@ import sys import test import squish -from configuration import config from builtins import int as pyInt @@ -109,6 +108,7 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + def rejection_msg(text): names.o_rejection_msg["text"] = text return names.o_rejection_msg Index: shared/scripts/names.py =================================================================== diff -u -r0c4af0393ca0d5aa2a1ae30ae192e8a0c777076c -r2aff4bbf5a1749195064cfc9b8acc9f55aab601d --- shared/scripts/names.py (.../names.py) (revision 0c4af0393ca0d5aa2a1ae30ae192e8a0c777076c) +++ shared/scripts/names.py (.../names.py) (revision 2aff4bbf5a1749195064cfc9b8acc9f55aab601d) @@ -51,15 +51,15 @@ # Saline bolus objects -o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} -o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True} -o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} -o_treatmentStart_SalineSection = {"container": o_treatmentHome, "id": "_salineTouchArea", "type": "TreatmentSaline", "unnamed": 1, "visible": True} -o_treatmentHome_mL_Text = {"container": o_treatmentHome, "text": "mL", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} +o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True} +o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentStart_SalineSection = {"container": o_treatmentHome, "id": "_salineTouchArea", "type": "TreatmentSaline", "unnamed": 1, "visible": True} +o_treatmentHome_mL_Text = {"container": o_treatmentHome, "text": "mL", "type": "Text", "unnamed": 1, "visible": True} o_treatmentHome_cumalative_value = {"container": o_treatmentHome, "id": "_cumulativeValue", "type": "Text", "unnamed": 1, "visible": True} -o_treatmentHome_cumalative_unit = {"container": o_treatmentHome, "id": "_cumulativeUnit", "type": "Text", "unnamed": 1, "visible": True} -o_treatmentHome_delivered_value = {"container": o_treatmentHome, "id": "_fluidValue", "type": "Text", "unnamed": 1, "visible": True} -o_treatmentHome_delivered_unit = {"container": o_treatmentHome, "id": "_fluidUnit", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_cumalative_unit = {"container": o_treatmentHome, "id": "_cumulativeUnit", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_delivered_value = {"container": o_treatmentHome, "id": "_fluidValue", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_delivered_unit = {"container": o_treatmentHome, "id": "_fluidUnit", "type": "Text", "unnamed": 1, "visible": True} o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration = {"container": o_treatmentHome, "id": "_ultrafiltrationTouchArea", "type": "TreatmentUltrafiltration", "unnamed": 1, "visible": True} o_treatmentHome_startFluidButton_TouchRect = {"container": o_treatmentHome, "id": "_startFluidButton", "type": "TouchRect", "unnamed": 1, "visible": True} o_treatment_saline_notification_msg = {"container": o_treatmentHome, "id": "_text", "type": "Text", "unnamed": 1, "visible": True} Index: tst_treatment_saline_data/test.py =================================================================== diff -u -r0c4af0393ca0d5aa2a1ae30ae192e8a0c777076c -r2aff4bbf5a1749195064cfc9b8acc9f55aab601d --- tst_treatment_saline_data/test.py (.../test.py) (revision 0c4af0393ca0d5aa2a1ae30ae192e8a0c777076c) +++ tst_treatment_saline_data/test.py (.../test.py) (revision 2aff4bbf5a1749195064cfc9b8acc9f55aab601d) @@ -16,15 +16,13 @@ import names +from configuration import config, utility from dialin.ui import utils +from dialin.common.hd_defs import HDOpSubModes, TreatmentStates from dialin.ui.hd_simulator import HDSimulator from dialin.common.ui_defs import TXStates as txStates from dialin.common.msg_defs import RequestRejectReasons as rejectReason -from configuration import config, utility -#testing options for main treatment saline -SALINE_BOLUS_TARGET = [0, 1, 150, 155, 299, 300] #Boundary Value Analysis - hd_simulator = HDSimulator() @@ -35,7 +33,7 @@ return str(waitForObjectExists(names.o_treatmentStart_SalineSection).unit) -def verification_of_target_value(expected_target_value): +def verify_target_value(expected_target_value): """ Method to verify target value on saline section @param expected_target_value: (int) expected target value on saline section @@ -44,7 +42,7 @@ test.compare(waitForObjectExists(names.o_treatmentHome_mL_Text).text , get_unit(), "Target unit verified" ) -def verification_of_cumulative_value(expected_cumulative_value): +def verify_cumulative_value(expected_cumulative_value): """ Method to verify cumulative value on saline section @param expected_cumulative_value: (int) expected cumulative value on saline section @@ -53,7 +51,7 @@ test.compare(waitForObjectExists(names.o_treatmentHome_cumalative_unit).text , config.SALINE_UNIT, "cumulative unit verified" ) -def verification_of_delivered_value(expected_delivered_value): +def verify_delivered_value(expected_delivered_value): """ Method to verify delivered value on saline section @param expected_delivered_valuee: (int) expected delivered value on saline section @@ -82,8 +80,7 @@ @param : enabled_status: (bool) True/False -> based on visibility @return: none """ - test.compare(waitForObjectExists(names.o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration).isTouchable, enabled_status,\ - "uf touchable area is visible") + test.compare(waitForObjectExists(names.o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration).isTouchable, enabled_status,"uf touchable area is visible") def test_state(accept_status, button_text, target, saline_states): @@ -99,16 +96,15 @@ # when rejected reason set 16 -> saline bolus in progress if (not accept_status): rejection_reason = rejectReason.REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS.value hd_simulator.cmd_set_saline_bolus_response(accepted = accept_status, reason = rejection_reason, target = target) - if (not accept_status): test.compare(waitForObjectExists(utility.rejection_msg(config.REJECTION_REASON[rejection_reason])).text, config.REJECTION_REASON[rejection_reason], \ - "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection_reason])) + if (not accept_status): test.compare(waitForObjectExists(utility.rejection_msg(config.REJECTION_REASON[rejection_reason])).text, config.REJECTION_REASON[rejection_reason], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection_reason])) #set saline transition state. - hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=saline_states, heparin_state= 0, - rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, - treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0 ) + hd_simulator.cmd_set_treatment_states_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=saline_states, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "{} BOLUS".format(button_text)) - verification_of_target_value(expected_target_value = target) + verify_target_value(expected_target_value = target) def test_rejection_message_on_saline_bolus(accept_status, target, saline_states): @@ -121,7 +117,7 @@ """ test.startSection("verification of rejection messages on saline bolus") for rejection in range(1, config.NUM_OF_REQUEST_REJECT_REASONS): - hd_simulator.cmd_set_saline_bolus_response(accepted = accept_status, reason = rejection, target = target) + hd_simulator.cmd_set_saline_bolus_response(accepted=accept_status, reason=rejection, target=target) rejection_message = waitForObjectExists(utility.rejection_msg(config.REJECTION_REASON[rejection])) test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) @@ -136,19 +132,18 @@ """ test.startSection("verification of saline parameter values on main treatment screen") #FIXME: execution time is more, so used specified saline target value for verification. - for target_value in SALINE_BOLUS_TARGET: + for target_value in config.SALINE_BOLUS_TARGET: for delivered_value, cumulative_value in config.SALINE_BOLUS_VALUES.items(): - hd_simulator.cmd_set_treatment_saline_bolus_data(target = target_value, - cumulative = cumulative_value, - delivered = delivered_value) + hd_simulator.cmd_set_treatment_saline_bolus_data(target=target_value, + cumulative=cumulative_value, + delivered=delivered_value) - test.log("verification of saline values from dialysis state for target value :" + str(target_value)+\ - " cumulative value :" +str(cumulative_value)+" and delivered value :"+ str(delivered_value)) + test.log("verification of saline values from dialysis state for target value :" + str(target_value)+ " cumulative value :" +str(cumulative_value)+" and delivered value :"+ str(delivered_value)) - verification_of_target_value(expected_target_value = format(target_value, '.1f')) - verification_of_delivered_value(expected_delivered_value = format(delivered_value, '.0f')) - verification_of_cumulative_value(expected_cumulative_value = format(cumulative_value, '.0f')) + verify_target_value(expected_target_value = format(target_value, '.1f')) + verify_delivered_value(expected_delivered_value = format(delivered_value, '.0f')) + verify_cumulative_value(expected_cumulative_value = format(cumulative_value, '.0f')) test.endSection() @@ -162,8 +157,8 @@ """ test.startSection("verification of saline stages on main treatment screen") - saline_bolus_target = len(SALINE_BOLUS_TARGET)-1 - saline_target_value = SALINE_BOLUS_TARGET[saline_bolus_target] + saline_bolus_target = len(config.SALINE_BOLUS_TARGET)-1 + saline_target_value = config.SALINE_BOLUS_TARGET[saline_bolus_target] #verification of total rejection message on saline bolus touch section. test_rejection_message_on_saline_bolus(True, saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE) @@ -217,36 +212,37 @@ def test_saline_types(): test.startSection("verification of saline parameter states on main treatment screen") - hd_simulator.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, dialysis_state=0 ) + + hd_simulator.cmd_set_treatment_states_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=TreatmentStates.TREATMENT_START_STATE.value, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) mouseClick(waitForObject(names.o_treatmentHome_startFluidButton_TouchRect)) test.compare((waitForObjectExists(names.o_treatmentHome_startFluidButton_TouchRect).enabled), True, "START BOLUS button is enable") test.compare((waitForObjectExists(names.o_treatmentHome_START_BOLUS_Text).enabled), True, "Start Bolus text is enable") - hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state= 1, heparin_state= 0, - rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, - treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0 ) + hd_simulator.cmd_set_treatment_states_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=TreatmentStates.TREATMENT_BLOOD_PRIME_STATE.value, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) test.compare((waitForObjectExists(names.o_treatmentHome_startFluidButton_TouchRect).enabled), False, "START BOLUS button is not enable") test.compare((waitForObjectExists(names.o_treatmentHome_START_BOLUS_Text).enabled), False, "Start Bolus text is not enable") test.compare((waitForObjectExists(names.o_treatmentHome_START_BOLUS_Text).enabled), False, "Start Bolus text is not enable") test.compare((waitForObjectExists(names.o_treatmentHome_image_Image).visible), True, "Pause Image is Visible") test.compare(str(waitForObjectExists(names.o_treatmentHome_Treatment_Paused_Text).text), "Treatment Paused", "Treatment Paused text is visible") - hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state= 2, heparin_state= 0, - rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, - treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0 ) + hd_simulator.cmd_set_treatment_states_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=TreatmentStates.TREATMENT_DIALYSIS_STATE.value, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) mouseClick(waitForObjectExists(names.o_treatmentHome_stop_bolus_Text)) mouseClick(waitForObject(names.o_treatmentHome_Treatment_Paused_Text)) test.compare((waitForObjectExists(names.o_treatmentHome_image_Image).visible), True, "Pause Image is Visible") test.compare(str(waitForObjectExists(names.o_treatmentHome_Treatment_Paused_Text).text), "Treatment Paused", "Treatment Paused text is visible") - hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state= 3, heparin_state= 0, - rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, - treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0 ) + hd_simulator.cmd_set_treatment_states_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=TreatmentStates.TREATMENT_STOP_STATE.value, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) test.compare((waitForObjectExists(names.o_treatmentHome_startFluidButton_TouchRect).enabled), False, "START BOLUS button is not enable") test.compare((waitForObjectExists(names.o_treatmentHome_START_BOLUS_Text).enabled), False, "Start Bolus text is not enable") @@ -261,9 +257,9 @@ utils.waitForGUI(1) #navigate to dialysis state - hd_simulator.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, dialysis_state=0) + hd_simulator.cmd_set_treatment_states_data(sub_mode= HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=TreatmentStates.TREATMENT_START_STATE.value, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) #verification of target, cumulative and delivered value test_saline_values()