def get_algorithm_name_details_view(self): path = ('//div[@id="node_details"]/div/dl/dt[3]') existing_algorithm_name_details_view = sellib.elements_wait(self.driver, path) existing_algorithm_name_details_view_text = [name.text for name in existing_algorithm_name_details_view] print('this is the existing_algorithm_name_details_view_text: ') print existing_algorithm_name_details_view_text return existing_algorithm_name_details_view_text
def get_nodeid_list(self): node_elements = sellib.elements_wait(self.driver, '//div[@class="data_table_row"]') nodeid_list = [ element.get_attribute('data-model_id') for element in node_elements ] return nodeid_list
def random_load_balancer(driver): path = ('//div[@class="data_table_body"]/descendant::div[@class="data_table_cell name"]') time.sleep(10) lbaas_elements = sellib.elements_wait(driver, path) lbaas = random.choice(lbaas_elements) sellib.element_wait(lbaas, element_action='click')
def get_algorithm_name_details_view(self): path = ('//div[@id="node_details"]/div/dl/dt[3]') existing_algorithm_name_details_view = sellib.elements_wait( self.driver, path) existing_algorithm_name_details_view_text = [ name.text for name in existing_algorithm_name_details_view ] print('this is the existing_algorithm_name_details_view_text: ') print existing_algorithm_name_details_view_text return existing_algorithm_name_details_view_text
def get_flavors(self, section_number): """Find all the flavor elements for a particular column in the resize flavor table. Args: section_number -- int - completes the XPath for the various columns in the table. Returns: List of elements for a specific column (i.e. RAM or Disk) """ flavorpath = ('//div[@class="ck-widgets-split-menuitem-section ck-widgets-split-' 'menuitem-section-%s"]' % section_number) return sellib.elements_wait(self.driver, flavorpath)
def get_nodes(driver): """ Find all nodes (servers) on a page. Args: driver: object - WebDriver instance. Returns: List of node elements """ node_elements = sellib.elements_wait(driver, '//div[@class="node"]') return node_elements
def get_load_balancers(driver): """ Find all load balancers on a page. Args: driver: object - WebDriver instance. Returns: List of node elements """ load_balancer_elements = sellib.elements_wait(driver, '//div[@class="data_table_row"]') return load_balancer_elements
def get_flavors(self, section_number): """Find all the flavor elements for a particular column in the resize flavor table. Args: section_number -- int - completes the XPath for the various columns in the table. Returns: List of elements for a specific column (i.e. RAM or Disk) """ flavorpath = ( '//div[@class="ck-widgets-split-menuitem-section ck-widgets-split-' 'menuitem-section-%s"]' % section_number) return sellib.elements_wait(self.driver, flavorpath)
def add_server_size(driver): """ Find the list of server sizes and randomly select one. Args: driver: object - WebDriver object. Returns: server_size.text: string - text value associated with the size element randomly selected. """ path = ('//div[@class="resize-panel panel_menu"]/descendant::div[@class="ck-widgets-split-' 'menuitem-section ck-widgets-split-menuitem-section-0"]') size_flavor_elements = sellib.elements_wait(driver, path) server_size = random.choice(size_flavor_elements) server_size.click() return server_size.text
def add_server_os(driver): """ Find the list of OS flavors and randomly select one. Args: driver: object - WebDriver object. Returns: server_os.text: string - text value associated with the OS element randomly selected. """ path = ('//div[@class="rebuild_container"]/descendant::div[@class="ck-widgets-split-menuitem-' 'section ck-widgets-split-menuitem-section-0"]') time.sleep(10) os_flavor_elements = sellib.elements_wait(driver, path) server_os = random.choice(os_flavor_elements) sellib.element_wait(server_os, element_action='click') return server_os.text
def add_server_size(driver): """ Find the list of server sizes and randomly select one. Args: driver: object - WebDriver object. Returns: server_size.text: string - text value associated with the size element randomly selected. """ path = ( '//div[@class="resize-panel panel_menu"]/descendant::div[@class="ck-widgets-split-' 'menuitem-section ck-widgets-split-menuitem-section-0"]') size_flavor_elements = sellib.elements_wait(driver, path) server_size = random.choice(size_flavor_elements) server_size.click() return server_size.text
def add_server_os(driver): """ Find the list of OS flavors and randomly select one. Args: driver: object - WebDriver object. Returns: server_os.text: string - text value associated with the OS element randomly selected. """ path = ( '//div[@class="rebuild_container"]/descendant::div[@class="ck-widgets-split-menuitem-' 'section ck-widgets-split-menuitem-section-0"]') time.sleep(10) os_flavor_elements = sellib.elements_wait(driver, path) server_os = random.choice(os_flavor_elements) sellib.element_wait(server_os, element_action='click') return server_os.text
def get_loadbalancer_list(self): path = ('//div[@class="data_table_body"]/descendant::div[@class="data_table_cell name"]') return sellib.elements_wait(self.driver, path)
def get_protocolports(self): protocolportspath = ('//div[@class="data_table_body"]/descendant::div[@class="data_table_cell protocol_port"]') return sellib.elements_wait(self.driver, protocolportspath)