Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 -r279e768763ca90eadc690f1c922889f8969e5e6f --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) @@ -108,6 +108,8 @@ ADVANCED_INSTITUTIONAL_SETTINGS_SCREEN_TITLE_TEXT = "Advanced Institutional Settings" ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Advanced Institutional records and preferences updated" INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Institutional records and preferences updated" +ERROR_ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Error Adjusting Advanced Institutional Records" +ERROR_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Error Adjusting Institutional Records" CREATERX = "Rx" NEXT = "Next" Index: suite_leahi/shared/scripts/configuration/navigation.py =================================================================== diff -u -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 -r279e768763ca90eadc690f1c922889f8969e5e6f --- suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) +++ suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) @@ -69,40 +69,35 @@ """ test.startSection("Method to navigation in the pretreatment page ") + stepcount = squish.waitForObjectExists(names.o_preTreatmentStack_repeater_Repeater) + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(squish.waitForObject(Nextbutton)) + autoLoadbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text ="Auto Load") + squish.mouseClick(squish.waitForObject(autoLoadbutton)) + td_simulator.td_blood_set_auto_load_response(vRejectionReason = 0) stepId = squish.waitForObjectExists(names.o_preTreatmentStack_stepIndicator_StepIndicator) values = utility.findAllObjectsById(stepId, "_text") - for index, input_field in enumerate(values[1:]): - test.log(str(index)); - test.log(str(input_field.text)) - if str(input_field.text) == vStep_name: - test.log("Reached the target step") - break - else: - Nextbutton = utility.setObjectText(obj=names.o_preTreatmentStack_Text, text=config.NEXT) - squish.mouseClick(Nextbutton) - test.endSection() + if stepcount.count == 9: + for input_field in values[3:]: + test.log(str(input_field.text)) + if str(input_field.text) == "Water Sample": + squish.mouseClick(squish.waitForObject(names.o_PreTreatmentSampleStack_button_TouchRect)) + if str(input_field.text) == vStep_name: + break + else: + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(Nextbutton) + else: + for input_field in values[3:]: + test.log(str(input_field.text)) + if str(input_field.text) == "Water Sample": + squish.mouseClick(waitForObject(names.o_PreTreatmentSampleStack_button_TouchRect)) + + if str(input_field.text) == vStep_name: + break + else: + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(Nextbutton) -def navigation_pageIndicator_step(vStep_name): - """ - Navigate to the specified page using the step indicator component. - - This method selects the given step from the page step indicator - Args: - vStep_name (str): The name of the step to navigate to as displayed - in the step indicator. - - """ - test.startSection("Method to navigation in the pretreatment page ") - stepId = squish.waitForObjectExists(names.o_preTreatmentStack_stepIndicator_StepIndicator) - values = utility.findAllObjectsById(stepId, "_text") - for index, input_field in enumerate(values[2:]): - test.log(str(index)); - test.log(str(input_field.text)) - if str(input_field.text) == vStep_name: - test.log("Reached the target step") - break - else: - Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) - squish.mouseClick(Nextbutton) test.endSection() \ No newline at end of file Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 -r279e768763ca90eadc690f1c922889f8969e5e6f --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) @@ -216,10 +216,6 @@ return results - - - - def set_value_with_slider(value_field_obj, slider_obj,parameter): """ Opens the slider and moves it gradually to the target value (step of 10). @@ -288,9 +284,10 @@ """ try: return squish.waitForObject(names_dict, timeout_ms).color.name + except LookupError: test.fail("ERROR : " + error_message) - return None + def get_object_source_path(names_dict, error_message = "Missing object source path", timeout_ms = 2000): """ To get an object source path with try..except catching to prevent script errors when the object is not found on the GUI @@ -299,9 +296,9 @@ """ try: return squish.waitForObject(names_dict, timeout_ms).source.path - except LookupError: - return None + except LookupError: test.fail("ERROR : " + error_message) + return None def get_object_text(names_dict, error_message = "Missing object text", timeout_ms = 2000): """ Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 -r279e768763ca90eadc690f1c922889f8969e5e6f --- suite_leahi/shared/scripts/names.py (.../names.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) @@ -38,7 +38,9 @@ o_dialyste_cond_title_Text = {"container": mainTreatmentScreen, "id": "_dialysateCond", "objectName": "dialysateCondComponent", "type": "TreatmentFlowsComponent" } o_treatmentTimeNotificationBarSmall = {"container": mainTreatmentScreen, "objectName": "notification", "type": "NotificationBarSmall" } -# settings_service_export_logs +# settings_service_export_logs +o_mainMenu_MainMenu = {"container": o_Gui_MainView, "id": "_mainMenu", "type": "MainMenu", "unnamed": 1 } +o_headerBar_HeaderBar = {"container": o_Gui_MainView, "id": "_headerBar", "type": "HeaderBar", "unnamed": 1 } o_listView_ListView = {"container": o_Gui_MainView, "id": "_listView", "type": "ListView", "unnamed": 1 } o_listView_delegateControl = {"container": o_listView_ListView, "index": 2, "objectName": "delegateControl", "type": "Item" } o_Settings_Menu = {"container": o_listView_delegateControl, "objectName": "_touchRect2", "type": "TouchRect" } @@ -224,23 +226,33 @@ o_preTreatmentStack_Text = {"container": o_preTreatmentStack_PreTreatmentStack, "type": "Text", "unnamed": 1 } o_preTreatmentStack_stepIndicator_StepIndicator = {"container": o_preTreatmentStack_PreTreatmentStack, "id": "_stepIndicator", "type": "StepIndicator", "unnamed": 1 } +#Service +o_SettingsStack_SettingsStack = {"container": o_Gui_MainView, "objectName": "_SettingsStack", "type": "SettingsStack", } +o_UserConfirmation_SettingsServicePassword = {"container": o_SettingsStack_SettingsStack, "objectName": "UserConfirmation", "type": "SettingsServicePassword", } +o_userConfirmation_TextInput = {"container": o_UserConfirmation_SettingsServicePassword, "echoMode": 2, "id": "_input", "passwordCharacter": "•", "type": "TextInput", "unnamed": 1 } +o_userConfirmation_ConfirmButton = {"container": o_UserConfirmation_SettingsServicePassword, "objectName": "_confirmButton", "type": "ConfirmButton", } # Service Institutional -o_Row_Object = { "id": "_row", "type": "Row", "unnamed": 1 } -o_SettingsBase_SettingsInstitutionalRecord = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsInstitutionalRecord", } -o_SettingsInstitutionalRecord_ListView = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_listView", "type": "ListView", "unnamed": 1 } -o_SettingsInstitutionalRecord_BackButton = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "_backButton", "type": "BackButton", } -o_SettingsInstitutionalRecord_NotificationBar= {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "NotificationBar", "type": "NotificationBarSmall", } -o_SettingsInstitutional_min_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_min", "type": "ValueAdjuster", "unnamed": 1 } -o_SettingsInstitutional_max_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_max", "type": "ValueAdjuster", "unnamed": 1 } -o_SettingsInstitutional_def_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_def", "type": "ValueAdjuster", "unnamed": 1 } -o_SettingsInstitutional_ConfirmButton = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "_confirmButton", "type": "ConfirmButton", } -o_SettingsBase_SettingsAdvancedInstitutional= {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsAdvancedInstitutional", } -o_SettingsAdvancedInstitutional_Notification= {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "NotificationBar", "type": "NotificationBarSmall", } -o_SettingsAdvancedInstitutional_ConfirmButton= {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "_confirmButton", "type": "ConfirmButton", } -o_SettingsAdvancedInstitutional_BackButton = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "_backButton", "type": "BackButton", } -o_SettingsAdvancedInstitutional_min_ValueAdjuster= {"container": o_SettingsBase_SettingsAdvancedInstitutional,"id": "_min", "type": "ValueAdjuster", "unnamed": 1 } -o_SettingsAdvancedInstitutional_max_ValueAdjuster= {"container": o_SettingsBase_SettingsAdvancedInstitutional,"id": "_max", "type": "ValueAdjuster", "unnamed": 1 } -o_SettingsAdvancedInstitutional_def_ValueAdjuster= {"container": o_SettingsBase_SettingsAdvancedInstitutional,"id": "_def", "type": "ValueAdjuster", "unnamed": 1 } -o_PreTreatmentCreate_leftArrow_IconButton = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_leftArrow", "type": "IconButton", "unnamed": 1 } -o_PreTreatmentCreate_rightArrow_IconButton = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_rightArrow", "type": "IconButton", "unnamed": 1 } \ No newline at end of file +o_Row_Object = { "id": "_row", "type": "Row", "unnamed": 1 } +o_SettingsBase_SettingsInstitutionalRecord = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsInstitutionalRecord", } +o_SettingsInstitutionalRecord_ListView = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_listView", "type": "ListView", "unnamed": 1 } +o_SettingsInstitutionalRecord_BackButton = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "_backButton", "type": "BackButton", } +o_SettingsInstitutionalRecord_NotificationBar = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_SettingsInstitutional_min_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_min", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsInstitutional_max_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_max", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsInstitutional_def_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_def", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsInstitutional_ConfirmButton = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "_confirmButton", "type": "ConfirmButton", } +o_SettingsBase_SettingsAdvancedInstitutional = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsAdvancedInstitutional", } +o_SettingsAdvancedInstitutional_Notification = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_SettingsAdvancedInstitutional_ConfirmButton = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "_confirmButton", "type": "ConfirmButton", } +o_SettingsAdvancedInstitutional_BackButton = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "_backButton", "type": "BackButton", } +o_SettingsAdvancedInstitutional_min_ValueAdjuster = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "id": "_min", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsAdvancedInstitutional_max_ValueAdjuster = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "id": "_max", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsAdvancedInstitutional_def_ValueAdjuster = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "id": "_def", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_leftArrow_IconButton = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_leftArrow", "type": "IconButton", "unnamed": 1 } +o_PreTreatmentCreate_rightArrow_IconButton = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_rightArrow", "type": "IconButton", "unnamed": 1 } + +o_PreTreatmentSampleStack_PreTreatmentWaterSample = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentSampleStack", "type": "PreTreatmentWaterSample", } +o_PreTreatmentSampleStack_button_TouchRect = {"container": o_PreTreatmentSampleStack_PreTreatmentWaterSample, "id": "_button", "type": "TouchRect", "unnamed": 1 } +o_preTreatmentStack_repeater_Repeater = {"container": o_preTreatmentStack_PreTreatmentStack, "id": "repeater", "type": "Repeater", "unnamed": 1 } + Index: suite_leahi/tst_service_institutional/test.py =================================================================== diff -u -rad95767c13bdee2e3577f52712e7c7366a1194df -r279e768763ca90eadc690f1c922889f8969e5e6f --- suite_leahi/tst_service_institutional/test.py (.../test.py) (revision ad95767c13bdee2e3577f52712e7c7366a1194df) +++ suite_leahi/tst_service_institutional/test.py (.../test.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) @@ -30,7 +30,7 @@ from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes, TDStandbyStates -td_simulator = TD_Messaging() +td_simulator = TD_Messaging() INSTITUTIONAL_CONFIGURATIONS = { "vBloodFlowMin": 80, "vBloodFlowMax": 210, @@ -139,7 +139,7 @@ 'vChlorineWaterSampleCheckMin': 15, 'vChlorineWaterSampleCheckMax': 480, 'vChlorineWaterSampleCheckDef': 140, - 'vWaterSampleTestResultRequiredDef': 0, + 'vWaterSampleTestResultRequiredDef': 1, } ADVANCED_INSTITUTIONAL_SETTINGS_PER_ROW = [ @@ -154,7 +154,6 @@ ] ADJUST_INSTITUTIONAL_RECORDS_REJECTION_REASONS = { - "vAccepted": 1, "vBloodFlowMinReason": 1, "vBloodFlowMaxReason": 1, "vBloodFlowDefReason": 1, @@ -215,12 +214,10 @@ "vSubVolumeDefReason": 0 } - ADJUST_ADVANCED_INSTITUTIONAL_SETTINGS_REJECTION_REASONS = { - "vAccepted": 1, - "vMinRORejectionRatioAlarmMaxRejectionReason": 0, - "vMinRORejectionRatioAlarmMinRejectionReason": 0, - "vMinRORejectionRatioAlarmDefRejectionReason": 0, + "vMinRORejectionRatioAlarmMaxRejectionReason": 1, + "vMinRORejectionRatioAlarmMinRejectionReason": 1, + "vMinRORejectionRatioAlarmDefRejectionReason": 1, "vDisinfectionFrequencyMinRejectionReason": 0, "vDisinfectionFrequencyMaxRejectionReason": 0, "vDisinfectionFrequencyDefRejectionReason": 0, @@ -242,11 +239,10 @@ "vWaterSampleTestResultRequiredDefRejectionReason": 0 } - ADVANCED_INSTITUTIONAL_SETTINGS_PARAMETER_RANGE = { - "vMinRORejectionRatioAlarmMin" : [0], - "vMinRORejectionRatioAlarmMax" : [0], - "vMinRORejectionRatioAlarmDef" : [0], + "vMinRORejectionRatioAlarmMin" : [2], + "vMinRORejectionRatioAlarmMax" : [8], + "vMinRORejectionRatioAlarmDef" : [3], } MINIMUM_RO_REJECTION_RATIO_ALARM_MIN = "vMinRORejectionRatioAlarmMin" MINIMUM_RO_REJECTION_RATIO_ALARM_MAX = "vMinRORejectionRatioAlarmMax" @@ -266,6 +262,11 @@ BLOOD_FLOW_RATE_MIN = "vBloodFlowMin" BLOOD_FLOW_RATE_MAX = "vBloodFlowMax" BLOOD_FLOW_RATE_DEF = "vBloodFlowDef" +INSTITUTIONAL_CONFIGURATIONS_BLOOD_FLOW_CUSTOM_VALUES = { + "vBloodFlowMin": 100, + "vBloodFlowMax": 200, + "vBloodFlowDef": 150, + } def scroll_to_next_rows(): @@ -421,7 +422,7 @@ ), ) td_simulator.td_advanced_institutional_response( - vRejectionReason=1, **ADVANCED_INSTITUTIONAL_SETTINGS + vRejectionReason=0, **ADVANCED_INSTITUTIONAL_SETTINGS ) for row_index in range(0, 7): @@ -448,7 +449,9 @@ str(expected_value), f"Comparison of Heparin Prescription '{key}' in Row {row_index}", ) - + td_simulator.td_advanced_institutional_response( + vRejectionReason=1, **ADVANCED_INSTITUTIONAL_SETTINGS + ) advanced_reject_notification = utility.get_object_from_names( names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 ) @@ -491,14 +494,15 @@ test.compare(2, digit_int, f"Rejection reason number comparison for reason {2}") test.log(f"Rejection reason text is {advanced_reject_notification_text}") - confirm_button = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_ConfirmButton, - "Error Missing Confirm Button", - 2000, - ) - td_simulator.td_Adjust_Advanced_Institutional_Records( + + td_simulator.td_Adjust_Advanced_Institutional_Records( vAccepted = 1, **ADJUST_ADVANCED_INSTITUTIONAL_SETTINGS_REJECTION_REASONS ) + confirm_button = utility.get_object_from_names( + names.o_SettingsAdvancedInstitutional_ConfirmButton, + "Error Missing Confirm Button", + 2000, + ) if confirm_button is not None: mouseClick(confirm_button) @@ -534,10 +538,7 @@ if advanced_modes_option is not None: mouseClick(advanced_modes_option) - - td_simulator.td_advanced_institutional_response( - vRejectionReason=2, **ADVANCED_INSTITUTIONAL_SETTINGS - ) + for ( minimum_ro_rejection_ratio_alarm ) in ADVANCED_INSTITUTIONAL_SETTINGS_PARAMETER_RANGE[ @@ -564,22 +565,27 @@ utility.set_value_based_on_target( names.o_SettingsAdvancedInstitutional_min_ValueAdjuster, minimum_ro_rejection_ratio_alarm ) + + confirm_button = utility.get_object_from_names( + names.o_SettingsAdvancedInstitutional_ConfirmButton, + "Error Missing Confirm Button", + 2000, + ) + if confirm_button is not None: + mouseClick(confirm_button) - advanced_reject_notification = utility.get_object_from_names( + advanced_confirm_notification = utility.get_object_from_names( names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 ) - advanced_reject_notification_text = str(advanced_reject_notification.text) - digit = re.sub(r"^.*?\[(\d+)\].*$", r"\1", advanced_reject_notification_text) + test.compare( + advanced_confirm_notification.text, + config.ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, + f"Confirm Advanced Institutional Settings Notification Text", + ) - if digit: - digit_int = int(float(digit)) - test.compare(2, digit_int, f"Rejection reason number comparison for reason {2}") - test.log(f"Rejection reason text is {advanced_reject_notification_text}") - - td_simulator.td_Adjust_Advanced_Institutional_Records( + td_simulator.td_Adjust_Advanced_Institutional_Records(vAccepted = 0, **ADJUST_ADVANCED_INSTITUTIONAL_SETTINGS_REJECTION_REASONS ) - confirm_button = utility.get_object_from_names( names.o_SettingsAdvancedInstitutional_ConfirmButton, "Error Missing Confirm Button", @@ -593,8 +599,8 @@ ) test.compare( advanced_confirm_notification.text, - config.ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, - f"Confirm Advanced Institutional Settings Notification Text", + config.ERROR_ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, + f"Confirm Advanced Institutional Settings Error Notification Text", ) back_button = utility.get_object_from_names( names.o_SettingsAdvancedInstitutional_BackButton, @@ -633,10 +639,12 @@ "{} screen is displayed and Comparison of Institutional Configurations Screen Title text".format( config.INSTITUTIONAL_CONFIGURATIONS_SCREEN_TITLE_TEXT ), - ) + ) + td_simulator.td_institutional_response( - vRejectionReason=2, **INSTITUTIONAL_CONFIGURATIONS + vRejectionReason=0, **INSTITUTIONAL_CONFIGURATIONS ) + for ( blood_flow_rate_default ) in INSTITUTIONAL_CONFIGURATIONS_PARAMETER_RANGE[BLOOD_FLOW_RATE_DEF]: @@ -657,15 +665,8 @@ utility.set_value_based_on_target( names.o_SettingsInstitutional_max_ValueAdjuster, blood_flow_rate_maximum ) - - for ( - blood_flow_rate_default - ) in INSTITUTIONAL_CONFIGURATIONS_PARAMETER_RANGE[BLOOD_FLOW_RATE_DEF]: - utility.set_value_based_on_target( - names.o_SettingsInstitutional_def_ValueAdjuster, blood_flow_rate_default - ) - - td_simulator.td_Adjust_Institutional_Records( + + td_simulator.td_Adjust_Institutional_Records(vAccepted = 1, **ADJUST_INSTITUTIONAL_RECORDS_REJECTION_REASONS ) @@ -676,7 +677,7 @@ ) if confirm_button is not None: mouseClick(confirm_button) - + institutional_confirm_notification = utility.get_object_from_names( names.o_SettingsInstitutionalRecord_NotificationBar, timeout_ms=3000 ) @@ -685,21 +686,28 @@ config.INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, f"Confirm Institutional Configurations Notification Text", ) - td_simulator.td_institutional_response( - vRejectionReason=2, **INSTITUTIONAL_CONFIGURATIONS + + td_simulator.td_Adjust_Institutional_Records(vAccepted = 0, + **ADJUST_INSTITUTIONAL_RECORDS_REJECTION_REASONS ) - institutional_reject_notification = utility.get_object_from_names( + + confirm_button = utility.get_object_from_names( + names.o_SettingsInstitutional_ConfirmButton, + "Error Missing Confirm Button", + 2000, + ) + if confirm_button is not None: + mouseClick(confirm_button) + + institutional_confirm_notification = utility.get_object_from_names( names.o_SettingsInstitutionalRecord_NotificationBar, timeout_ms=3000 ) - institutional_reject_notification_text = str(institutional_reject_notification.text) + test.compare( + institutional_confirm_notification.text, + config.ERROR_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, + f"Confirm Institutional Configurations Error Notification Text", + ) - digit = re.sub(r"^.*?\[(\d+)\].*$", r"\1", institutional_reject_notification_text) - - if digit: - digit_int = int(float(digit)) - test.compare(2, digit_int, f"Rejection reason number comparison for reason {2}") - test.log(f"Rejection reason text is {institutional_reject_notification_text}") - back_button = utility.get_object_from_names( names.o_SettingsInstitutionalRecord_BackButton, "Error Missing Back Button", @@ -774,7 +782,10 @@ config.INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, f"Confirm Institutional Configurations Notification Text", ) + combined_configs = {**INSTITUTIONAL_CONFIGURATIONS, **INSTITUTIONAL_CONFIGURATIONS_BLOOD_FLOW_CUSTOM_VALUES} + td_simulator.td_institutional_response(vRejectionReason=0, **combined_configs) + back_button = utility.get_object_from_names( names.o_SettingsInstitutionalRecord_BackButton, "Error Missing Back Button", @@ -794,8 +805,6 @@ td_simulator.td_operation_mode(TDOpModes.MODE_PRET.value) td_simulator.td_blood_set_auto_load_response(vRejectionReason = 0) navigation.navigation_pageIndicator_step(config.CREATERX) - mouseClick(waitForObject(names.o_PreTreatmentSampleStack_button_TouchRect, 2000)) - mouseClick(waitForObject(names.o_preTreatmentStack_confirmButton_ConfirmButton, 2000)) mouseClick(waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry, 2000)) waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry, 2000).text ="abcd" mouseClick(waitForObjectExists(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 2000)) @@ -807,8 +816,8 @@ "Comparison of Default Blood Flow Value", ) utility.set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 100) - left_arrow = waitForObject(names.o_PreTreatmentCreate_leftArrow_IconButton, 2000) - if left_arrow.enabled is not config.ENABLED: + left_arrow = findObject(names.o_PreTreatmentCreate_leftArrow_IconButton) + if not left_arrow.enabled: parent_obj = waitForObjectExists(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 2000) minimum_value = utility.findObjectById(parent_obj, "_text") test.compare( @@ -817,8 +826,8 @@ "Comparison of Default Blood Flow Value", ) utility.set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 200) - right_arrow = waitForObject(names.o_PreTreatmentCreate_rightArrow_IconButton, 2000) - if right_arrow.enabled is not config.ENABLED: + right_arrow = findObject(names.o_PreTreatmentCreate_rightArrow_IconButton) + if not right_arrow.enabled: parent_obj = waitForObject(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 2000) maxmum_value = utility.findObjectById(parent_obj, "_text") test.compare( @@ -828,7 +837,6 @@ ) test.endSection() - def main(): utils.tstStart(__file__) startApplication(utility.aut("-q"))