Index: tst_treatment_saline_data/test.py =================================================================== diff -u -r4213d76652a6ccc9a8dec97a9f3b929b6e401226 -r671a0301c5ba3bfcfef9692dc981245cd4932a14 --- tst_treatment_saline_data/test.py (.../test.py) (revision 4213d76652a6ccc9a8dec97a9f3b929b6e401226) +++ tst_treatment_saline_data/test.py (.../test.py) (revision 671a0301c5ba3bfcfef9692dc981245cd4932a14) @@ -23,7 +23,7 @@ from configuration import config, utility #testing options for main treatment saline -SALINE_BOLUS_TARGET = [0, 1, 25, 30, 50, 80, 70, 150, 180, 220, 250, 280, 300] +SALINE_BOLUS_TARGET = [0, 300] #Boundary Value Analysis hd_simulator = HDSimulator() @@ -52,14 +52,15 @@ 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 """ 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" ) + test.compare((waitForObjectExists(names.o_treatmentHome_fluidProgressBar_ProgressBar).enabled), True, "Fluid Progress Bar is enable") def goto_screen_contains_treatment_saline_bolus_data(): @@ -71,6 +72,7 @@ test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).buttonText), "START BOLUS", "Saline button text is visible") test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineSection).title ), "SALINE BOLUS", "Saline button title is visible") test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).visible , True, "Saline button is visible") + utils.waitForGUI(0.5) @@ -136,8 +138,9 @@ #FIXME: execution time is more, so used specified saline target value for verification. for target_value in SALINE_BOLUS_TARGET: for saline_values in range(config.SALINE_BOLUS_CUMULATIVE+1): - cumulative_value = saline_values - delivered_value = config.SALINE_BOLUS_CUMULATIVE - saline_values + delivered_value = saline_values + cumulative_value = config.SALINE_BOLUS_CUMULATIVE + saline_values + hd_simulator.cmd_set_treatment_saline_bolus_data(target = target_value, cumulative = cumulative_value, delivered = delivered_value) @@ -169,15 +172,15 @@ # Initial Idle -> Idle/START/UF_True goto_screen_contains_treatment_saline_bolus_data() - test_ultrafiltration_touchable(True ) + test_ultrafiltration_touchable(True) # Initial Idle => Running => Rejected -> Idle/START/UF_True test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE ) - test_ultrafiltration_touchable(True ) + test_ultrafiltration_touchable(True) # retry Idle => Running => Rejected -> Idle/START/UF_True test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE ) - test_ultrafiltration_touchable(True ) + test_ultrafiltration_touchable(True) # Still Idle => Running => Accepted -> Running/STOP/UF_False test_state(True , "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS ) @@ -193,20 +196,23 @@ # Still Running => Idle => Accepted -> Idle/START/UF_True test_state(True , "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE ) - test_ultrafiltration_touchable(True ) + test_ultrafiltration_touchable(True) # Now Idle => Running => Rejected -> Idle/START/UF_True test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE ) - test_ultrafiltration_touchable(True ) + test_ultrafiltration_touchable(True) # Retry Idle => Running => Rejected -> Idle/START/UF_True test_state(False, "START" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IDLE ) - test_ultrafiltration_touchable(True ) + test_ultrafiltration_touchable(True) # Still Idle => Running => Accepted -> Running/STOP/UF_False test_state(True , "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS ) test_ultrafiltration_touchable(False) + # Still Idle => Running => Accepted -> Running/STOP/UF_False + test_state(True , "STOP" ,saline_target_value, txStates.SALINE_BOLUS_STATE_IN_PROGRESS ) + test_ultrafiltration_touchable(False) test.endSection() @@ -227,7 +233,41 @@ #verification of saline stages test_saline_stage() - + + 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 ) + + 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 ) + + 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 ) + + 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 ) + + 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(str(waitForObjectExists(names.o_treatmentHome_Maximum_cumulative_saline_bolus_volume_delivered_Text).text), "Maximum cumulative saline bolus volume delivered", "Treatment Paused text is visible") + test.endSection() + utils.tstDone() \ No newline at end of file