Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r279e768763ca90eadc690f1c922889f8969e5e6f -rea332e15d3df5245676b6e5fb6f1a235e990c860 --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision ea332e15d3df5245676b6e5fb6f1a235e990c860) @@ -113,4 +113,24 @@ CREATERX = "Rx" NEXT = "Next" +#Device Settings Options +DEVICE_SETTINGS = "Device Settings" +ADVANCED_MODE = "Advanced Mode" +DEVICE_INFORMATION = "Device Information" +WI_FI = "Wi-Fi" +DEVICE_CLEANING = "Device Cleaning" +SERVICE = "Service" +EXPORT_LOGS = "Export Logs" +VOLUME_AND_BRIGHTNESS = "Volume And Brightness" +FEATURE_CONFIGURATIONS = "Feature Configurations" +ADVANCED_INSTITUTIONAL_SETTINGS = "Advanced Institutional Settings" +FACTORY_RESET = "Factory Reset" +ENABLE_ROOT_SSH = "Enable Root SSH" +INSTITUTIONAL_CONFIGURATIONS = "Institutional Configurations" +DATE_AND_TIME = "Date and Time" +LANGUAGE = "Language" +#Menu Bar +PRESCRIPTIONS = "Prescriptions" +TREATMENT = "Treatment" +SETTINGS = "Settings" Index: suite_leahi/shared/scripts/configuration/navigation.py =================================================================== diff -u -r279e768763ca90eadc690f1c922889f8969e5e6f -rea332e15d3df5245676b6e5fb6f1a235e990c860 --- suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) +++ suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision ea332e15d3df5245676b6e5fb6f1a235e990c860) @@ -4,24 +4,22 @@ from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes, TDStandbyStates from configuration import config, utility +from configparser import ConfigParser +from pathlib import Path td_simulator = TD_Messaging() def navigate_to_device_settings_screen(): """ - Method to navigate to "Service" screen + Method to navigate to "Device Settings" screen and Compare Device Settings screen title text """ td_simulator.td_operation_mode(TDOpModes.MODE_STAN.value, 0) - headerbar_container = squish.waitForObject(names.o_mainMenu_MainMenu, 2000) - settings_menu_object = utility.findChildByText( - headerbar_container, "Settings" - ) - if settings_menu_object is not None: - squish.mouseClick(settings_menu_object) + main_menu_container = squish.waitForObject(names.o_mainMenu_MainMenu, 2000) + squish.mouseClick(utility.findChildByText(main_menu_container, config.SETTINGS)) headerbar_container = squish.waitForObject(names.o_headerBar_HeaderBar, 2000) device_setting_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Device Settings" + headerbar_container, config.DEVICE_SETTINGS ) if device_setting_screen_headerbar_title_text is not None: test.compare( @@ -33,31 +31,37 @@ ) def navigate_to_device_settings_using_service_password(): + td_simulator.td_operation_mode(TDOpModes.MODE_STAN.value, 0) + main_menu_container = squish.waitForObject(names.o_mainMenu_MainMenu, 2000) + squish.mouseClick(utility.findChildByText(main_menu_container, config.SETTINGS)) + td_simulator.td_operation_mode(TDOpModes.MODE_SERV.value, 0) grid_container = squish.waitForObject(names.o_DeviceSettingsGrid) - service_option = utility.findChildByText(grid_container, "Service") + squish.mouseClick(utility.findChildByText(grid_container, config.SERVICE)) - if service_option is not None: - squish.mouseClick(service_option) - - headerbar_container = squish.waitForObject(names.o_headerBar_HeaderBar) - service_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Service" - ) - if service_screen_headerbar_title_text is not None: - test.compare( - service_screen_headerbar_title_text.text, - config.SERVICE_SCREEN_TITLE_TEXT, - "{} screen is displayed and Comparison of Device Settings Screen Title text".format( - config.SERVICE_SCREEN_TITLE_TEXT - ), - ) input_field = squish.waitForObject(names.o_userConfirmation_TextInput, 1000) squish.type(input_field, config.DEFAULT_SERVICE_PASSWORD_RAW) confirm_button = squish.waitForObject(names.o_userConfirmation_ConfirmButton, 1000) squish.mouseClick(confirm_button) +def get_ini_value(conf_path: str , section: str, key: str): + """ + Method to get the advanced option from the System.conf file + """ + path = Path(conf_path) + if not path.exists(): + raise FileNotFoundError(f"Not found: {path}") + parser = ConfigParser() + # Preserve case if needed: + # parser.optionxform = str + parser.read(path, encoding="utf-8") + if not parser.has_section(section): + raise KeyError(f"Section [{section}] not found in {path}") + if not parser.has_option(section, key): + raise KeyError(f"Key '{key}' not found in section [{section}]") + return parser.get(section, key) + def navigation_pageIndicator_step(vStep_name): """ Navigate to the specified page using the step indicator component. @@ -69,35 +73,30 @@ """ 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)) + stepId = squish.waitForObjectExists(names.o_preTreatmentStack_stepIndicator_StepIndicator) + stepnames = utility.findAllObjectsById(stepId, "_text") + value = get_ini_value("/home/denali/Public/luis/config/configurations/Settings/System.conf", section ="AdvancedMode", key ="AdvancedMode") + standard = stepnames[1:] + if value == "0": + standard = stepnames[3:] + 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") - 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)) + for input_field in standard: + 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) + if str(input_field.text) == vStep_name: + break + else: + Nextbutton = utility.setObjectText(obj =names.o_preTreatmentStack_Text, text =config.NEXT) + squish.mouseClick(Nextbutton) - test.endSection() + test.endSection() \ No newline at end of file Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -r279e768763ca90eadc690f1c922889f8969e5e6f -rea332e15d3df5245676b6e5fb6f1a235e990c860 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision ea332e15d3df5245676b6e5fb6f1a235e990c860) @@ -17,7 +17,7 @@ """ return " ".join(('leahi', *args)) -def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): +def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 3000): """ To get an object with try..except catching to prevent script errors when the object is not found on the GUI @param names_dict - the dictionary element from the names.py file (ie: names.some_variable_name_of_element) Index: suite_leahi/tst_service_institutional/test.py =================================================================== diff -u -r279e768763ca90eadc690f1c922889f8969e5e6f -rea332e15d3df5245676b6e5fb6f1a235e990c860 --- suite_leahi/tst_service_institutional/test.py (.../test.py) (revision 279e768763ca90eadc690f1c922889f8969e5e6f) +++ suite_leahi/tst_service_institutional/test.py (.../test.py) (revision ea332e15d3df5245676b6e5fb6f1a235e990c860) @@ -269,21 +269,6 @@ } -def scroll_to_next_rows(): - """ - Scroll down to view next set of rows using flick gesture - """ - try: - # Use flick gesture to scroll down - flick(waitForObject(names.o_SettingsInstitutionalRecord_ListView), 0, 943) - # Wait for scroll to complete and content to load - snooze(1) - return True - except Exception as e: - test.log(f"Scroll failed: {str(e)}") - return False - - def institutional_configurations_screen(): """ Navigate to Institutional Configuration screen and compare Title bar text, @@ -292,17 +277,12 @@ """ test.startSection("Navigating to 'Institutional Configurations' Screen") - grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - institutional_configurations_option = utility.findChildByText( - grid_container, "Institutional Configurations" - ) + device_settings_grid = waitForObject(names.o_DeviceSettingsGrid) + mouseClick(utility.findChildByText(device_settings_grid, config.INSTITUTIONAL_CONFIGURATIONS)) - if institutional_configurations_option is not None: - mouseClick(institutional_configurations_option) - - headerbar_container = waitForObject(names.o_headerBar_HeaderBar, 2000) + institutional_headerbar = waitForObject(names.o_headerBar_HeaderBar, 2000) institutional_configurations_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Institutional Configurations" + institutional_headerbar, config.INSTITUTIONAL_CONFIGURATIONS_SCREEN_TITLE_TEXT ) if institutional_configurations_screen_headerbar_title_text is not None: test.compare( @@ -315,21 +295,18 @@ td_simulator.td_institutional_response( vRejectionReason=1, **INSTITUTIONAL_CONFIGURATIONS ) - total_rows = 12 - rows_per_scroll = 12 + total_rows = 21 + rows_per_scroll = 13 verified_count = 0 - for row_index in range(0, total_rows): + for row_index in range(0, 13): row_object = utility.get_row_object( names.o_SettingsBase_SettingsInstitutionalRecord, row_index ) bullet_children = object.children(waitForObject(row_object)) + + expected_values = EXPECTED_VALUES_PER_ROW[row_index] - if row_index < len(EXPECTED_VALUES_PER_ROW): - expected_values = EXPECTED_VALUES_PER_ROW[row_index] - else: - expected_values = INSTITUTIONAL_CONFIGURATIONS - # Using zip() to iterate through children and the row's expected items for bullet_child, (key, expected_value) in zip( bullet_children, expected_values.items() @@ -350,16 +327,47 @@ ) verified_count += 1 - # Scroll after every 12 rows (0-11, then scroll, then 12-23, etc.) + # Scroll after 13 rows if (row_index + 1) % rows_per_scroll == 0 and (row_index + 1) < total_rows: test.log(f"Scrolling after row {row_index + 1}") - if not scroll_to_next_rows(): - test.log("Failed to scroll, stopping verification") - break - else: - test.log("Scroll completed, continuing with next batch") + flick(waitForObject(names.o_SettingsInstitutionalRecord_ListView), 0, 943) + snooze(1) + break + + expected_values_counter = 13 + + for index in range(6,14): + row_object = utility.get_row_object( + names.o_SettingsBase_SettingsInstitutionalRecord, index + ) + bullet_children = object.children(waitForObject(row_object)) + + expected_values = EXPECTED_VALUES_PER_ROW[expected_values_counter] + # Using zip() to iterate through children and the row's expected items + for bullet_child, (key, expected_value) in zip( + bullet_children, expected_values.items() + ): + value = utility.findObjectById(bullet_child, "_text") + if value: + # Format both values to handle decimal precision + actual_text = str(value.text) + expected_text = str(expected_value) + + actual_float = float(actual_text) + expected_float = float(expected_text) + # Format to 2 decimal places for comparison + test.compare( + f"{actual_float:.2f}", + f"{expected_float:.2f}", + f"Comparison of Institutional Configurations '{key}' in Row {index + 1}", + ) + verified_count += 1 + expected_values_counter +=1 + test.log(f"Verified {verified_count} out of {total_rows} rows") + flick(waitForObject(names.o_SettingsInstitutionalRecord_ListView), 0, -943) + snooze(1) for rejection_reason in range(1, 60): td_simulator.td_institutional_response( @@ -368,8 +376,7 @@ ) institutional_reject_notification = utility.get_object_from_names( - names.o_SettingsInstitutionalRecord_NotificationBar, - timeout_ms=3000 + names.o_SettingsInstitutionalRecord_NotificationBar ) institutional_reject_notification_text = str(institutional_reject_notification.text) @@ -381,14 +388,7 @@ f"Rejection reason number comparison for reason {rejection_reason}") 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", - 2000, - ) - if back_button is not None: - mouseClick(back_button) - + mouseClick(utility.get_object_from_names(names.o_SettingsInstitutionalRecord_BackButton)) test.endSection() @@ -401,17 +401,13 @@ """ test.startSection("Navigating to 'Advanced Institutional Settings' Screen") navigation.navigate_to_device_settings_using_service_password() - grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - advanced_modes_option = utility.findChildByText( - grid_container, "Advanced Institutional Settings" - ) + device_settings_grid = waitForObject(names.o_DeviceSettingsGrid, 2000) + mouseClick(utility.findChildByText(device_settings_grid, config.ADVANCED_INSTITUTIONAL_SETTINGS)) - if advanced_modes_option is not None: - mouseClick(advanced_modes_option) - - headerbar_container = waitForObject(names.o_headerBar_HeaderBar, 2000) + advanced_institutional_headerbar = waitForObject(names.o_headerBar_HeaderBar, 2000) advanced_institutional_settings_screen_headerbar_title_text = ( - utility.findChildByText(headerbar_container, "Advanced Institutional Settings") + utility.findChildByText(advanced_institutional_headerbar, + config.ADVANCED_INSTITUTIONAL_SETTINGS_SCREEN_TITLE_TEXT) ) if advanced_institutional_settings_screen_headerbar_title_text is not None: test.compare( @@ -453,7 +449,7 @@ vRejectionReason=1, **ADVANCED_INSTITUTIONAL_SETTINGS ) advanced_reject_notification = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 + names.o_SettingsAdvancedInstitutional_Notification ) advanced_reject_notification_text = str(advanced_reject_notification.text) digit = re.sub(r"^.*?\[(\d+)\].*$", r"\1", advanced_reject_notification_text) @@ -462,29 +458,16 @@ digit_int = int(float(digit)) test.compare(1, digit_int, f"Rejection reason number comparison for reason {1}") test.log(f"Rejection reason text is {advanced_reject_notification_text}") + + mouseClick(utility.get_object_from_names(names.o_SettingsAdvancedInstitutional_BackButton)) + mouseClick(utility.findChildByText(device_settings_grid, config.ADVANCED_INSTITUTIONAL_SETTINGS)) - back_button = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_BackButton, - "Error Missing Back Button", - 2000, - ) - if back_button is not None: - mouseClick(back_button) - - grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - advanced_modes_option = utility.findChildByText( - grid_container, "Advanced Institutional Settings" - ) - td_simulator.td_advanced_institutional_response( vRejectionReason=2, **ADVANCED_INSTITUTIONAL_SETTINGS ) - if advanced_modes_option is not None: - mouseClick(advanced_modes_option) - advanced_reject_notification = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 + names.o_SettingsAdvancedInstitutional_Notification ) advanced_reject_notification_text = str(advanced_reject_notification.text) digit = re.sub(r"^.*?\[(\d+)\].*$", r"\1", advanced_reject_notification_text) @@ -498,29 +481,17 @@ 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) + mouseClick(utility.get_object_from_names(names.o_SettingsAdvancedInstitutional_ConfirmButton)) advanced_confirm_notification = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 + names.o_SettingsAdvancedInstitutional_Notification ) test.compare( advanced_confirm_notification.text, config.ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, f"Confirm Advanced Institutional Settings Notification Text", ) - back_button = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_BackButton, - "Error Missing Back Button", - 2000, - ) - if back_button is not None: - mouseClick(back_button) + mouseClick(utility.get_object_from_names(names.o_SettingsAdvancedInstitutional_BackButton)) test.endSection() @@ -531,13 +502,8 @@ then Compare Advanced Institutional Settings records and preferences Notification Text """ test.startSection("Navigating to 'Advanced Institutional Settings' Values Adjust") - grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - advanced_modes_option = utility.findChildByText( - grid_container, "Advanced Institutional Settings" - ) - - if advanced_modes_option is not None: - mouseClick(advanced_modes_option) + device_settings_grid = waitForObject(names.o_DeviceSettingsGrid, 2000) + mouseClick(utility.findChildByText(device_settings_grid, config.ADVANCED_INSTITUTIONAL_SETTINGS)) for ( minimum_ro_rejection_ratio_alarm @@ -565,17 +531,11 @@ 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) + mouseClick(utility.get_object_from_names(names.o_SettingsAdvancedInstitutional_ConfirmButton)) + advanced_confirm_notification = utility.get_object_from_names( - names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 + names.o_SettingsAdvancedInstitutional_Notification ) test.compare( advanced_confirm_notification.text, @@ -586,13 +546,7 @@ 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", - 2000, - ) - if confirm_button is not None: - mouseClick(confirm_button) + mouseClick(utility.get_object_from_names(names.o_SettingsAdvancedInstitutional_ConfirmButton)) advanced_confirm_notification = utility.get_object_from_names( names.o_SettingsAdvancedInstitutional_Notification, timeout_ms=3000 @@ -602,13 +556,7 @@ 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, - "Error Missing Back Button", - 2000, - ) - if back_button is not None: - mouseClick(back_button) + mouseClick(utility.get_object_from_names(names.o_SettingsAdvancedInstitutional_BackButton)) test.endSection() @@ -620,17 +568,12 @@ records and preferences Notification Text and click Back button """ test.startSection("Navigating to 'Institutional Settings' And Adjust Values") - grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - institutional_configurations_option = utility.findChildByText( - grid_container, "Institutional Configurations" - ) + device_settings_grid = waitForObject(names.o_DeviceSettingsGrid) + mouseClick(utility.findChildByText(device_settings_grid, config.INSTITUTIONAL_CONFIGURATIONS)) - if institutional_configurations_option is not None: - mouseClick(institutional_configurations_option) - - headerbar_container = waitForObject(names.o_headerBar_HeaderBar, 2000) + institutional_headerbar = waitForObject(names.o_headerBar_HeaderBar, 2000) institutional_configurations_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Institutional Configurations" + institutional_headerbar, config.INSTITUTIONAL_CONFIGURATIONS_SCREEN_TITLE_TEXT ) if institutional_configurations_screen_headerbar_title_text is not None: test.compare( @@ -670,16 +613,10 @@ **ADJUST_INSTITUTIONAL_RECORDS_REJECTION_REASONS ) - 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) + mouseClick(utility.get_object_from_names(names.o_SettingsInstitutional_ConfirmButton)) institutional_confirm_notification = utility.get_object_from_names( - names.o_SettingsInstitutionalRecord_NotificationBar, timeout_ms=3000 + names.o_SettingsInstitutionalRecord_NotificationBar ) test.compare( institutional_confirm_notification.text, @@ -691,31 +628,18 @@ **ADJUST_INSTITUTIONAL_RECORDS_REJECTION_REASONS ) - 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) + mouseClick(utility.get_object_from_names(names.o_SettingsInstitutional_ConfirmButton)) institutional_confirm_notification = utility.get_object_from_names( - names.o_SettingsInstitutionalRecord_NotificationBar, timeout_ms=3000 + names.o_SettingsInstitutionalRecord_NotificationBar ) test.compare( institutional_confirm_notification.text, config.ERROR_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT, f"Confirm Institutional Configurations Error Notification Text", ) - back_button = utility.get_object_from_names( - names.o_SettingsInstitutionalRecord_BackButton, - "Error Missing Back Button", - 2000, - ) - if back_button is not None: - mouseClick(back_button) - + mouseClick(utility.get_object_from_names(names.o_SettingsInstitutionalRecord_BackButton)) test.endSection() @@ -729,14 +653,9 @@ test.startSection( "Navigating to 'Institutional Settings' Adjust Values and Verify it Create Rx Screen" ) - grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - institutional_configurations_option = utility.findChildByText( - grid_container, "Institutional Configurations" - ) + device_settings_grid = waitForObject(names.o_DeviceSettingsGrid) + mouseClick(utility.findChildByText(device_settings_grid, config.INSTITUTIONAL_CONFIGURATIONS)) - if institutional_configurations_option is not None: - mouseClick(institutional_configurations_option) - td_simulator.td_institutional_response( vRejectionReason=1, **INSTITUTIONAL_CONFIGURATIONS ) @@ -766,16 +685,10 @@ **ADJUST_INSTITUTIONAL_RECORDS_REJECTION_REASONS ) - 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) + mouseClick(utility.get_object_from_names(names.o_SettingsInstitutional_ConfirmButton)) institutional_confirm_notification = utility.get_object_from_names( - names.o_SettingsInstitutionalRecord_NotificationBar, timeout_ms=3000 + names.o_SettingsInstitutionalRecord_NotificationBar ) test.compare( institutional_confirm_notification.text, @@ -786,27 +699,17 @@ td_simulator.td_institutional_response(vRejectionReason=0, **combined_configs) - back_button = utility.get_object_from_names( - names.o_SettingsInstitutionalRecord_BackButton, - "Error Missing Back Button", - 2000, - ) - if back_button is not None: - mouseClick(back_button) + mouseClick(utility.get_object_from_names(names.o_SettingsInstitutionalRecord_BackButton)) td_simulator.td_operation_mode(TDOpModes.MODE_STAN.value) main_menu_container = waitForObject(names.o_mainMenu_MainMenu, 2000) - settings_menu_object = utility.findChildByText( - main_menu_container, "Treatment" - ) - if settings_menu_object is not None: - mouseClick(settings_menu_object) + mouseClick(utility.findChildByText(main_menu_container, config.TREATMENT)) # settings_menu_object = utility.findChildByText( mouseClick(waitForObject(names.o_createTreatmentRect_TouchRect, 2000)) 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_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry, 2000)) - waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry, 2000).text ="abcd" + waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry, 2000).text ="1234" mouseClick(waitForObjectExists(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 2000)) parent_obj = waitForObjectExists(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 2000) default_value = utility.findObjectById(parent_obj, "_text")