# Subject/Title: Misc SW Enhancements - SW - 02 - General Aesthetics - Q&R # # Functionalities: Testing items of HeaderBar Settings, SD Card and Diagnostics TD OpModes # # Steps: # 1 Start Leahi Application # 2 Get Settings Icon Image and Compare it, Log the Header Settings Pop up displayed # Get Settings Brightness and Volume Icon Images and Compare # 4 Verify Information Pop-up SD Card Section # 5 Log the Header Diagnostics Pop up displayed and Compare TD Op modes and Sub modes import names from configuration import config, utility from leahi_dialin.ui import utils from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes, TDStandbyStates from leahi_dialin.common.ui_defs import TXStates td_simulator = TD_Messaging() def headerbar_settings_popup(): """ Method to verify Settings Pop-up """ test.startSection("Verifying Settings pop-up") settings_icon_image = waitForObject(names.o_HeaderBar_Settings_iconImage, 3000) if settings_icon_image is not None: test.log("Settings Icon found in the Leahi UI") test.compare( str( waitForObjectExists( names.o_HeaderBar_Settings_iconImage, 3000 ).source.path ), "/images/iSettings", "Comparison of Settings Icon Image", ) # Click the Settings button headerbar_settings = waitForObjectExists(names.o_HeaderBar_SettingsButton, 3000) mouseClick(headerbar_settings) # Wait for popup to appear popup = waitForObjectExists(names.o_HeaderBar_Settings_Popup, 3000) # Verify popup is visible if popup.visible: test.log("Header Settings Pop up displayed successfully") else: test.log("Popup exists but is not visible") # The test environment is running the UI application in an Ubuntu OS within VMware, # where the Settings pop-up Brightness and Volume slider will not work in VM test.compare( str( waitForObjectExists( names.o_Settings_Popup_BrightnessImage, 3000 ).source.path ), "/images/iBrightness", "Comparison of Settings pop-up Brightness Icon Image", ) test.compare( str(waitForObjectExists(names.o_Settings_Popup_VolumeImage, 3000).source.path), "/images/iVolume", "Comparison of Settings pop-up Brightness Icon Image", ) test.endSection() def headerbar_information_popup_sd_card_section(): """ Method to verify Information Pop-up SD Card """ test.startSection("Verifying Information Pop-up SD Card Section") mouseClick(waitForObjectExists(names.o_InformationIconButton, 3000)) # Compare SD Card Section Contents for content in config.SD_CARD_SECTION_CONTENTS: obj = waitForObjectExists( utility.setObjectText(names.o_InformationParameters, content) ) test.compare( obj.text, content, f"Comparison of Information Pop-up SD Card Section Contents: {content}", ) test.endSection() def headerbar_diagnostics_popup(): """ Method to verify Diagnostics Pop-up TD Op Mode """ test.startSection("Verifying Diagnostics pop-up TD Op Mode") # Click the Settings button headerbar_diagnostics = waitForObjectExists(names.o_headerBar_HeaderBar, 3000) doubleClick(headerbar_diagnostics) # Wait for popup to appear popup = waitForObjectExists(names.o_HeaderBar_Diagnostics_Popup, 3000) # Verify popup is visible if popup.visible: test.log("Header Diagnostics Pop up displayed successfully") else: test.log("Popup exists but is not visible") td_opmode_column = waitForObjectExists( names.o_HeaderBar_Diagnostics_Popup_TDOpModeColumn, 3000 ) mouseClick(td_opmode_column) test.compare( td_opmode_column.title, config.OPMODE_TITLE, f"Comparison of Diagnostics Pop-up TD OpMode Title", ) td_opmode_text = waitForObjectExists( names.o_HeaderBar_Diagnostics_Popup_TDOpmode_Text, 3000 ) test.compare( td_opmode_text.text, config.OPMODE, f"Comparison of Diagnostics Pop-up TD OpMode Text", ) for mode in TDOpModes: td_simulator.td_operation_mode(mode.value, 0) td_opmode_value = waitForObject( utility.setObjectText( names.o_HeaderBar_Diagnostics_Popup_TDOpmodeData_Value, mode.value ), 3000, ) # Compare UI text to the expected mode value string test.compare( str(td_opmode_value.text), str(mode.value), f"Comparing TD Op mode Value: {mode.name}", ) td_op_submode_text = waitForObjectExists( names.o_HeaderBar_Diagnostics_Popup_TDOpmode_Submode_Text, 3000 ) test.compare( td_op_submode_text.text, config.SUBMODE, f"Comparison of Diagnostics Pop-up TD Op Sub Mode Text", ) for submode in TDStandbyStates: td_simulator.td_operation_mode(TDOpModes.MODE_STAN.value, submode.value) td_submode_value = waitForObject( utility.setObjectText( names.o_HeaderBar_Diagnostics_Popup_TDOpmode_Submode_Value, submode.value, ), 3000, ) # Compare UI text to the expected mode value string test.compare( str(td_submode_value.text), str(submode.value), f"Comparing TD Op Submode Value: {submode.name}", ) test.endSection() def main(): utils.tstStart(__file__) startApplication(utility.aut("-q")) headerbar_settings_popup() headerbar_information_popup_sd_card_section() headerbar_diagnostics_popup() utils.tstDone()