def test_3_click_on_Logon_Success_Page_After_Valid_login(self): driver = self.driver success_login = ENMLoginSuccessfulPage(driver) take_screen = TakeScreenShot(driver) take_screen.take_screen_shot("Logon_Page_To_Continue_Main_Page") success_login.clickSubmitButton() time.sleep(5)
def test_7_capture_complete_alarm_monitor_page(self): driver = self.driver take_screen = TakeScreenShot(driver) close_topology = driver.find_element_by_xpath( "//div[@class='elLayouts-QuickActionBar-left']") close_topology.click() driver.execute_script("document.body.style.zoom='70%'") take_screen.take_screen_shot("Alarm_Page") driver.execute_script("document.body.style.zoom='100%'") close_topology.click() driver.delete_all_cookies() driver.execute_script('localStorage.clear();') driver.delete_all_cookies() driver.execute_script('localStorage.clear();')
def test_6_Disable_Enable_Supervision_and_Sync_Take_ScreenShot(self): driver = self.driver supervision_sync = SupervisionAndSynchronizationRefresh(driver) take_screen = TakeScreenShot(driver) alarm_sync_confirm = ReadInputData() supervision_sync.disableSuperVision() take_screen.take_screen_shot("Disable_Supervision") print("Supervision has been disabled.") time.sleep(5) supervision_sync.enableSuperVision() take_screen.take_screen_shot("Enable_Supervision") print( "Supervision has been enabled. Checking if alarm Sync required or not." ) time.sleep(5) alarm_sync = alarm_sync_confirm.read_alarm_sync_required() if alarm_sync == "Y": print("Alarm Sync found for this Node. Sync will be executed.") supervision_sync.alarmSynchronize() print( "Alarm Sync done. Will wait for 15 sec to capture screen shot." ) time.sleep(15) take_screen.take_screen_shot("After_Sync") elif alarm_sync != "Y": print("Alarm Sync not asked.") pass
def test_6_Disable_Enable_Supervision_Generate_Trap_Browser_Refresh_Take_ScreenShot(self): driver = self.driver supervision_sync_refresh = SupervisionAndSynchronizationRefresh(driver) take_screen = TakeScreenShot(driver) supervision_sync_refresh.disableSuperVision() take_screen.take_screen_shot("Disable_Supervision") print("Supervision has been disabled.") time.sleep(5) supervision_sync_refresh.enableSuperVision() take_screen.take_screen_shot("Enable_Supervision") print("Supervision has been enabled.") time.sleep(5) print("Please Generate trap and confirm to proceed.") confirm_trap_generate = str(input("Please confirm once trap generated. Type 'y' and hit Enter. ")) if confirm_trap_generate == "y": time.sleep(2) supervision_sync_refresh.autoRefresh() take_screen.take_screen_shot("After_Refresh") print("Browser Refresh done and ScreenShot taken.") elif confirm_trap_generate != "y": print("Desired Input not found. Terminating the Test.") pass
def test_2_login_with_valid_user_credential(self): driver = self.driver username = ReadInputData() take_screen = TakeScreenShot(driver) login = ENMLogin(driver) user_name_text = username.read_ENM_User_Name() user_pass_text = username.read_ENM_User_Pass() login.enterUsername(user_name_text) login.enterUserPassword(user_pass_text) take_screen.take_screen_shot("Login_Input_Page") login.clickbutton() time.sleep(5)
def test_7_Open_All_Traps_Take_ScreenShot(self): driver = self.driver take_screen = TakeScreenShot(driver) trap_row = len( driver.find_elements_by_xpath( "//tbody[@class='elTablelib-Table-body']//tr") ) # This finder gives table length = total no of traps + 1 total_trap_row = trap_row - 1 print(total_trap_row) for trap in range(total_trap_row): first_to_last_trap = driver.find_element_by_xpath( "//div[@class='elTablelib-Table-wrapper eb_scrollbar']//tbody[1]/tr[" + str(trap + 1) + "]/td[2]").click() action_chains = ActionChains(driver) action_chains.double_click(first_to_last_trap).perform( ) # Perform Double-Click to open Alarm summary page in new tab. time.sleep(10) driver.switch_to.window(driver.window_handles[trap + 1]) driver.execute_script("document.body.style.zoom='50%'") time.sleep(40) take_screen.take_screen_shot("Trap_" + str(trap + 1) + "_1") scroll_down = driver.find_element_by_xpath( "//dt[contains(text(),'FMX Generated')]") action_chains.move_to_element(scroll_down) action_chains.perform() time.sleep(10) take_screen.take_screen_shot("Trap_" + str(trap + 1) + "_2") driver.execute_script("document.body.style.zoom='100%'") driver.switch_to.window(driver.window_handles[0])
def test_4_ENM_Main_Landing_Page_and_Click_Alarm_Monitor(self): driver = self.driver alarm_monitor = ENMMainLandingPage(driver) take_screen = TakeScreenShot(driver) take_screen.take_screen_shot("ENM_Application_Launcher_Page") alarm_monitor.clickAlarmMonitorLink() time.sleep(20) take_screen.take_screen_shot("Alarm_Monitor_Page")
def test_6_Disable_Enable_Supervision_Generate_Trap_Browser_Refresh_Take_ScreenShot( self): driver = self.driver supervision_sync_refresh = SupervisionAndSynchronizationRefresh(driver) take_screen = TakeScreenShot(driver) supervision_sync_refresh.disableSuperVision() time.sleep(5) take_screen.take_screen_shot("Disable_Supervision") print("Supervision has been disabled.") supervision_sync_refresh.enableSuperVision() time.sleep(5) take_screen.take_screen_shot("Enable_Supervision") print("Supervision has been enabled.") print("Please Generate traps. Script will wait for 3 minutes only....") time.sleep(180) print("3 minutes over. Starting to capture screenshots of all traps") supervision_sync_refresh.autoRefresh() take_screen.take_screen_shot("After_Refresh") print("Browser Refresh done.")
def test_6_Disable_Enable_Supervision_without_Sync_Take_ScreenShot(self): driver = self.driver supervision_sync = SupervisionAndSynchronizationRefresh(driver) take_screen = TakeScreenShot(driver) alarm_sync_confirm = ReadInputData() supervision_sync.disableSuperVision() take_screen.take_screen_shot("Disable_Supervision") print("Supervision has been disabled.") time.sleep(5) supervision_sync.enableSuperVision() take_screen.take_screen_shot("Enable_Supervision") print( "Supervision has been enabled. Checking if alarm Sync required or not." ) time.sleep(5)