Index: shared/scripts/configuration/config.py =================================================================== diff -u -r5e1b3686da46f4401f11a6d0ffe8e650f7c89417 -rb5f97cddacc0a93b825af43c75ca3097a71d51b8 --- shared/scripts/configuration/config.py (.../config.py) (revision 5e1b3686da46f4401f11a6d0ffe8e650f7c89417) +++ shared/scripts/configuration/config.py (.../config.py) (revision b5f97cddacc0a93b825af43c75ca3097a71d51b8) @@ -45,8 +45,15 @@ UF_MINIMUM_SLIDER_WIDTH = -2 UF_MAXIMUM_SLIDER_WIDTH = 638.00 UF_VALID_RANGE = 700 +PATIENT_CONNECTION_TEXT = "Patient Connection" +TUTORIAL_TEXT = +{ + 1 : "Wash your hands and establish vascular access per your clinic's instructions.", + 2 : "Pinch arterial clamp and venous clamp on located on the cartridge patient lines.", + 3 : "Remove arterial and venous shunt.", + 4 : "Connect arterial and venous cartridge lines to your patient access lines." + } - # dictionary of rejection reason from application source code. # message location -> denali-> Headers-> common-> MsgDefs.h REJECTION_REASON = { Index: shared/scripts/names.py =================================================================== diff -u -r5e1b3686da46f4401f11a6d0ffe8e650f7c89417 -rb5f97cddacc0a93b825af43c75ca3097a71d51b8 --- shared/scripts/names.py (.../names.py) (revision 5e1b3686da46f4401f11a6d0ffe8e650f7c89417) +++ shared/scripts/names.py (.../names.py) (revision b5f97cddacc0a93b825af43c75ca3097a71d51b8) @@ -82,6 +82,18 @@ o_PreTreatmentUltrafiltration_Ultrafiltration_Volume_L_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "Ultrafiltration Volume (L)", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentUltrafiltration_Ultrafiltration_Setup_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "Ultrafiltration Setup", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentUltrafiltration_CONFIRM_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2 = {"container": o_PreTreatmentStack_PreTreatmentConsumblesStack_PreTreatmentConnectionStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} +o_PreTreatmentbase_skip_text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "SKIP", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Patient_Connection_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "Patient Connection", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Continue_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "text": "CONTINUE", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_swipeview_SwipeView = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_swipeview", "type": "SwipeView", "unnamed": 1, "visible": True} +o_swipeview_tutorial_text = {"container": o_PreTreatmentBase_swipeview_SwipeView, "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_rightImage_Image = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} +o_PreTreatmentBase_leftImage_Image = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase_2, "id": "_leftImage", "source": "qrc:/images/iArrowLeft", "type": "Image", "unnamed": 1, "visible": True} + + +#o_swipeview_Item = {"container": o_PreTreatmentBase_swipeview_Swipeo_swipeview_Connect_arterial_and_venous_cartridge_lines_to_your_patient_access_lines_Text = {"container": o_PreTreatmentBase_swipeview_SwipeView, "text": "Connect arterial and venous cartridge lines to your patient access lines.", "type": "Text", "unnamed": 1, "visible": True} + #o_pppppppp = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase, "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} Index: tst_pre_treatment_patient_connection/test.py =================================================================== diff -u -rade72705b273a542508c1ef6a5fec6773e28f5f1 -rb5f97cddacc0a93b825af43c75ca3097a71d51b8 --- tst_pre_treatment_patient_connection/test.py (.../test.py) (revision ade72705b273a542508c1ef6a5fec6773e28f5f1) +++ tst_pre_treatment_patient_connection/test.py (.../test.py) (revision b5f97cddacc0a93b825af43c75ca3097a71d51b8) @@ -17,13 +17,35 @@ import names from dialin.ui.hd_simulator import HDSimulator -from dialin.ui.dg_simulator import DGSimulator +from dialin.common.hd_defs import PreTreatmentSubModes +from dialin.common.msg_defs import RequestRejectReasons +from dialin.common.hd_defs import HDOpModes from dialin.ui import utils from configuration import config, utility hd_simulator = HDSimulator() +SYSTOLIC_PRESSSURE_120 = "120" +SYSTOLIC_PRESSSURE_113 = "113" +SYSTOLIC_PRESSSURE_200 = "200" +SYSTOLIC_PRESSSURE_175 = "175" +DIASTOLIC_PRESSSURE_74 = "74" +DIASTOLIC_PRESSSURE_150 = "150" +DIASTOLIC_PRESSSURE_80 = "80" +DIASTOLIC_PRESSSURE_60 = "60" +HEART_RATE_VAL_101 = "101" +HEART_RATE_VAL_60 = "60" +HEART_RATE_VAL_70 = "70" +HEART_RATE_VAL_85 = "85" +DIASTOLIC_TEXT = "diastolic" +SYSTOLIC_TEXT = "systolic" +BLOOD_PRESSURE_DEFAULT_VAL = "__ / __" +HEART_RATE_DEFAULT_VAL = "__" +INVALID_VALS = {"systolic" : [260, 59, 300, 23], "diastolic": [39, 1, 210, 201], + "Heart Rate": [181, 200, 39, 20]} + +PRE_TREATMENT_PATIENT_CONNECTION_MODE = 8 PRE_TREATMENT_STEPS = 5 @@ -41,7 +63,7 @@ } -def test_rejection_message_patient_connection(accept_status, uf_value): +def test_rejection_message_patient_connection(accept_status): """ verification of rejection messages during patient connection. @param accept_status: (int) boolean accept/reject response @@ -51,15 +73,37 @@ """ test.startSection("verification of rejection messages on saline bolus") for rejection in range(1, config.NUM_OF_REQUEST_REJECT_REASONS): - hd_simulator.cmd_send_uf_treatment_response(accepted = accept_status, reason = rejection, volume = uf_value) + hd_simulator.cmd_send_uf_treatment_response(accepted = accept_status, reason = rejection, volume = config.UF_VALID_RANGE) rejection_message = findObject(names.o_treatment_notification_bar) test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) test.endSection() + +def test_patient_connection_instruction_screen(screen_indicator): + + for instruction_screen in (screen_indicator): + mouseClick(waitForObject(names.names.o_PreTreatmentBase_rightImage_Image)) + + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Patient_Connection_Text).text),config.PATIENT_CONNECTION_TEXT, "Patient connection text should be {msg}".format(msg=config.PATIENT_CONNECTION_TEXT)) + test.compare(str(waitForObjectExists(names.o_swipeview_tutorial_text).enabled, True, "Tutorial text should be enabled.")) + test.compare(str(waitForObjectExists(names.o_swipeview_tutorial_text).text, config.TUTORIAL_TEXT[screen_indicator], "Tutorial text should be {msg}".format(msg=config.TUTORIAL_TEXT[screen_indicator])) + verify_bullet_indicators(screen_indicator) + if screen_indicator == 4: + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Continue_Text).enabled, False, "continue button should be disabled")) + else: + test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Continue_Text).enabled, True, "continue button should be disabled")) + + + for instruction_screen in (screen_indicator): + mouseClick(waitForObject(names.o_PreTreatmentBase_leftImage_Image)) + + + + def verify_filter_flush_text(): """ - Verify Filter Flush Text on UI Screen + Verify Filter Flush Text on UI Screen """ test.log("Verifying the text 'Filter Flush'") test.compare(str(waitForObjectExists(names.o_PreTreatmentBase_Filter_Flush_Text).text),FILTER_FLUSH_TEXT, "Verified Filter Flush text") @@ -118,32 +162,32 @@ -def verification_Bullets_text(): +def verify_bullet_indicators(indicator): test.verify((names.o_PreTreatmentBase_headStepBullet_StepBullet).visible, "Verify headstep bullet") test.verify((names.o_PreTreatmentBase_indicator_StepIndicator).enable, "Verified indicator") + + def reset_treatment_time_verification(vTotal): """ Method to reset and verify Actual time in seconds to Maximum & Minimum values on UI screen in seconds @param vTotal: (int) Total time in seconds """ + mouseClick(waitForObject(names.o_PreTreatmentbase_skip_text)) - hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(0,vTotal) - test.compare(waitForObjectExists(names.Time_text).parent.maximum, vTotal, "Reset maximum value and compare it expected value{}".format(vTotal)) - test.compare(waitForObjectExists(names.Time_text).parent.minimum, 0, "Reset minimun value and compare it expected value{}".format(0)) - def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) utils.waitForGUI(2) + #navigate to pre treatment hd_simulator.cmd_set_hd_operation_mode_data(5,0) - navigate_patient_connection(pre_treatment_sub_mode = 8) + navigate_patient_connection(PRE_TREATMENT_PATIENT_CONNECTION_MODE) #utility.page_step_indicator_verification(PRE_TREATMENT_STEPS, names.ultrafilteration_text) @@ -158,17 +202,19 @@ start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_9"]) start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_10"]) - test_rejection_message_patient_connection() - #hd_simulator.cmd_set_treatment_adjust_ultrafiltration_accepted(state= 1) - hd_simulator.cmd_send_uf_treatment_response(accepted = 0, reason = 6, volume = 70) + test_rejection_message_patient_connection(accept_status = False) + + hd_simulator.cmd_send_uf_treatment_response(accepted = True, reason = 0, volume = config.UF_VALID_RANGE) + #test_vital_entries_on_patient_connection() + test_patient_connection_instruction_screen(screen_indicator = 1) + test_patient_connection_instruction_screen(screen_indicator = 2) + test_patient_connection_instruction_screen(screen_indicator = 3) + test_patient_connection_instruction_screen(screen_indicator = 4) - snooze(10) - - utils.waitForGUI(3) utils.tstDone()