def verifyInvalidTintsNotFound(driver, tint): if len( driver.find_elements( By.ID, "com.view.viewglass:id/tintImage_controlIV")) > 0: driver.find_element_by_id( "com.view.viewglass:id/tintImage_controlIV").click() if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1) elif len( driver.find_elements( By.ID, "com.view.viewglass:id/tintLevelNum_controlTV")) > 0: pass else: selectRandomTint(driver) commonFunctions.overridebutton(driver) if len( driver.find_elements( By.ID, "com.view.viewglass:id/tintImage_controlIV")) > 0: driver.find_element_by_id( "com.view.viewglass:id/tintImage_controlIV").click() if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1) currentTint = getCurrentTint(driver) for i in range(1, 5): if i != tint: tintStr = "//android.widget.TextView[@text='" + str(i) + "']" print( len(driver.find_elements(By.XPATH, tintStr)) == 0, "Incorrect tint was found. Tint found was " + str(currentTint))
def checkIfUserIsLoggedIn(driver, loginbool, user): """ Check if user needs to be logged in or logged out""" # user needs to be logged in isLoggedIn = isUserLoggedIn(driver) print("Logged in: ", isLoggedIn) if loginbool: if not isLoggedIn and user == 'RO': login(driver, config.users[user]['username'], config.users[user]['password']) elif not isLoggedIn: loginAndSelectSite(driver, config.users[user]['username'], config.users[user]['password'], config.sites['Default']) if common.foundAlert(driver): common.respondToAlert(driver, 0) if common.foundTour(driver): common.exitTour(driver) # if len(driver.find_elements(By.ID, "com.view.viewglass:id/view_btnTV")) > 0: # common.navIcon(driver) # User needs to be logged out else: if isLoggedIn: if common.foundAlert(driver): common.respondToAlert(driver, 0) if common.foundTour(driver): common.exitTour(driver) if len( driver.find_elements( By.ID, "com.view.viewglass:id/view_btnTV")) > 0: common.navIcon(driver) logout(driver) sleep(20) else: sleep(20)
def testRemoveDeleteZoneGroupForRO(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO') auth.login(self.driver, config.users['RO']['username'], config.users['RO']['password']) sleep(20) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/view_btnTV")) > 0: commonFunctions.navIcon(self.driver) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_zonesTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_zonesTV").click() else: raiseExceptions("Zones option in navigation menu is missing") if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_zonesTV"))): pass else: raiseExceptions("Zones heading is missing") foundZonegroupabc = False size = 0 location = 0 if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/listItemNameTV")) > 0: zonegroups = self.driver.find_elements( By.ID, "com.view.viewglass:id/listItemNameTV") for group in zonegroups: if group.text == "abc": foundZonegroupabc = True size = group.size location = group.location break if foundZonegroupabc: startx = location['x'] + size['width'] endx = location['x'] + size['width'] / 2 y = location['y'] + size['height'] / 2 self.driver.swipe(startx, y, endx, y, 3000) x = location['x'] + size['width'] - 10 self.driver.tap([(x, y)]) sleep(5) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/listItemNameTV")) > 0: zonegroups = self.driver.find_elements( By.ID, "com.view.viewglass:id/listItemNameTV") for group in zonegroups: if group.text == "abc": raiseExceptions("Zonegroup was not deleted")
def testUIComponentsOfProfileScreenForRO(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO') auth.login(self.driver, config.users['RO']['username'], config.users['RO']['password']) sleep(20) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/home_controlIV")) > 0: pass elif len( self.driver.find_elements( By.XPATH, "//android.widget.Button[@resource-id='com.view.viewglass:id/button_cancel']" )) > 0: site.selectSite(self.driver, config.users['RO']['testsite']) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/username_navigationTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/username_navigationTV").click() else: raiseExceptions("Profile option in navigation menu is missing") if WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_myProfileTV"))): pass else: raiseExceptions("Profile heading is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/startup_myProfileTV")) <= 0: raiseExceptions("Send Feedback tab is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/change_appserverIP_myProfileTV") ) <= 0: raiseExceptions("Change Appserver IP is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/tourPreferenceTV")) <= 0: raiseExceptions("Tour Preference is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/mobiledataTV")) <= 0: raiseExceptions("Cellular Data is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/signout_myProfileTV")) <= 0: raiseExceptions("Sign Out button is missing") self.driver.find_element_by_xpath( "//android.widget.TextView[@text='Sign Out']").click()
def clickTintLevelNum(driver): if len( driver.find_elements( By.ID, "com.view.viewglass:id/tintImage_controlIV")) > 0: driver.find_element_by_id( "com.view.viewglass:id/tintImage_controlIV").click() if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1) elif len( driver.find_elements( By.ID, "com.view.viewglass:id/tintLevelNum_controlTV")) > 0: pass else: selectRandomTint(driver) commonFunctions.overridebutton(driver) driver.find_element_by_id( "com.view.viewglass:id/tintImage_controlIV").click() if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1)
def testAddNewSceneWithMultipleTintEvents(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'CRUDO') auth.loginAndSelectSite(self.driver, config.users['CRUDO']['username'], config.users['CRUDO']['password'], config.sites['Default']) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 60).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_scenesTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_scenesTV").click() else: raiseExceptions("Scenes option in navigation menu is missing") WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/scene_headertext"))) commonFunctions.addbutton(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_scene_addTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/name_scene_addETV").send_keys( "newscene") self.driver.find_element_by_id( "com.view.viewglass:id/no_tint_eventTV").click() else: raiseExceptions("Add New Scene heading is missing") for i in range(0, 2): self.driver.find_element_by_id( "com.view.viewglass:id/add_tint_eventTV").click() self.driver.find_element_by_id( "com.view.viewglass:id/zone_add_TintEventTV").click() if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_repeatTV"))): self.driver.find_elements( By.ID, "com.view.viewglass:id/listItemNameTV")[0].click() else: raiseExceptions("Zone option led to the wrong screen") self.driver.find_element_by_id( "com.view.viewglass:id/tintLevel_scene_TintEventTV").click() if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_scene_selectTintTV"))): zones_and_scenes.selectRandomTint(self.driver) else: raiseExceptions("Tint Level option led to the wrong screen") commonFunctions.savebutton(self.driver) commonFunctions.savebutton(self.driver) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 1)
def testSelectSiteCancelFunctionality(self): """ Verify the functionality of the cancel button """ auth.checkIfUserIsLoggedIn(self.driver, 0, 'CRUDO') auth.login(self.driver, config.users['CRUDO']['username'], config.users['CRUDO']['password']) try: WebDriverWait(self.driver, 50).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/search_image_view"))) search = self.driver.find_element_by_id( "com.view.viewglass:id/search_image_view") search.click() search_text = self.driver.find_element_by_id( "com.view.viewglass:id/search_site_edit_text") # search for the site and press ENTER search_text.send_keys(config.sites['Default']) # self.self.driver.press_keycode(66) size = self.driver.find_element_by_id( "com.view.viewglass:id/viewLogoLL").size location = self.driver.find_element_by_id( "com.view.viewglass:id/viewLogoLL").location x = size['width'] / 2 y = location['y'] + size['height'] * 2 self.driver.tap([(x, y)]) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/viewLogoLL")) > 0: y = location['y'] + size['height'] * 2.5 self.driver.tap([(x, y)]) except TimeoutException: raiseExceptions("Failed to reach Select Site screen") try: WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.XPATH, "//android.widget.TextView[@text='Cancel']"))) if len( self.driver.find_elements( By.XPATH, "//android.widget.TextView[@text='Cancel']")) == 0: raiseExceptions("Cancel button was not found in time.") else: self.driver.find_element_by_xpath( "//android.widget.TextView[@text='Cancel']").click() except TimeoutException: raiseExceptions("Cancel button did not stop the process") if common.foundAlert(self.driver): common.respondToAlert(self.driver, 1)
def testEditZoneGroupForRO(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO') auth.login(self.driver, config.users['RO']['username'], config.users['RO']['password']) sleep(20) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/view_btnTV")) > 0: commonFunctions.navIcon(self.driver) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_zonesTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_zonesTV").click() else: raiseExceptions("Zones option in navigation menu is missing") if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_zonesTV"))): pass else: raiseExceptions("Zones heading is missing") if zones_and_scenes.findZonegroup(self.driver, "abc") == False: zones_and_scenes.quickCreateZonegroup(self.driver, "abc") zones_and_scenes.findZonegroup(self.driver, "abc") if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.XPATH, "//android.widget.TextView[@text='abc']"))): commonFunctions.editbutton(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_createZoneGrpTV"))): zones = self.driver.find_elements( By.ID, "com.view.viewglass:id/zone_item_select_zoneTV") zones[2].click() zones[3].click() commonFunctions.savebutton(self.driver) else: raiseExceptions("Edit button led to the wrong screen")
def quickCreateSchedule(driver): if WebDriverWait(driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/add_schdIV"))): commonFunctions.addbutton(driver) changeTint(driver) commonFunctions.savebutton(driver) WebDriverWait(driver, 30).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/scheduleTV"))) else: raiseExceptions("add schedule button is missing") if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1) sleep(5) commonFunctions.goback(driver)
def logout(driver): if common.foundAlert(driver): common.respondToAlert(driver, 0) common.navIcon(driver) if len( driver.find_elements( By.ID, "com.view.viewglass:id/username_navigationTV")) > 0: driver.find_element_by_id( "com.view.viewglass:id/username_navigationTV").click() else: raiseExceptions("Missing user profile option in navigation bar") if len( driver.find_elements( By.XPATH, "//android.widget.TextView[@text='Sign Out']")) > 0: driver.find_element_by_xpath( "//android.widget.TextView[@text='Sign Out']").click() else: raiseExceptions("Missing Sign Out button")
def getCurrentTint(driver): if len( driver.find_elements( By.ID, "com.view.viewglass:id/tintImage_controlIV")) > 0: driver.find_element_by_id( "com.view.viewglass:id/tintImage_controlIV").click() if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1) currentTint = driver.find_element_by_id( "com.view.viewglass:id/tintLevelNum_controlTV").text elif len( driver.find_elements( By.ID, "com.view.viewglass:id/tintLevelNum_controlTV")) > 0: currentTint = driver.find_element_by_id( "com.view.viewglass:id/tintLevelNum_controlTV").text else: currentTint = selectRandomTint(driver) commonFunctions.overridebutton(driver) return currentTint
def testCreateZoneGroupForRO(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO') auth.login(self.driver, config.users['RO']['username'], config.users['RO']['password']) sleep(20) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/home_controlIV")) > 0: pass elif len( self.driver.find_elements( By.XPATH, "//android.widget.Button[@resource-id='com.view.viewglass:id/button_cancel']" )) > 0: site.selectSite(self.driver, config.users['RO']['testsite']) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/view_btnTV")) > 0: commonFunctions.navIcon(self.driver) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_zonesTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_zonesTV").click() else: raiseExceptions("Zones option in navigation menu is missing") if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_zonesTV"))): pass else: raiseExceptions("Zones heading is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/actZone_addIV")) > 0: raiseExceptions("RO user is able to add a zonegroup")
def verifyValidTintFound(driver, tint): tintStr = "//android.widget.TextView[@text='" + str(tint) + "']" if len( driver.find_elements( By.ID, "com.view.viewglass:id/tintImage_controlIV")) > 0: driver.find_element_by_id( "com.view.viewglass:id/tintImage_controlIV").click() if commonFunctions.foundAlert(driver): commonFunctions.respondToAlert(driver, 1) currentTint = "" if len( driver.find_elements( By.ID, "com.view.viewglass:id/tintLevelNum_controlTV")) > 0: currentTint = driver.find_element_by_id( "com.view.viewglass:id/tintLevelNum_controlTV").text if driver.find_element_by_id( "com.view.viewglass:id/agent_controlTV").text == "IDLE": print("Unable to override tint. Mode is IDLE.") elif currentTint != str(tint): print("Actual tint is:", currentTint) raiseExceptions("Displayed tint is incorrect.")
def testAddTintEventExceptionHandling(self): auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO') commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 60).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_scenesTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_scenesTV").click() else: raiseExceptions("Scenes option in navigation menu is missing") WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/scene_headertext"))) firstScene = self.driver.find_elements( By.ID, "com.view.viewglass:id/parent_scene_item")[0] firstScene.click() WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/scene_Detail"))) commonFunctions.editbutton(self.driver) if WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/add_tint_eventTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/add_tint_eventTV").click() else: raiseExceptions("Add Tint Event button is missing") commonFunctions.savebutton(self.driver) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 1) else: raiseExceptions( "Missing exception handling for invalid input for Add Tint Event" )
def testAddNewSceneForRO(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO') auth.login(self.driver, config.users['RO']['username'], config.users['RO']['password']) sleep(20) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/home_controlIV")) > 0: pass elif len( self.driver.find_elements( By.XPATH, "//android.widget.Button[@resource-id='com.view.viewglass:id/button_cancel']" )) > 0: site.selectSite(self.driver, config.users['RO']['testsite']) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 60).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_scenesTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_scenesTV").click() else: raiseExceptions("Scenes option in navigation menu is missing") WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/scene_headertext"))) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/scene_addIconIV")) > 0: raiseExceptions("Bug: RO user is able to add a new scene") auth.logout(self.driver)
def testUIComponentsOfLoginScreen(self): """ Verify the UI components of login screen like logo, user credentials parameters """ if auth.isUserLoggedIn(self.driver): if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) auth.logout(self.driver) sleep(30) if len( self.driver.find_elements( By.XPATH, "//android.widget.TextView[@text='view']")) > 0: pass else: raiseExceptions("View logo is missing") if len( self.driver.find_elements( By.XPATH, "//android.widget.TextView[@text='Dynamic Glass']")) > 0: # If statement pass else: raiseExceptions("Dynamic Glass logo is missing") if WebDriverWait(self.driver, 30).until( EC.presence_of_element_located( (By.XPATH, "//android.widget.EditText[@index='0']"))): email = self.driver.find_element_by_xpath( "//android.widget.EditText[@index='0']") text = email.text if text != "Email": email.clear() if WebDriverWait(self.driver, 5).until( EC.presence_of_element_located( (By.XPATH, "//android.widget.EditText[@text='Email']"))): pass else: raiseExceptions(" Enter username field is missing") if WebDriverWait(self.driver, 5).until( EC.presence_of_element_located( (By.XPATH, "//android.widget.EditText[@text='Password']"))): pass else: raiseExceptions("Enter Password field is missing") if len( self.driver.find_elements( By.XPATH, "//android.view.View[@content-desc='Remember Me']")) > 0: pass elif len( self.driver.find_elements(By.CLASS_NAME, "android.widget.CheckBox")) > 0: pass else: raiseExceptions(" Remember me is missing on login screen") if len( self.driver.find_elements( By.XPATH, "//android.widget.Button[@content-desc='Login']")) > 0: pass else: raiseExceptions("unable to find login button")
def testUIUpdateAfterApplyingSceneSchedule(self): """ Create a scene schedule from scene screen and verify the entry with scene schedule in LiveView """ auth.checkIfUserIsLoggedIn(self.driver, 1, 'CRUDO') if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/title_LiveViewTV")) <= 0: commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_live_viewTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_live_viewTV").click() else: raiseExceptions( "LiveView option in navigation menu is missing") commonFunctions.checkLiveViewAccess(self.driver) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_scheduleTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_scheduleTV").click() else: raiseExceptions("Schedule option in navigation menu is missing") startTime = "" endTime = "" if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/scheduleTV"))): commonFunctions.addbutton(self.driver) control.changeTint(self.driver) self.driver.find_element_by_id( "com.view.viewglass:id/zone_scene_sel_selClsTypeTV").click() self.driver.find_element_by_xpath( "//android.widget.TextView[@text='SCENE']").click() startTime = datetime.strptime( self.driver.find_element_by_id( "com.view.viewglass:id/starts_value_schdSceneTintTV").text, '%I:%M %p') endTime = datetime.strptime( self.driver.find_element_by_id( "com.view.viewglass:id/ends_value_schdSceneTintTV").text, '%I:%M %p') commonFunctions.savebutton(self.driver) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 1) print("Unable to create scene") commonFunctions.goback(self.driver) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/navigation_live_viewTV"))): self.driver.find_element_by_id( "com.view.viewglass:id/navigation_live_viewTV").click() else: raiseExceptions("LiveView option in navigation menu is missing") timeOfMostRecentActivity = "" if WebDriverWait(self.driver, 10).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/time_liveViewTV"))): self.driver.find_elements( By.ID, "com.view.viewglass:id/time_liveViewTV")[0].click() timeOfMostRecentActivity = datetime.strptime( self.driver.find_elements( By.ID, "com.view.viewglass:id/time_liveViewTV")[0].text, '%I:%M %p') else: raiseExceptions("Bug: there are no tint activities in the list") if startTime < timeOfMostRecentActivity and timeOfMostRecentActivity < endTime: raiseExceptions( "Bug: The recently applied tint was not added to the list of tint activities" )
def testAboutForRO(self): auth.checkIfUserIsLoggedIn(self.driver, 0, 'RO') auth.login(self.driver, config.users['RO']['username'], config.users['RO']['password']) sleep(20) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/home_controlIV")) > 0: pass elif len( self.driver.find_elements( By.XPATH, "//android.widget.Button[@resource-id='com.view.viewglass:id/button_cancel']" )) > 0: site.selectSite(self.driver, config.users['RO']['testsite']) if commonFunctions.foundAlert(self.driver): commonFunctions.respondToAlert(self.driver, 0) commonFunctions.navIcon(self.driver) if WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/settingIcon_navigationIV"))): self.driver.find_element_by_id( "com.view.viewglass:id/settingIcon_navigationIV").click() else: raiseExceptions("Settings option in navigation menu is missing") if WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_settingScreen_wallSwitchTV" ))): pass else: raiseExceptions("Settings heading is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/act_about_wallSwitchTV")) > 0: self.driver.find_element_by_id( "com.view.viewglass:id/act_about_wallSwitchTV").click() if WebDriverWait(self.driver, 20).until( EC.presence_of_element_located( (By.ID, "com.view.viewglass:id/title_settingTV"))): pass else: raiseExceptions("About Viewglass heading is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/application_settingTV")) <= 0: raiseExceptions("Application subheading is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/version_settingLL")) <= 0: raiseExceptions("Version is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/deviceid_settingLL")) <= 0: raiseExceptions("Show Device is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/masterController_settingsTV")) <= 0: raiseExceptions("Master Controller subheading is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/site_settingLL")) <= 0: raiseExceptions("Site is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/mode_settingLL")) <= 0: raiseExceptions("Mode is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/name_settingLL")) <= 0: raiseExceptions("Name is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/date_settingTV")) <= 0: raiseExceptions("Date setting is missing") size = self.driver.find_element_by_id( "com.view.viewglass:id/appInfoParentLL").size location = self.driver.find_element_by_id( "com.view.viewglass:id/appInfoParentLL").location self.driver.swipe(location['x'] + size['width'] / 2, location['y'] + size['height'] - 10, location['x'] + size['width'] / 2, location['y'] + 10, 2000) if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/time_settingLL")) <= 0: raiseExceptions("Time setting is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/setting_timeZoneLL")) <= 0: raiseExceptions("Timezone setting is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/setting_PltfrmVersionLL")) <= 0: raiseExceptions("Platform Version is missing") if len( self.driver.find_elements( By.ID, "com.view.viewglass:id/setting_DatabaseVersionLL")) <= 0: raiseExceptions("Database Version is missing")