Index: tst_time_duration/test.py =================================================================== diff -u -r4e519ca3aa8e4e2dad14fac0730a3c8f6b9df280 -rda7e002ad72e4cd6704175b72a2d54adc798a9d1 --- tst_time_duration/test.py (.../test.py) (revision 4e519ca3aa8e4e2dad14fac0730a3c8f6b9df280) +++ tst_time_duration/test.py (.../test.py) (revision da7e002ad72e4cd6704175b72a2d54adc798a9d1) @@ -17,9 +17,12 @@ from configuration import config, utility from random import randint from dialin.ui.utils import waitForGUI +from dialin.common.hd_defs import TreatmentStates, UFStates, SalineBolusStates, HeparinStates, TreatmentRinsebackStates, TreatmentRecircStates, TreatmentBloodPrimeStates, TreatmentEndStates, TreatmentStopStates, TreatmentDialysisStates MIN_TIME_RANGE = 60 MAX_TIME_RANGE = 480 +#For reducing Test Execution time we are passing two specific seconds values for verification +total_time_list = [90,120] hd_simulator = HDSimulator() @@ -101,70 +104,48 @@ start_treatment_time_verification(total) test.endSection() -def total_time(): - """ - Method for providing two random values between the time duration range as per SRSUI documents from 60 to 480 Minutes - """ - - totaltime_list = [] - id_count = 0 - while id_count < 2: - id = randint(MIN_TIME_RANGE, MAX_TIME_RANGE) - if id in totaltime_list: - pass - else: - totaltime_list.append(id) - id_count += 1 - return totaltime_list - def verify_pop_up(): """ Method to pass slider value and and verify the same on time duration pop screen """ test.startSection("Verify the slider values") open_time_duration_pop_up() - #FIXME: If we not use specified value then it will take minimum one and maximum 8 hours. - utils.waitForGUI(1) start_treatment_time_verification(60) for duration in range(61): hd_simulator.cmd_set_treatment_parameter_ranges(min_treatment_duration = duration, max_treatment_duration = 61, min_uf_volume = 0.0, max_uf_volume = 0.0, min_dialysate_flow_rate = 0, max_dialysate_flow_rate = 0) utils.waitForGUI(0.1) - hd_simulator.cmd_send_treatment_adjust_duration_response(True, 0, 100, 60) + hd_simulator.cmd_send_treatment_adjust_duration_response(accepted = True, reason = 0, duration = 100, ultrafiltration = 60) test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) #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) - snooze(1) + hd_simulator.cmd_set_treatment_states_data(sub_mode= TreatmentStates.TREATMENT_DIALYSIS_STATE.value, uf_state= UFStates.UF_START_STATE.value, saline_state=SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state= HeparinStates.HEPARIN_STATE_OFF.value, + rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state= TreatmentRecircStates.TREATMENT_RECIRC_RECIRC_STATE.value, blood_prime_state= TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, + treatment_end_state= TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state= TreatmentStopStates.TREATMENT_STOP_RECIRC_STATE.value, dialysis_state=TreatmentDialysisStates.DIALYSIS_START_STATE.value) + utils.waitForGUI(1) verify_pop_up() #Calculating total seconds into minutes and passing to treatment time verification - total_time_list = total_time() for value in total_time_list: - verify_time_remaining_start_time_and_pop_up_slider_val(value*60) - treatment_time_verification(value*60) + verify_time_remaining_start_time_and_pop_up_slider_val(value) + treatment_time_verification(value) #Give treatment stop response to pause remain time - hd_simulator.cmd_set_treatment_states_data(sub_mode= 0, 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=1, dialysis_state=0) + hd_simulator.cmd_set_treatment_states_data(sub_mode= TreatmentStates.TREATMENT_START_STATE.value, uf_state= UFStates.UF_START_STATE.value, saline_state=SalineBolusStates.SALINE_BOLUS_STATE_IDLE.value, heparin_state= HeparinStates.HEPARIN_STATE_OFF.value, + rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state= TreatmentRecircStates.TREATMENT_RECIRC_RECIRC_STATE.value, blood_prime_state= TreatmentBloodPrimeStates.BLOOD_PRIME_RAMP_STATE.value, + treatment_end_state= TreatmentEndStates.TREATMENT_END_WAIT_FOR_RINSEBACK_STATE.value, treatment_stop_state= TreatmentStopStates.TREATMENT_STOP_NO_RECIRC_STATE.value, dialysis_state=TreatmentDialysisStates.DIALYSIS_START_STATE.value) + #verify treatment pause state verify_pause_treatment_text() - - #Send treatment start response after pause 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) - + utils.waitForGUI(5) + utils.tstDone() \ No newline at end of file