# Subject/Title: HeaderBar - SW - 02 - WiFi indicator - Q&R # # Functionalities: Testing items of HeaderBar WiFi Pop up # # Steps: # 1 Start Leahi Application # 2 Get WiFi Icon Image and Compare it # 3 Verify that the Header WiFi Pop up displayed # 4 Compare the WiFi Pop up textWiFi Connection Error # 5 Verify that the Total Data Field text matches the expected configuration text import names from configuration import config, utility from leahi_dialin.ui import utils def headerbar_wifi_popup(): """ Method to verify "WiFi" Pop-up """ test.startSection("Verifying WiFi pop-up") wifi_icon_image = waitForObject(names.o_HeaderBar_WiFi_IconImage, 2000) if wifi_icon_image is not None: test.log("WiFi Icon found in the Leahi UI") test.compare( str(waitForObjectExists(names.o_HeaderBar_WiFi_IconImage, 2000).source.path), "/images/iWifi", "Comparison of WiFi Icon Image", ) # Click the WiFi button headerbar_wifi_button = waitForObjectExists(names.o_HeaderBar_WiFi_IconButton) mouseClick(headerbar_wifi_button) # Wait for popup to appear popup = waitForObjectExists(names.o_HeaderBar_WiFi_Popup, 1000) # Verify popup is visible if popup.visible: test.log("Header WiFi 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 WiFi button is not enabled in the UI. So Comparing error message wifi_popup_text = waitForObjectExists( utility.setObjectText(names.o_HeaderBar_Wifi_PopuoParameters, config.WIFI_POPUP_TEXT) ) test.compare( wifi_popup_text.text, config.WIFI_POPUP_TEXT, "WiFi Pop up text should be {}".format(config.WIFI_POPUP_TEXT), ) test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME + "-q") headerbar_wifi_popup() utils.tstDone()