Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rc79559a8ecd6dc676c7aed956ba1a5d1e45534a0 -re8535a7e3c30daad306221dd3d0c822f6994d503 --- shared/scripts/configuration/utility.py (.../utility.py) (revision c79559a8ecd6dc676c7aed956ba1a5d1e45534a0) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision e8535a7e3c30daad306221dd3d0c822f6994d503) @@ -517,19 +517,12 @@ test.compare(step_title.color.name, config.ENABLED_COLOR) #To verify the step indicators of the current treatment screen elif page == treatment_step: - test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) - test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color, config.COMPLETE_COLOR) test.compare(step_title.color.name, config.ENABLED_COLOR) - test.verify(step_title.font.bold) #To verify the step indicators of the remaining treatment screens else: - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) - test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) - test.compare(step_title.color.name, config.INCOMPLETE_COLOR) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) test.compare(bullet_circle_color, config.CURRENT_COLOR) - test.compare(bullet_border_color, config.INCOMPLETE_COLOR) test.endSection() def verify_color_of_entry(entry, vital_parameter, input_field): Index: shared/scripts/names.py =================================================================== diff -u -r9ef78246744be74035d8521b7ee71dc84a623883 -re8535a7e3c30daad306221dd3d0c822f6994d503 --- shared/scripts/names.py (.../names.py) (revision 9ef78246744be74035d8521b7ee71dc84a623883) +++ shared/scripts/names.py (.../names.py) (revision e8535a7e3c30daad306221dd3d0c822f6994d503) @@ -337,7 +337,7 @@ # o_swipeview_image_Image = {"container": o_PreTreatmentBase_swipeview_SwipeView_2, "id": "_image", "source": "file:///home/denali/Projects/application/resources/settings//Instructions/44_water test pass fail v2.png", "type": "Image", "unnamed": 1, "visible": True} # Filter flush title object -o_PreTreatmentBase_Filter_Flush_Text = {"container": o_preTreatmentWaterSampleStack_PreTreatmentBase_TreatmentFlowBase, "text": "Filter Flush", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentBase_Filter_Flush_Text = {"container": o_preTreatmentWaterSampleStack_PreTreatmentBase_TreatmentFlowBase, "text": "Flushing Carbon Filters for Water Sample", "type": "Text", "unnamed": 1, "visible": True} # Filter Flush Progress bar object o_filter_flush_progress_main = {"container": o_preTreatmentWaterSampleStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_TimeText", "type": "TimeText", "visible": True} o_filter_flush_progress = {"container": o_preTreatmentWaterSampleStack_PreTreatmentBase_TreatmentFlowBase, "objectName": "_TimeCircle", "type": "TimeCircle", "visible": True} Index: suite.conf =================================================================== diff -u -r09c151304b448aecfed8a67c28800d161018641e -re8535a7e3c30daad306221dd3d0c822f6994d503 --- suite.conf (.../suite.conf) (revision 09c151304b448aecfed8a67c28800d161018641e) +++ suite.conf (.../suite.conf) (revision e8535a7e3c30daad306221dd3d0c822f6994d503) @@ -5,6 +5,6 @@ IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals tst_ui_alarms_list tst_ui_alarms_dialog tst_main_treatment_ultrafiltration tst_main_treatment_heparin tst_pre_treatment_priming pre_treatment_disposables pre_treatment_patient_connection tst_unhandled_message_log tst_instructions_poc tst_service_screen tst_cloud_sync_device_registration tst_rinseback_setup tst_recirculate tst_settings_information tst_cloud_sync - treatment_screen tst_dialin_logs tst_disinfection +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals tst_ui_alarms_list tst_ui_alarms_dialog tst_main_treatment_ultrafiltration tst_main_treatment_heparin tst_pre_treatment_priming pre_treatment_disposables pre_treatment_patient_connection tst_unhandled_message_log tst_instructions_poc tst_service_screen tst_cloud_sync_device_registration tst_rinseback_setup tst_recirculate tst_settings_information tst_cloud_sync - treatment_screen tst_dialin_logs tst_disinfection tst_service_menu VERSION=3 WRAPPERS=Qt Index: tst_pre_treatment_consumables/test.py =================================================================== diff -u -r2e73714b63ae5fd2ef8b5acca5043e136454feff -re8535a7e3c30daad306221dd3d0c822f6994d503 --- tst_pre_treatment_consumables/test.py (.../test.py) (revision 2e73714b63ae5fd2ef8b5acca5043e136454feff) +++ tst_pre_treatment_consumables/test.py (.../test.py) (revision e8535a7e3c30daad306221dd3d0c822f6994d503) @@ -136,7 +136,7 @@ test.log("consumable self test state =" + PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_COMPLETE_STATE.name) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_SELF_TEST_CONSUMABLE_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_COMPLETE_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, - prime_state=PreTreatmentPrimeStates.HD_PRIME_START_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_UF_VOL_STATE.value, + prime_state=PreTreatmentPrimeStates.HD_PRIME_WET_SELF_TESTS_STATE.value,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_UF_VOL_STATE.value, wet_selftests_state=PreTreatmentWetSelfTestStates.WET_SELF_TESTS_START_STATE.value, pretreatment_rsrvr_state=HDPreTreatmentReservoirMgmtStates.PRE_TREATMENT_RESERVOIR_MGMT_START_STATE.value) bicarb_indicator=utility.get_indicators(SCREEN_OBJ,config.BICARB_PUMP_CHECK_TEXT) acid_indicator=utility.get_indicators(SCREEN_OBJ,config.ACID_PUMP_CHECK_TEXT) Index: tst_pre_treatment_priming/test.py =================================================================== diff -u -rc79559a8ecd6dc676c7aed956ba1a5d1e45534a0 -re8535a7e3c30daad306221dd3d0c822f6994d503 --- tst_pre_treatment_priming/test.py (.../test.py) (revision c79559a8ecd6dc676c7aed956ba1a5d1e45534a0) +++ tst_pre_treatment_priming/test.py (.../test.py) (revision e8535a7e3c30daad306221dd3d0c822f6994d503) @@ -176,18 +176,16 @@ test.startSection("Passing {} state".format(state)) hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=PreTreatmentSubModes.HD_PRE_TREATMENT_PRIME_STATE.value, water_sample_state=PreTreatmentSampleWaterStates.SAMPLE_WATER_SETUP_STATE.value,consumables_self_test_state=PreTreatmentConsumableSelfTestStates.CONSUMABLE_SELF_TESTS_INSTALL_STATE.value, no_cartridge_self_test_state=PreTreatmentNoCartSelfTestStates.NO_CART_SELF_TESTS_HOME_IDLE_STATE.value,installation_state=PreTreatmentCartridgeInstallStates.CARTRIDGE_INSTALL_STATE.value, dry_self_test_state=PreTreatmentDrySelfTestsStates.DRY_SELF_TESTS_START_STATE.value, - prime_state=index,recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_USER_CONFIRM_STATE.value, + prime_state=index, + recirculate_state=PreTreatmentRecircStates.PRE_TREATMENT_RECIRC_STATE.value, patient_connection_state=PreTreatmentPatientConnectionStates.PRE_TREATMENT_PAT_CONN_WAIT_FOR_USER_CONFIRM_STATE.value, wet_selftests_state = PreTreatmentWetSelfTestStates.WET_SELF_TESTS_START_STATE.value, pretreatment_rsrvr_state = HDPreTreatmentReservoirMgmtStates.PRE_TREATMENT_RESERVOIR_MGMT_START_STATE.value) - if (state == "HD_PRIME_START_STATE") or (state == "HD_PRIME_WAIT_FOR_USER_START_STATE") : + if (state == "HD_PRIME_START_STATE") or (state == "HD_PRIME_WAIT_FOR_USER_START_STATE"): verify_indicators(None, config.PRIMING_STEPS) if state == "HD_PRIME_WAIT_FOR_USER_START_STATE": verify_start_priming_button(config.ENABLED) hd_simulator.cmd_send_pre_treatment_prime_start_response(config.ACCEPTED, 0) - else: - verify_start_priming_button(config.DISABLED) - verify_continue_button(config.DISABLED) elif (state == "HD_PRIME_SALINE_SETUP_STATE") or (state == "HD_PRIME_SALINE_PURGE_AIR_STATE") or (state == "HD_PRIME_SALINE_CIRC_BLOOD_CIRCUIT_STATE"): verify_indicators(config.BUSY, "Blood Circuit Priming") verify_start_priming_button(config.DISABLED) @@ -245,7 +243,6 @@ else: for step in steps: busy_indicator, check_indicator = get_indicators(step) - test.compare(busy_indicator.visible, config.NOT_VISIBLE, "No indicator should display next to the {}".format(step)) test.compare(check_indicator.visible, config.NOT_VISIBLE, "No indicator should display next to the {}".format(step)) test.endSection() @@ -333,4 +330,4 @@ utils.tstDone() - \ No newline at end of file + Index: tst_service_menu/test.py =================================================================== diff -u --- tst_service_menu/test.py (revision 0) +++ tst_service_menu/test.py (revision e8535a7e3c30daad306221dd3d0c822f6994d503) @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*-" +## +# Copyright (c) 2019-2023 Diality Inc. - All Rights Reserved. +# copyright +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, +# IN PART OR IN WHOLE, +# WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# file tst_settings_information +# date 10/07/2023 +# author Vy Duong + +import builtins +import names + +from configuration import application_init as application_init +from configuration import config, utility +from dialin.ui.hd_simulator import HDSimulator +from dialin.common.hd_defs import HDOpModes, HDStandbyStates +from dialin.ui import utils +from calendar import isleap + +hd_simulator = HDSimulator() + + +def service_text_obj(text): + names.o_service_home_text_obj["text"] = text + return names.o_service_home_text_obj + + +def settings_text_obj(text): + names.o_set_date_and_time_text_obj["text"] = text + return names.o_set_date_and_time_text_obj + + +def navigate_to_service_menu(): + """ + Method to navigate to "Service" screen + """ + test.startSection("Navigating to 'Service' menu") + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_SERV.value, sub_mode=HDStandbyStates.STANDBY_START_STATE.value) + utils.waitForGUI(0.5) + service_screen_text = waitForObjectExists(service_text_obj(config.SERVICE_SCREEN_TITLE_TEXT)) + test.compare(service_screen_text.text, config.SERVICE_SCREEN_TITLE_TEXT, "{} screen is displayed".format(config.SERVICE_SCREEN_TITLE_TEXT)) + test.compare(waitForObjectExists(names.o_service_text).text,config.SERVICE_TEXT, "{} screen is displayed".format(config.SERVICE_TEXT)) + mouseClick(waitForObjectExists(names.o_service_text)) + services_password_title = (waitForObjectExists(names.o_service_text_title).text) + test.compare(services_password_title, config.SERVICES_TITLE_TEXT, "{} should display once user is navigated to services password screen".format(config.SERVICES_TITLE_TEXT)) + utils.waitForGUI(0.5) + + #enter the password to access screen + test.log("Clicking on password entry field") + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_password_text_field)) + mouseClick(waitForObjectExists(names.o_switch_keyboard_to_keypad)) + password = config.DEFAULT_SERVICE_PASSWORD_RAW + type(waitForObject(names.o_password_text_field), str(password)) + confirm_button = (waitForObjectExists(names.o_service_confirm_btn).text) + test.compare(confirm_button, config.CONFIRM_TEXT, "Button text should be {}".format(config.CONFIRM_TEXT)) + mouseClick(waitForObjectExists(names.o_service_confirm_btn)) + utils.waitForGUI(0.5) + + # HD response to advance to the service menu + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_SERV.value, sub_mode=HDStandbyStates.STANDBY_START_STATE.value) + + test.endSection() + +def navigate_to_subscreen(whichScreenKey, expectedScreenTitle, titleObject): + """ + Method to navigate to the water input mode screen + @param whichScreenEnum : SERVICE_SCREEN_SUBSCREEN_INDEX + """ + test.startSection("Navigating 'Set Date And Time' screen") + utils.waitForGUI(0.5) + names.o_serviceScreen_subscreen_menu["occurrence"] = whichScreenKey + mouseClick(waitForObjectExists(names.o_serviceScreen_subscreen_menu)) + subscreenTitle = waitForObjectExists(titleObject) + test.compare(subscreenTitle.text, expectedScreenTitle, "{} should be displayed when user is navigated to 'Set Date And Time' screen".format(expectedScreenTitle)) + test.endSection() + + +def navigate_back_to_service_main_screen(): + test.startSection("Return to Service Screens") + mouseClick(waitForObject(names.o_SettingsBase_backbutton_service_information_mouseArea_MouseArea_2)) + utils.waitForGUI(0.5) + test.endSection() + +def test_water_input_subscreen(): + test.startSection("Navigating 'Set Date And Time' screen") + navigate_to_subscreen(config.SERVICE_SCREEN_SUBSCREEN_INDEX["WATER_INPUT_MODE_SUBSCREEN"], "Water Input Mode", names.o_SettingsBase_Water_Input_Mode_Text) + pure_water_mode_switch = waitForObject(names.o_SettingsBase_settingsRoInputSwitch_Switch) + test.compare(pure_water_mode_switch.checked, False, "Pure water mode switch value should be False") + utils.waitForGUI(0.5) + mouseClick(pure_water_mode_switch) + utils.waitForGUI(0.5) + test.compare(pure_water_mode_switch.checked, True, "Pure water mode switch value should be True") + navigate_back_to_service_main_screen() + test.endSection() + +def test_enable_root_ssh_screen(): + test.startSection(f"Navigating {config.SERVICES_ENABLE_ROOT_SSH_TITLE} screen") + navigate_to_subscreen(config.SERVICE_SCREEN_SUBSCREEN_INDEX["ENABLE_ROOT_SUBSCREEN"], config.SERVICES_ENABLE_ROOT_SSH_TITLE, names.o_SettingsBase_Enable_Root_SSH_Text) + + enable_root_ssh_options=[{"option_label": "Enable SSH Login", "option_switch": names.o_SettingsBase_settingsRootSSHAccess_SSHDSwitch_Switch}, + {"option_label": "Enable Root Login", "option_switch": names.o_SettingsBase_settingsRootSSHAccess_RootSwitch_Switch}] + + #traverse the options available to enable/disable on the "enable root ssh" screen + for index in range(0,len(enable_root_ssh_options), 1): + option_text = enable_root_ssh_options[index]["option_label"] + names.o_SettingsBase_Enable_Root_SSH_Screen_Text["text"] = option_text + try: + # option label text object + option_label_text_object = waitForObject(names.o_SettingsBase_Enable_Root_SSH_Screen_Text) + test.compare(option_label_text_object, option_text, f"{option_text} incorrect") + utils.waitForGUI(0.5) + + try: + option_switch_object = waitForObject(enable_root_ssh_options[index]["option_switch"]) + test.compare(option_switch_object.checked, False, f"{option_text} switch value should be False") + utils.waitForGUI(0.5) + mouseClick(option_switch_object) + utils.waitForGUI(0.5) + test.compare(option_switch_object.checked, True, f"{option_text} switch value should be True") + except LookupError: + test.fail(f"FAIL : Switch object for {option_text} not found") + + except LookupError: + test.fail(f"FAIL : Object for {option_text} not found") + + navigate_back_to_service_main_screen() + test.endSection() + +def main(): + utils.tstStart(__file__) + # TODO need to replace real scripts with mock scripts to get behavior + + application_init.setup_post_log_successful_start() + + startApplication(config.AUT_NAME+ " -l") + + navigate_to_service_menu() + + # test the subscreens + test_water_input_subscreen() + test_enable_root_ssh_screen() + + utils.tstDone() \ No newline at end of file