Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0af75233cc3f591575f857eaf0e62f9ab3b10f2c -r20f71633acc71b9332335b30d882c45223e02c22 --- shared/scripts/configuration/config.py (.../config.py) (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c) +++ shared/scripts/configuration/config.py (.../config.py) (revision 20f71633acc71b9332335b30d882c45223e02c22) @@ -36,7 +36,7 @@ # dictionary of rejection reason from application source code. # message location -> denali-> Headers-> common-> MsgDefs.h -REJECTION_MESSAGE = { +REJECTION_REASON = { 0 : "REQUEST_REJECT_REASON_NONE" , # Used when there is no rejection 1 : "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE" , # "REQuest is not allowed in the current operating mode 2 : "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM" , # Validated "REQuest was not confirmed by user in reasonable time @@ -76,8 +76,8 @@ 36 : "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME" , # Given date/time is invalid 37 : "REQUEST_REJECT_REASON_NO_NEW_TREATMENT_ALARM_TRIGGERED" , # Treatment cannot initiate if an alarm with no new treatment property has triggered before 38 : "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED" , # Battery does not have enough charge to start treatment - 39 : "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED" , # Cannot move on to recirculate without completing full rinseback. - } + 39 : "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED" , # Cannot move on to recirculate without completing full rinseback +} NUM_OF_REQUEST_REJECT_REASONS = 39 Index: shared/scripts/names.py =================================================================== diff -u -r0af75233cc3f591575f857eaf0e62f9ab3b10f2c -r20f71633acc71b9332335b30d882c45223e02c22 --- shared/scripts/names.py (.../names.py) (revision 0af75233cc3f591575f857eaf0e62f9ab3b10f2c) +++ shared/scripts/names.py (.../names.py) (revision 20f71633acc71b9332335b30d882c45223e02c22) @@ -1,8 +1,6 @@ # encoding: UTF-8 -from objectmaphelper import * - # Top Parents o_QQuickView = { "type": "QQuickView"} o_Overlay = {"container": o_QQuickView, "type": "Overlay"} @@ -53,10 +51,15 @@ # Saline Bolus -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 = {"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, "occurrence": 39, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_cumalative_unit = {"container": o_treatmentHome, "occurrence": 38, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_delivered_value = {"container": o_treatmentHome, "occurrence": 36, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_delivered_unit = {"container": o_treatmentHome, "occurrence": 35, "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_notification_bar = {"container": ":o_treatmentHome", "occurrence": 3, "objectName": "NotificationBar", "type": "NotificationBarSmall", "visible": True} @@ -65,3 +68,4 @@ + Index: tst_treatment_saline_data/test.py =================================================================== diff -u -r6370ecd7783faa19562c022b1876d8ad2ab63c86 -r20f71633acc71b9332335b30d882c45223e02c22 --- tst_treatment_saline_data/test.py (.../test.py) (revision 6370ecd7783faa19562c022b1876d8ad2ab63c86) +++ tst_treatment_saline_data/test.py (.../test.py) (revision 20f71633acc71b9332335b30d882c45223e02c22) @@ -16,7 +16,6 @@ import names -import re from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from dialin.common.ui_defs import TXStates as txStates @@ -44,36 +43,26 @@ Method to verify target value on saline section @param expected_target_value: (int) expected target value on saline section """ - saline_target = object.children(waitForObject(names.o_fluid_text))[0] - target_value = re.findall(r'\w+', str(saline_target.text)) - test.compare(str(expected_target_value), str(target_value[0]), "Target value verified") - test.compare(get_unit(), str(target_value[1]), "Target unit verified") + test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueTarget , float(expected_target_value), "Target value verified") + test.compare(waitForObjectExists(names.o_treatmentHome_mL_Text).text , get_unit(), "Target unit verified" ) def verification_of_cumulative_value(expected_cumulative_value): """ Method to verify cumulative value on saline section @param expected_cumulative_value: (int) expected cumulative value on saline section """ - saline_unit = object.children(waitForObject(names.o_cumulative_fluid_text))[0] - if (saline_unit.text == config.SALINE_UNIT) and (saline_unit.text == get_unit()): - saline_cumulative = object.children(waitForObject(names.o_cumulative_fluid_text))[1] - test.compare(str(expected_cumulative_value), str(saline_cumulative.text)) - else: - test.fail("Deviation observed in unit of saline (fluid)") + test.compare(waitForObjectExists(names.o_treatmentHome_cumalative_value).text , expected_cumulative_value, "cumulative value verified") + test.compare(waitForObjectExists(names.o_treatmentHome_cumalative_unit).text , config.SALINE_UNIT, "cumulative unit verified" ) + - def verification_of_delivered_value(expected_delivered_value): """ Method to verify delivered value on saline section @param expected_delivered_valuee: (int) expected delivered value on saline section """ - saline_unit = object.children(waitForObject(names.o_fluid_text))[1] - if (saline_unit.text == config.SALINE_UNIT) and (saline_unit.text == get_unit()): - saline_cumulative = object.children(waitForObject(names.o_fluid_text))[2] - test.compare(str(expected_delivered_value), str(saline_cumulative.text)) - else: - test.fail("Deviation observed in unit of saline (fluid)") + test.compare(waitForObjectExists(names.o_treatmentHome_delivered_value).text , expected_delivered_value, "delivered value verified") + test.compare(waitForObjectExists(names.o_treatmentHome_delivered_unit).text , config.SALINE_UNIT, "delivered unit verified" ) def goto_screen_contains_treatment_saline_bolus_data(): @@ -111,8 +100,8 @@ # 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, state = saline_states) - if (not accept_status): test.compare(findObject(names.o_treatment_notification_bar).text, config.REJECTION_MESSAGE[rejection_reason], \ - "expected rejection {msg} displayed".format(msg=config.REJECTION_MESSAGE[rejection_reason])) + if (not accept_status): test.compare(findObject(names.o_treatment_notification_bar).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, @@ -135,7 +124,7 @@ 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, state = saline_states) rejection_message = findObject(names.o_treatment_notification_bar) - test.compare(rejection_message.text, config.REJECTION_MESSAGE[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_MESSAGE[rejection])) + test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) test.endSection() @@ -159,9 +148,9 @@ 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(format(target_value, '.0f'))) - verification_of_delivered_value(expected_delivered_value = format(format(delivered_value, '.0f'))) - verification_of_cumulative_value(expected_cumulative_value = format(format(cumulative_value, '.0f'))) + 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')) test.endSection()