Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0d29de114c4155f07fc8c2d1c83544643a18a334 -r1da2d466f9f2501f10fd623cd48f3ae13e7c1faa --- shared/scripts/configuration/config.py (.../config.py) (revision 0d29de114c4155f07fc8c2d1c83544643a18a334) +++ shared/scripts/configuration/config.py (.../config.py) (revision 1da2d466f9f2501f10fd623cd48f3ae13e7c1faa) @@ -30,14 +30,15 @@ GOODEVENING_START_TIME_SEC = 43200 BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" +RINSEBACK_UNIT = " mL" +RINSEBACK_UNIT_MIN = " mL/min" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" #end-treatment screens -CURRENT_COLOR = '#000000' -COMPLETE_COLOR= '#000000' +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' ENABLED_COLOR = '#fcfcfc' -INCOMPLETE_COLOR = '#607a91' +INCOMPLETE_COLOR = '#607a91' END_TREATMENT_SCREEN = ["Rinseback Setup", "Recirculate", "Treatment Complete", "Treatment Paused State"] #rinseback-setup @@ -52,4 +53,15 @@ RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" END_TREATMENT_BUTTON_TEXT = "END TREATMENT" ADDITIONAL_BUTTON_TEXT = "ADDITIONAL" -ADDITIONAL_RINSEBACK_TEXT = "Additional Rinseback" \ No newline at end of file +ADDITIONAL_RINSEBACK_TEXT = "Additional Rinseback" + +TIME_OUT_DURATION_300 = 300 +TIME_OUT_DURATION_200 = 200 +TIME_OUT_DURATION_100 = 100 +COUNT_DOWN_TIME_100 = 100 +MINIMUM_COUNTDOWN_TIME = 0 +BEGIN_PRIME_TITLE = "Begin Prime" +PRIMING_TITLE = "Priming" +SYSTEM_SELF_TEST_TITLE = "System Self Test" +FILTER_FLUSH_TITLE = "Filter Flush" + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r0d29de114c4155f07fc8c2d1c83544643a18a334 -r1da2d466f9f2501f10fd623cd48f3ae13e7c1faa --- shared/scripts/configuration/utility.py (.../utility.py) (revision 0d29de114c4155f07fc8c2d1c83544643a18a334) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 1da2d466f9f2501f10fd623cd48f3ae13e7c1faa) @@ -18,8 +18,13 @@ import squish from configuration import config from builtins import int as pyInt +import object +import time +from configuration.config import * + + def start_application(app_name): """ Function to start application and verify application status [running] @@ -132,4 +137,92 @@ except LookupError as _: test.passes("object is not present as expected") - squish.testSettings.objectNotFoundDebugging = True \ No newline at end of file + squish.testSettings.objectNotFoundDebugging = True + +def verify_countdown(screen_title, time_out, hd_simulator, dg_simulator): + """ + Method to verify the count down + time in application + @param screen_title - (str) current title of the screen + @param time_out - (int) time out duration in secs + @Param hd_simulator - Instance of class HDSimulator + @Param dg_simulator - Instance of class DGSimulator + """ + test.startSection("Verify the count down time in application") + for count_down in range(COUNT_DOWN_TIME_100, MINIMUM_COUNTDOWN_TIME-1, -1): + if screen_title == BEGIN_PRIME_TITLE: + hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(time_out, count_down) + elif screen_title == PRIMING_TITLE: + hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(time_out, count_down) + elif screen_title == SYSTEM_SELF_TEST_TITLE: + hd_simulator.cmd_send_pre_treatment_self_test_no_cartridge_progress_data(time_out, count_down) + else: + dg_simulator.cmd_send_dg_pre_treatment_filter_flush_progress_data(time_out, count_down) + actual_time = get_time(screen_title) + expected_time = convert_seconds_into_min_and_sec(count_down) + test.compare(actual_time, expected_time, "Actual count down time: {} should be equal to expected count down time {}".format(actual_time, expected_time)) + verify_the_progress(count_down, screen_title, time_out) + test.endSection() + +def convert_seconds_into_min_and_sec(seconds): + min = time.strftime("%M", time.gmtime(seconds)) + sec = time.strftime("%S", time.gmtime(seconds)) + return min,sec + + + +def get_time(screen_title): + """ + Method to return the current count down + in the application + @param screen_title - (str) current title of the screen + """ + progress_circle_index = 4 + if screen_title == BEGIN_PRIME_TITLE or screen_title == PRIMING_TITLE: + parent_object = object.parent(squish.waitForObjectExists(self_test_dry_check_list_text(screen_title))) + elif screen_title == SYSTEM_SELF_TEST_TITLE: + parent_object = object.parent(squish.waitForObjectExists(names.o_system_self_test)) + else: + parent_object = object.parent(squish.waitForObjectExists(names.o_rinseack_title)) + progress_circle_index = 10 + time_parent_children = object.children(parent_object) + test.log(str(time_parent_children)) + progress_circle_parent = time_parent_children[progress_circle_index] + progress_circle_parent = object.children(progress_circle_parent) + test.log(str(progress_circle_parent)) + progress_circle_parent = progress_circle_parent[0] + test.log(str(progress_circle_parent)) + progress_circle_parent = object.children(progress_circle_parent) + progress_circle_children = object.children(progress_circle_parent[0]) + test.log(str(progress_circle_children)) + time_text = progress_circle_children[0] + test.log(str(time_text)) + return time_text.time + + + +def verify_the_progress(count_down, screen_title, time_out): + """ + Method to verify the current progress + @param count_down - (int) current count down time + @param screen_title - (str) current title of the screen + @param time_out - (int) time out duration in secs + """ + test.startSection("Verifying the current progress") + if screen_title == BEGIN_PRIME_TITLE or screen_title == PRIMING_TITLE: + current_progress = (squish.waitForObjectExists(names.o_self_test_dry_progress)).progressValue + elif screen_title == SYSTEM_SELF_TEST_TITLE: + current_progress = (squish.waitForObjectExists(names.o_system_self_test_progress)).progressValue + else: + current_progress = (squish.waitForObjectExists(names.o_rinseback_setup_progress)).progressValue + #Since progress value is equal maximum count down value - current count down value + expected_progress = time_out - count_down + test.compare(current_progress, expected_progress, "{} should be the current progress".format(expected_progress)) + test.endSection() + + + + + + + \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -r0d29de114c4155f07fc8c2d1c83544643a18a334 -r1da2d466f9f2501f10fd623cd48f3ae13e7c1faa --- shared/scripts/names.py (.../names.py) (revision 0d29de114c4155f07fc8c2d1c83544643a18a334) +++ shared/scripts/names.py (.../names.py) (revision 1da2d466f9f2501f10fd623cd48f3ae13e7c1faa) @@ -73,7 +73,38 @@ o_EndTreatmentRinsebackComplete_ADDITIONAL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "text": "ADDITIONAL", "type": "Text", "unnamed": 1, "visible": True} o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentAdditional", "type": "EndTreatmentBase", "visible": True} o_EndTreatmentAdditional_Additional_Rinseback_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "text": "Additional Rinseback", "type": "Text", "unnamed": 1, "visible": True} +o_rinseback_timer_ml_min_text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": " mL/min", "type": "Text", "unnamed": 1, "visible": True} +# o_rinseback_setup_progress = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_circle", "type": "ProgressCircle", "visible": True} +# o_rinseback_setup_progress = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_TimeCircle", "type": "TimeCircle", "visible": True} +o_shape_Shape = {"container": o_Gui_MainView, "id": "_shape", "type": "Shape", "unnamed": 1, "visible": True} +o_rinseback_setup_progress = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_Circle", "type": "ProgressCircle", "visible": True} +# o_self_test_dry_progress_circle = {"container": o_PreTreatmentStack_pretreatmentPrimeStack_PreTreatmentPrimeStack, "id": "_progressCircle", "type": "ProgressCircle", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_0_mL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} +# {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_circle", "type": "Circle", "unnamed": 1, "visible": True} +# {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "gradient": 0, "id": "_rectangle", "type": "Rectangle", "unnamed": 1, "visible": True} +# {"container": o_Gui_MainView, "id": "_shape", "type": "Shape", "unnamed": 1, "visible": True} +# {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "type": "ShaderEffectSource", "unnamed": 1, "visible": True} +# o_label_timer_rinseback_setup_ml_min = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "0 mL/min", "type": "Text", "unnamed": 1, "visible": True +o_rinseack_title = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "Rinseback", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackInit_TimeText_TimeText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "gradient": 0, "objectName": "_TimeText", "type": "TimeText", "visible": True} +o_EndTreatmentRinsebackInit_TimeText_minute_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "objectName": "_TimeText_minute", "type": "Text", "visible": True} +o_EndTreatmentRinsebackInit_TimeText_hour_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "objectName": "_TimeText_hour", "type": "Text", "visible": True} +o_EndTreatmentRinseback_1_mL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "Text", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_1_mL_min_Text_2 = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_1_mL_Text_2 = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentAdditional_1_mL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentAdditional_1_mL_min_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackComplete_TimeText_minute_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "objectName": "_TimeText_minute", "type": "Text", "visible": True} +o_EndTreatmentRinsebackComplete_TimeText_hour_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete,"objectName": "_TimeText_hour", "type": "Text", "visible": True} +# o_EndTreatmentAdditional_0_mL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "type": "Text", "unnamed": 1, "visible": True} +o_text_volume_rinseback_state = {"type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_circle_Circle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_circle", "type": "Circle", "unnamed": 1, "visible": True} +o_EndTreatmentAdditional_circle_Circle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "id": "_circle", "type": "Circle", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_circle_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_circle", "type": "ProgressCircle", "unnamed": 1, "visible": True} +o_EndTreatmentAdditional_circle_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "id": "_circle", "type": "ProgressCircle", "unnamed": 1, "visible": True} +# o_text_volume_rinseback_run_state = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "type": "Text", "unnamed": 1, "visible": True} +# {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} Index: tst_rinseback_setup/test.py =================================================================== diff -u -r0d29de114c4155f07fc8c2d1c83544643a18a334 -r1da2d466f9f2501f10fd623cd48f3ae13e7c1faa --- tst_rinseback_setup/test.py (.../test.py) (revision 0d29de114c4155f07fc8c2d1c83544643a18a334) +++ tst_rinseback_setup/test.py (.../test.py) (revision 1da2d466f9f2501f10fd623cd48f3ae13e7c1faa) @@ -18,19 +18,36 @@ import names import builtins +import test from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator +from dialin.ui.dg_simulator import DGSimulator from configuration import config from configuration import utility from dialin.common.hd_defs import HDOpModes, HDOpSubModes, TreatmentStates, TreatmentEndStates, TreatmentRinsebackStates +dg_simulator = DGSimulator() hd_simulator = HDSimulator() SCREEN_OBJ1 = names.o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit num_of_instructions = 3 rightarrow_obj_names = [names.o_EndTreatmentRinsebackInit_rightImage_Image] leftarrow_obj_names = [names.o_EndTreatmentRinsebackInit_leftImage_Image] +container_run_state = names.o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback +container_additional_state = names.o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase +count_down_value = 121 +count_down_default_value = 0 +timer_default_value = 1 +def set_custom_object_property_rinseback_ml(text,container): + """ + Method to set object property based on text + @param text : (string) treatment parameter text + """ + names.o_text_volume_rinseback_state["text"] = text + names.o_text_volume_rinseback_state["container"] = container + return names.o_text_volume_rinseback_state + def verify_bullet_navigation(num, num_of_instructions, screen_obj): """ Method to verify status of bullets based @@ -45,58 +62,81 @@ bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name if instruction <= num: -# test.compare(bullet_circle_color, config.COMPLETE_COLOR) -# test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) test.log(str(instruction) + " Complete bullet") else: test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color,config.INCOMPLETE_COLOR) test.log(str(instruction) + " Incomplete bullet") test.endSection() - -def verification_of_rinseback_setup_state(): + +def verify_of_rinseback_stop_init_screen(): """ - Method to navigate to End-Treatment Rinseback Setup screens + Method to navigate and verify to Rinseback Stop INIT state screens """ - test.startSection("verifying Rinseback Setup state screens") test.startSection("verifying Rinseback Stop INIT state screens") hd_simulator.cmd_send_hd_operation_mode(op_mode = HDOpModes.MODE_TREA.value , sub_mode=HDOpSubModes.SUBMODE_START.value) hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value, rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + for num in range(timer_default_value,count_down_value): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol= float(0), current_vol= float(0), flow_rate= 0, timeout= num,timeout_countdown= num, is_completed= 0) + min,sec = utility.convert_seconds_into_min_and_sec(num) + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_minute_Text).text),str(sec),"Vrifying seconds apeearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_hour_Text).text),str(min),"Verifying minutes apeearing on UI") + test.compare(str(waitForObject(names.o_rinse_back_text).text),config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) -# test.compare(str(waitForObjectExists(names.o_rinse_back_text).text), config.RINSEBACK_BUTTON_TEXT, "Rinseback button text must be {}".format(config.RINSEBACK_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_rinse_back_text).enabled, " Start Rinseback button must be active") mouseClick(waitForObject(names.o_rinse_back_text)) verify_right_instruction_in_rinseback_setup_state(num_of_instructions) verify_left_instruction_in_rinseback_setup_state(num_of_instructions) verify_right_instruction_in_rinseback_setup_state(num_of_instructions) test.endSection() - + +def verify_rinseback_run_state_screen(): + """ + Method to navigate and verify to Rinseback RUN state screens + """ test.startSection("verifying Rinseback RUN state screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_RUN_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + + for num in range(count_down_default_value,count_down_value): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= num, flow_rate= num, timeout= count_down_default_value,timeout_countdown= count_down_default_value, is_completed= 0) + rinseback_ml = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT),container_run_state) + test.compare(str(waitForObject(rinseback_ml).text),str(num)+config.RINSEBACK_UNIT, "Verifying values apeearing on Progress circle") + rinseback_ml_min = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT_MIN),container_run_state) + test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_circle_Circle).enabled, "Progress bar must be enable") + test.compare(str(waitForObject(rinseback_ml_min).text),str(num)+config.RINSEBACK_UNIT_MIN, "Verifying values apeearing on Lable") + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_circle_ProgressCircle).value),str(num), "Verifying Progress bar values") + + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_Rinseback_Text).text),config.RINSEBACK_TEXT, "Rinseback text must be {}".format(config.RINSEBACK_TEXT)) test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText).text),config.END_IMAGE_BUTTON_TEXT, "END button text must be {}".format(config.END_IMAGE_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageEnd_ImageText).enabled, " END button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText)) - + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).text),config.DECELERATE_BUTTON_TEXT, "Decelerate button text must be {}".format(config.DECELERATE_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).enabled, " Decelerate button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageDecelerate_ImageText)) - + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).text),config.ACCELERATE_BUTTON_TEXT, "Accelerate button text must be {}".format(config.ACCELERATE_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).enabled, " Accelerate button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText)) - + test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText).text),config.PAUSE_BUTTON_TEXT, "Pause button text must be {}".format(config.PAUSE_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imagePause_ImageText).enabled, " Pause button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText)) test.endSection() - + +def verify_rinseback_paused_state_screen(): + """ + Method to navigate and verify to Rinseback Paused state screens + """ test.startSection("verifying Rinseback Paused state screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_PAUSED_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, @@ -106,44 +146,58 @@ test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageEnd_ImageText).enabled, " END button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText)) + accelerator = waitForObjectExists(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).enabled + test.compare(accelerator,False, " Accelerate button must be disabled") + decelarator = waitForObjectExists(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).enabled + test.compare(decelarator,False, " Decelerate button must be disabled") -# test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).text),config.ACCELERATE_BUTTON_TEXT, "Accelerate button text must be {}".format(config.ACCELERATE_BUTTON_TEXT)) -# test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageAccelerate_ImageText).enabled, " Accelerate button must be active") -# mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageAccelerate_ImageText)) -# -# test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).text),config.DECELERATE_BUTTON_TEXT, "Decelerate button text must be {}".format(config.DECELERATE_BUTTON_TEXT)) -# test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageDecelerate_ImageText).enabled, " Decelerate button must be active") -# mouseClick(waitForObject(names.names.o_EndTreatmentRinseback_imageDecelerate_ImageText)) - test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText).text),config.RESUME_BUTTON_TEXT, "Resume button text must be {}".format(config.RESUME_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageResume_ImageText).enabled, " Resume button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText)) test.endSection() - + +def verify_rinseback_stop_state_screen(): + """ + Method to navigate and verify to Rinseback Stop state screens + """ test.startSection("verifying Rinseback Stop state screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) - + for num in range(timer_default_value,count_down_value): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= count_down_default_value, flow_rate= count_down_default_value, timeout= num,timeout_countdown= num, is_completed= 0) + min,sec = utility.convert_seconds_into_min_and_sec(num) + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_minute_Text).text),str(sec), "Vrifying seconds apeearing on UI") + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_hour_Text).text),str(min), "Vrifying minutes apeearing on UI") test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_Rinseback_Complete_Text).text),config.RINSEBACK_COMPLETE_TEXT, "Rinseback Complete text must be {}".format(config.RINSEBACK_COMPLETE_TEXT)) test.compare(str(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text).text), config.END_TREATMENT_BUTTON_TEXT, "END TREATMENT button text must be {}".format(config.END_TREATMENT_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text).enabled, "END TREATMENT button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text)) - + test.compare(str(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text).text), config.ADDITIONAL_BUTTON_TEXT, "ADDITIONAL button text must be {}".format(config.ADDITIONAL_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text).enabled, "ADDITIONAL button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text)) test.endSection() - + +def verify_rinseback_run_additional_state_screen(): + """ + Method to navigate and verify to Rinseback Run Additional State screens + """ test.startSection("verifying Rinseback Run Additional State screens") hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_RUN_ADDITIONAL_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) - + for num in range(count_down_default_value,count_down_value): + hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= num, flow_rate= num, timeout= count_down_default_value,timeout_countdown= count_down_default_value, is_completed= 0) + rinseback_additional_ml = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT_MIN),container_additional_state) + test.compare(str(waitForObject(rinseback_additional_ml).text),str(num)+config.RINSEBACK_UNIT_MIN, "Verifying values apeearing on Progres bar") + rinseback_additional_ml_min = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT),container_additional_state) + test.compare(str(waitForObject(rinseback_additional_ml_min).text),str(num)+config.RINSEBACK_UNIT, "Verifying values apeearing on Lable") + test.verify(waitForObjectExists(names.o_EndTreatmentAdditional_circle_Circle).enabled, "Progress Bar must be enable") + test.compare(str(waitForObject(names.o_EndTreatmentAdditional_circle_ProgressCircle).value),str(num), "Verifying Progress bar values") test.compare(str(waitForObject(names.o_EndTreatmentAdditional_Additional_Rinseback_Text).text),config.ADDITIONAL_RINSEBACK_TEXT, "Additional Rinseback text must be {}".format(config.ADDITIONAL_RINSEBACK_TEXT)) test.endSection() - test.endSection() - + def verify_right_instruction_in_rinseback_setup_state(num_of_instructions): """. Method to verify right arrow functionality @@ -162,7 +216,7 @@ def verify_left_instruction_in_rinseback_setup_state(num_of_instructions): """ Method to verify left arrow functionality for rinseback setup state - + @param num_of_instructions - (int) count the number of instructions """ test.startSection("verifying left arrow functionality for rinseback setup state screens") utility.verify_missing_object(rightarrow_obj_names) @@ -178,4 +232,11 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME) - verification_of_rinseback_setup_state() \ No newline at end of file + verify_of_rinseback_stop_init_screen() + verify_rinseback_run_state_screen() + verify_rinseback_paused_state_screen() + verify_rinseback_stop_state_screen() + verify_rinseback_run_additional_state_screen() + + + \ No newline at end of file