Example #1
0
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")
Example #2
0
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)
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)