def __init__(self, driver): self.driver = driver self.find_first_NE_of_Alarm_xpath = "//div[@class='elTablelib-Table-wrapper eb_scrollbar']//tr[1]//td[2]" self.fdn_value_xpath = "//dd[@class='eaAlarmdetails-AdditionalInformation-definitionListDefinition'][contains(text(),'NetworkElement=IVR')]" self.node_name = ReadInputData() self.node_text = self.node_name.read_ENM_Node() self.fdn_actual_text = self.node_name.read_fdn_value_to_compare()
def __init__(self, driver): self.driver = driver self.Network_xpath = "//div[@class=" + "elLayouts-QuickActionBar-left " + " and .//button[@class='ebBtn ebBtn_subtle elLayouts-PanelActionBar-button elLayouts-PanelActionBar-button_topology elLayouts-PanelActionBar-button_active']]" self.node_name = ReadInputData() self.node_text = self.node_name.read_ENM_Node() self.click_Find_button_xpath = "//div[@class='eaAlarmviewer-nodeSelection-list-default']//button[@class='ebBtn eaAlarmviewer-nodeList-searchPanel-find'][contains(text(),'Find')]" self.click_apply_button_xpath = "//button[contains(@class,'eaAlarmviewer-nodeSelection-footer-apply ebBtn ebBtn_color_paleBlue')]"
class ViewAlarmForNode: def __init__(self, driver): self.driver = driver self.find_first_NE_of_Alarm_xpath = "//div[@class='elTablelib-Table-wrapper eb_scrollbar']//tr[1]//td[2]" self.fdn_value_xpath = "//dd[@class='eaAlarmdetails-AdditionalInformation-definitionListDefinition'][contains(text(),'NetworkElement=IVR')]" self.node_name = ReadInputData() self.node_text = self.node_name.read_ENM_Node() self.fdn_actual_text = self.node_name.read_fdn_value_to_compare() def selectAlarmOpenInAnotherTab(self): get_first_element = self.driver.find_element_by_xpath( self.find_first_NE_of_Alarm_xpath) get_first_element.click( ) # This click will just select the first alarm action_chains = ActionChains(self.driver) action_chains.double_click(get_first_element).perform( ) # Perform Double-Click to open Alarm summary page in new tab. time.sleep(20) def alarmDetailsOnNewTab(self): print("These are list of total tabs: ", self.driver.switch_to.window) self.driver.switch_to.window(self.driver.window_handles[1]) fdn_text = self.driver.find_element_by_xpath(self.fdn_value_xpath).text print(fdn_text) if fdn_text == self.fdn_actual_text: print("Value match 100%") else: print("Value did not match")
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 __init__(self, driver): self.driver = driver self.applied_filter_on_NE_css = ".eaAlarmviewer-nodeSelection-footer-clearAll" self.add_topology_data_xpath = "//span[@class='ebBtn-caption']" self.search_tab_xpath = "//div[@class='ebTabs-tabArea']//div[2]//div[1]" self.input_node_search_xpath = "//input[@placeholder='Enter Search Criteria']" self.click_search_button_xpath = "//i[@class='elNetworkExplorerLib-rSimpleSearch-form-searchBtnIcon ebIcon ebIcon_searchWhite']" self.select_checkbox_node_name_xpath = "//div[@class='elTablelib-CheckboxCell-wrap']//input[@class='ebCheckbox']" self.click_add_button_xpath = "//button[@class='ebBtn ebBtn_medium ebBtn_color_paleBlue']//span[@class='ebBtn-caption'][contains(text(),'Add')]" self.node_name = ReadInputData() self.node_text = self.node_name.read_ENM_Node()
def test_2_login_with_valid_user_credential(self): driver = self.driver username = ReadInputData() 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) login.clickbutton() time.sleep(10)
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)
class ENMAddTopology: def __init__(self, driver): self.driver = driver self.applied_filter_on_NE_css = ".eaAlarmviewer-nodeSelection-footer-clearAll" self.add_topology_data_xpath = "//span[@class='ebBtn-caption']" self.search_tab_xpath = "//div[@class='ebTabs-tabArea']//div[2]//div[1]" self.input_node_search_xpath = "//input[@placeholder='Enter Search Criteria']" self.click_search_button_xpath = "//i[@class='elNetworkExplorerLib-rSimpleSearch-form-searchBtnIcon ebIcon ebIcon_searchWhite']" self.select_checkbox_node_name_xpath = "//div[@class='elTablelib-CheckboxCell-wrap']//input[@class='ebCheckbox']" self.click_add_button_xpath = "//button[@class='ebBtn ebBtn_medium ebBtn_color_paleBlue']//span[@class='ebBtn-caption'][contains(text(),'Add')]" self.node_name = ReadInputData() self.node_text = self.node_name.read_ENM_Node() def clearAppliedFilter(self): self.driver.find_element_by_css_selector(self.applied_filter_on_NE_css).click() time.sleep(10) def openTopologyDataWindow(self): self.driver.find_element_by_xpath(self.add_topology_data_xpath).click() time.sleep(10) def searchNode(self): self.driver.find_element_by_xpath(self.search_tab_xpath).click() time.sleep(5) self.driver.find_element_by_xpath(self.input_node_search_xpath).send_keys(self.node_text) # Input Node text to be searched. self.driver.find_element_by_xpath(self.click_search_button_xpath).click() # Click Search button time.sleep(10) def addFoundNode(self): self.driver.find_element_by_xpath(self.select_checkbox_node_name_xpath).click() self.driver.find_element_by_xpath(self.click_add_button_xpath).click() time.sleep(10)
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)
class RemoveNetwork: def __init__(self, driver): self.driver = driver self.Network_xpath = "//div[@class=" + "elLayouts-QuickActionBar-left " + " and .//button[@class='ebBtn ebBtn_subtle elLayouts-PanelActionBar-button elLayouts-PanelActionBar-button_topology elLayouts-PanelActionBar-button_active']]" self.node_name = ReadInputData() self.node_text = self.node_name.read_ENM_Node() self.click_Find_button_xpath = "//div[@class='eaAlarmviewer-nodeSelection-list-default']//button[@class='ebBtn eaAlarmviewer-nodeList-searchPanel-find'][contains(text(),'Find')]" self.click_apply_button_xpath = "//button[contains(@class,'eaAlarmviewer-nodeSelection-footer-apply ebBtn ebBtn_color_paleBlue')]" def searchNodeInNetwork(self): self.driver.find_element_by_xpath(self.NE_textbox_xpath).send_keys( self.node_text) # Input NE name to be searched. self.driver.find_element_by_xpath(self.click_Find_button_xpath).click( ) # Search to find NE that were added. def foundNodeInNetwork(self): self.driver.find_element_by_xpath(self.click_apply_button_xpath).click( ) # Apply the filter with NE selected. time.sleep(5)