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()