Index: tst_service_screen/test.py =================================================================== diff -u -r6bb43117bca2673c5de877f5b70b094da344418a -r4800083679383c87221a7e55ad35f84b40ffb386 --- tst_service_screen/test.py (.../test.py) (revision 6bb43117bca2673c5de877f5b70b094da344418a) +++ tst_service_screen/test.py (.../test.py) (revision 4800083679383c87221a7e55ad35f84b40ffb386) @@ -17,6 +17,7 @@ from dialin.ui.hd_simulator import HDSimulator from dialin.common.hd_defs import HDOpModes, HDStandbyStates from dialin.ui import utils +from configuration import utility hd_simulator = HDSimulator() @@ -56,7 +57,7 @@ """ test.startSection("Navigating to 'Service' screen") hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_SERV.value, sub_mode=HDStandbyStates.STANDBY_START_STATE.value) - utils.waitForGUI(1) + utils.waitForGUI(0.5) device_settings_text = waitForObjectExists(settings_text_obj(config.SERVICE_TEXT)) test.compare(device_settings_text.text, config.SERVICE_TEXT, "{} screen is displayed".format(config.SERVICE_TEXT)) test.endSection() @@ -96,6 +97,7 @@ for services_parameter in config.SERVICES_PARAMETERS: services_par_text = waitForObjectExists(text_obj(services_parameter)) test.compare(services_par_text.text, services_parameter, "{} should be available under service tile".format(services_parameter)) + utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsBase_backbutton_service_information_mouseArea_MouseArea_2)) test.endSection() @@ -114,13 +116,13 @@ test.compare(brightness_text.text, config.BRIGHTNESS_TEXT,"Brightness title text should be {}".format(config.BRIGHTNESS_TEXT)) alarm_volume_text = waitForObjectExists(text_obj(config.ALARM_VOLUME_TEXT)) test.compare(alarm_volume_text.text, config.ALARM_VOLUME_TEXT,"Alarm Volume text should be {}".format(config.ALARM_VOLUME_TEXT)) - notification_text = waitForObjectExists(text_obj(config.NOTIFICATION_MESSAGE_TEXT)) - test.compare(notification_text.text, config.NOTIFICATION_MESSAGE_TEXT, "{} notification message is displayed and should be The response value is incorrect. [1007]".format(config.NOTIFICATION_MESSAGE_TEXT)) + # notification_text = waitForObjectExists(text_obj(config.NOTIFICATION_MESSAGE_TEXT)) + # test.compare(notification_text.text, config.NOTIFICATION_MESSAGE_TEXT, "{} notification message is displayed and should be The response value is incorrect. [1007]".format(config.NOTIFICATION_MESSAGE_TEXT)) back_btn = waitForObjectExists(text_obj(config.BACK_TEXT)) test.compare(back_btn.enabled , True, "Back button should be enabled") utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsBase_backbutton_service_vandb_mouseArea_MouseArea_3)) - utils.waitForGUI(1) + utils.waitForGUI(0.5) test.endSection() @@ -137,8 +139,6 @@ utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsBase_service_wifi_scan_button_mouseArea_MouseArea_2)) utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_input_TextInput)) - utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsHome_backbutton_mousearea_service_wifi)) test.endSection() @@ -156,8 +156,7 @@ utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsBase_service_bluetooth_cuff_scan_button_mouseArea_MouseArea_3)) mouseClick(waitForObjectExists(names.o_SettingsBase_service_bluetooth_cuff_scan_button_mouseArea_MouseArea_3)) - utils.waitForGUI(0.5) - test.compare(waitForObjectExists(names.o_SettingsBase_The_Bluetooth_cuff_pair_clear_error_1001_Text).text, config.BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT,"Notification Message Text must be {}".format(config.BLUETOOTH_CUFF_NOTIFICATION_MESSAGE_TEXT)) + mouseClick(waitForObjectExists(names.o_SettingsHome_backbutton_mousearea_service_bluetooth_cuff)) test.endSection() @@ -171,22 +170,8 @@ mouseClick(waitForObject(names.o_SettingsHome_mousearea_service_dg_cleaning)) for services_parameter in config.DG_CLEANING_PARAMETERS: services_par_text = waitForObjectExists(text_obj(services_parameter)) - test.compare(services_par_text.text, services_parameter, "{} should be available under Bluetooth Cuff title".format(services_parameter)) + test.compare(services_par_text.text, services_parameter, "{} should be available under ".format(services_parameter)) utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_MouseArea_waterflush_hr)) - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_MouseArea_waterflush_min)) - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_MouseArea_waterflush_cycle)) - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_MouseArea_3_heat_disinfrection_hr)) - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_MouseArea_4_heat_disinfrection_min)) - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_MouseArea_5_heat_disinfrection_cycle)) - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_service_dg_cleaning_button_mouseArea_MouseArea_4)) - utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsHome_backbutton_mousearea_service_dg_cleaning)) test.endSection() @@ -196,10 +181,9 @@ @return: (bool) - True - if export data list is present in dash board, else return False """ test.log("verification of storage data before exporting the data") - export_list_count = 0 export_list = object.children(waitForObjectExists(file_name))[0] - for child in object.children(export_list): - export_list_count += 1 + export_list_count = len(object.children(export_list)) + if export_list_count >= 1: return True else: @@ -209,23 +193,26 @@ def verify_export_logs_screen(): """ Method to verify the export logs screen + Note overall export log functionality is tested in tst_service_export_logs """ test.startSection("Verifying the the export logs screen") test.log("Navigating to service screen to export log screen") utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_SettingsHome_export_log_mouseArea_MouseArea)) test.compare(waitForObjectExists(names.o_export_logs_text).text,config.EXPORT_LOG_TEXT,"{} should be under export logs screen ".format(config.EXPORT_LOG_TEXT)) - log_status = get_storage_data_status(names.o_usb_folder_slider) - test.verify(log_status == False, "export data rectangles should not be filled with contents under USB drive.") - log_status = get_storage_data_status(names.o_SettingsBase_sdcFolderView_ListView) - test.verify(log_status == False, "export data rectangles should be not filled with contents under SD card.") - for option in range(len(config.EXPORT_LOGS_OPTIONS)): + + # TODO need to check whether these two verify checks are valid + # log_status = get_storage_data_status(names.o_usb_folder_slider) + # test.verify(log_status == False, "export data rectangles should not be filled with contents under USB drive.") + # log_status = get_storage_data_status(names.o_SettingsBase_sdcFolderView_ListView) + # test.verify(log_status == False, "export data rectangles should be not filled with contents under SD card.") - utils.waitForGUI(1) + for option in range(len(config.EXPORT_LOGS_OPTIONS)): + utils.waitForGUI(0.5) mouseClick(waitForObjectExists(names.o_combo_box)) export_option = waitForObjectExists(custom_object_for_export_log(config.EXPORT_LOGS_OPTIONS[option])) - utils.waitForGUI(1) + utils.waitForGUI(2) mouseClick(export_option) test.compare(config.EXPORT_LOGS_OPTIONS[option], waitForObjectExists(names.o_combo_box ).displayText, "User should able to select {}".format(config.EXPORT_LOGS_OPTIONS[option])) utils.waitForGUI(1) @@ -245,7 +232,7 @@ utils.waitForGUI(2) log_status = get_storage_data_status(names.o_usb_folder_slider) - test.verify(log_status == False, "export data rectangles should be empty after export button click under USB drive.") + test.verify(log_status == True, "export data rectangles should NOT be empty after export button click under USB drive.") log_status = get_storage_data_status(names.o_SettingsBase_sdcFolderView_ListView) test.verify(log_status == False, "export data rectangles should be empty after export button click under SD card.") @@ -260,51 +247,55 @@ test.log("verification of progress bar color after exporting data") test.compare(waitForObjectExists(names.o_SettingsBase_progressCircle_ProgressCircle).color.name, config.RED_COLOR,"{} color progress bar is displayed for sd-card".format(config.RED_COLOR)) test.compare(waitForObjectExists(names.o_SettingsBase_progressCircle_ProgressCircle_2).color.name, config.RED_COLOR,"{} color progress bar is displayed for usb-drive".format(config.RED_COLOR)) - + + mouseClick(waitForObjectExists(names.o_SettingsBase_backbutton_service_information_mouseArea_MouseArea_2)) test.endSection() - + +def verify_water_input_subscreen(): + expected_screen_title = "Water Input Mode" -def verify_device_shutdown(): - """ - verify shutdown button after clicking export button - """ - test.startSection("verification of system shutdown option") - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_SettingsBase_export_log_backButton_BackButton)) - test.compare(waitForObjectExists(names.o_keyboard_object).text, config.SHUTDOWN_BUTTON_TEXT, "User should able to click {}".format(config.SHUTDOWN_BUTTON_TEXT)) - utils.waitForGUI(1) - mouseClick(waitForObjectExists(names.o_SettingsHome_service_confirmButton_TouchRect)) - - #Power - #0x0100 - hd_simulator.cmd_send_poweroff_button_pressed() - mouseClick(waitForObjectExists(names.o_cancelTouch_TouchRect)) - hd_simulator.cmd_send_poweroff_button_pressed() - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_shutdownRect_TouchRect)) - #0x0E00 - #0x0E00 - hd_simulator.cmd_send_broadcast_poweroff_imminent() - utils.waitForGUI(2) + test.startSection("Navigating 'Water Input Mode' screen") + utils.waitForGUI(0.5) + service_subScreen_menu_element = utility.get_object_from_names(names.o_service_water_input_menu_element, error_message="subscreen menu element not found") + if service_subScreen_menu_element is not None: + mouseClick(service_subScreen_menu_element) + utils.waitForGUI(0.5) + subscreenTitle = utility.get_object_from_names(names.o_SettingsBase_Water_Input_Mode_Text, error_message=f"{expected_screen_title} object is missing") + if subscreenTitle is not None: + test.compare(subscreenTitle.text, expected_screen_title, "{} should be displayed when user is navigated to this screen".format(expected_screen_title)) + + pure_water_mode_switch = utility.get_object_from_names(names.o_SettingsBase_settingsRoInputSwitch_Switch, error_message = "RO Switch object not found") + if pure_water_mode_switch is not None: + 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") + + # done, go back to main screen + back_button_obj = utility.get_object_from_names(names.o_SettingsBase_backbutton_service_information_mouseArea_MouseArea_2, error_message = "Water input screen back button object missing") + if back_button_obj is not None: + mouseClick(back_button_obj) + utils.waitForGUI(0.5) test.endSection() - def main(): - + utils.tstStart(__file__) startApplication(config.AUT_NAME+ " -l") navigate_to_settings_screen() verify_settings_parameters() + verify_parameters_under_information() verify_volume_and_brightness_section() verify_wifi_setting() - + verify_bluetooth_cuff_setting() verify_dg_cleaning_setting() verify_export_logs_screen() verify_export_functionality() - verify_device_shutdown() - + verify_water_input_subscreen() + + #Note the protected service menu items (factory reset, decommission, etc) are in tst_service_menu + utils.tstDone() - -