Index: shared/scripts/configuration/config.py =================================================================== diff -u -rb7f4fef664182ef9b8be312166923cf6d040bd76 -rdd2540a25327b187e4a783682b400fbf711672a3 --- shared/scripts/configuration/config.py (.../config.py) (revision b7f4fef664182ef9b8be312166923cf6d040bd76) +++ shared/scripts/configuration/config.py (.../config.py) (revision dd2540a25327b187e4a783682b400fbf711672a3) @@ -30,12 +30,39 @@ GOODMORNING_START_TIME_SEC = 0 GOODEVENING_START_TIME_SEC = 43200 -ENABLED = True -DISABLED = False +BLOOD_PRIMING_TEXT = "Blood Priming" +RINSEBACK_UNIT = " mL" +RINSEBACK_UNIT_MIN = " mL/min" +BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" -BRIGHTNESS_MIN_VAL = 20 -BRIGHTNESS_MAX_VAL = 100 -VOLUME_MIN_VAL = 20 -VOLUME_MAX_VAL = 100 +#end-treatment screens +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' +END_TREATMENT_SCREEN = ["Rinseback Setup", "Recirculate", "Treatment Complete", "Treatment Paused State"] +#rinseback-setup +RINSE_BACK_SETUP_TEXT = "Rinseback Setup" +RINSEBACK_BUTTON_TEXT = "START RINSEBACK" +END_IMAGE_BUTTON_TEXT = "End" +DECELERATE_BUTTON_TEXT = "Decelerate" +ACCELERATE_BUTTON_TEXT = "Accelerate" +PAUSE_BUTTON_TEXT = "Pause" +RESUME_BUTTON_TEXT = "Resume" +RINSEBACK_TEXT = "Rinseback" +RINSEBACK_COMPLETE_TEXT = "Rinseback Complete" +END_TREATMENT_BUTTON_TEXT = "END TREATMENT" +ADDITIONAL_BUTTON_TEXT = "ADDITIONAL" +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 -rffac0e32dc6aa9b664f983291d6241170e4b740b -rdd2540a25327b187e4a783682b400fbf711672a3 --- shared/scripts/configuration/utility.py (.../utility.py) (revision ffac0e32dc6aa9b664f983291d6241170e4b740b) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision dd2540a25327b187e4a783682b400fbf711672a3) @@ -18,8 +18,10 @@ import squish from configuration import config from builtins import int as pyInt +import object +import time +from configuration.config import * - def scroll_to_zone(zone=None, screen_object=None): """ scroll to the numeric if object is hidden @@ -68,4 +70,137 @@ return True return False - \ No newline at end of file + +def scroll_to_zone(zone=None, screen_object=None): + """ + scroll to the numeric if object is hidden + @param zone - UI object + @param screen_object - UI object (UI Home screen = waveforms + numerics) + @return boolean true/false + """ + counter = 0 + while counter <= 100: + try: + counter += 1 + squish.findObject(zone) + squish.snooze(0.5) + if check_if_object_is_within_the_container(obj=zone, container=screen_object): + return True + else: + raise RuntimeError + except RuntimeError: + ScreenObj = squish.waitForObject(screen_object) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + squish.mouseWheel(ScreenObj, screenWidth-1000, + screenHeight-10, 0, -50, squish.Qt.NoModifier) + + raise LookupError("zone object is not in view to the user after " + \ + "trying 100 times") + +def get_bullet_object(screen_obj, num): + """ + To obtain a bullet object based on occurrence provided. + @param screen_obj: provides the container on which the bullet must be present + @param num: provides the occurrence value + @returns a real name object + """ + names.o_bullet_object["container"] = screen_obj + names.o_bullet_object["occurrence"] = num + 1 + return names.o_bullet_object + +def verify_missing_object(object_to_check): + """ + Method to verify the given object is invisible or is not present on the screen + @param object_to_check: the object whose invisibility must be verified + """ + try: + squish.testSettings.objectNotFoundDebugging = False + squish.waitForObject(object_to_check,3000) + test.fail("Given object should not be present initially") + except LookupError as _: + test.passes("object is not present as expected") + + 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 -re09e4bf9ba04efde15f93efc8766d2abcaedc4cb -rdd2540a25327b187e4a783682b400fbf711672a3 --- shared/scripts/names.py (.../names.py) (revision e09e4bf9ba04efde15f93efc8766d2abcaedc4cb) +++ shared/scripts/names.py (.../names.py) (revision dd2540a25327b187e4a783682b400fbf711672a3) @@ -58,6 +58,38 @@ o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +#end-treatment screens +o_text_object = {"type": "Text", "unnamed": 1, "visible": True} +o_bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} +#rinseback-setup +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentRinsebackStack", "type": "EndTreatmentRinsebackStack", "visible": True} +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackInit", "type": "EndTreatmentRinsebackInit", "visible": True} +o_EndTreatmentRinsebackInit_rightImage_Image = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "id": "_rightImage", "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackInit_leftImage_Image = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "id": "_leftImage", "source": "qrc:/images/iArrowLeft", "type": "Image", "unnamed": 1, "visible": True} +o_EndTreatmentEndStack_EndTreatmentEndStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentEndStack", "type": "EndTreatmentEndStack", "visible": True} +o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase = {"container": o_EndTreatmentEndStack_EndTreatmentEndStack, "objectName": "_EndTreatmentBase", "type": "EndTreatmentBase", "visible": True} +o_rinse_back_text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "text": "Rinseback Setup", "type": "Text", "unnamed": 1, "visible": True} +o_start_rinseback_button_text = {"container": o_EndTreatmentEndStack_EndTreatmentBase_EndTreatmentBase, "text": "START RINSEBACK", "type": "Text", "unnamed": 1, "visible": True} +o_rinseback_setup_rinseback_button = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit_EndTreatmentRinsebackInit, "text": "START RINSEBACK", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinseback", "type": "EndTreatmentRinseback", "visible": True} +o_EndTreatmentRinseback_imageEnd_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageEnd", "source": "qrc:/images/iRedCrossWCircle", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imageDecelerate_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageDecelerate", "source": "qrc:/images/iDecelerate", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imageAccelerate_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageAccelerate", "source": "qrc:/images/iAccelerate", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imagePause_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imagePause", "source": "qrc:/images/iPauseLightBlue", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_Rinseback_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "Rinseback", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_imageResume_ImageText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_imageResume", "source": "qrc:/images/iResume", "type": "ImageText", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackComplete", "type": "EndTreatmentRinsebackComplete", "visible": True} +o_EndTreatmentRinsebackComplete_Rinseback_Complete_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "text": "Rinseback Complete", "type": "Text", "unnamed": 1, "visible": True} +o_EndTreatmentRinsebackComplete_END_TREATMENT_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "text": "END TREATMENT", "type": "Text", "unnamed": 1, "visible": True} +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} #settings_Home o_settings_Text = {"container": o_Gui_MainView, "text": "Settings", "type": "Text", "unnamed": 1, "visible": True} @@ -69,9 +101,21 @@ o_settings_base_text_obj = {"container": o_SettingsBase_SettingsBase, "type": "Text", "unnamed": 1, "visible": True} o_service_date_obj = {"container": o_SettingsBase_SettingsBase, "type": "Text", "unnamed": 1, "visible": True} -#volume and brightness -o_SettingsBase_SettingsVolumeBrightness = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsVolumeBrightness", "visible": True} -o_SettingsBase_Volume_And_Brightness_Text = {"container": o_SettingsBase_SettingsVolumeBrightness, "type": "Text", "unnamed": 1, "visible": True} -o_brightness_parent_obj = {"container": o_SettingsBase_SettingsVolumeBrightness, "gradient": 0, "id": "_brightness", "type": "Slider", "unnamed": 1, "visible": True} +o_EndTreatmentRinseback_0_mL_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "0 mL", "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_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}