def test_tables_fields(provider, test_item, soft_assert): navigate_to(test_item.obj, 'All') tb.select('List View') # NOTE: We must re-instantiate here table # in order to prevent StaleElementException or UsingSharedTables # TODO: Switch to widgetastic paged_tbl = PagedTable(table_locator="//div[@id='list_grid']//table") for row in paged_tbl.rows(): cell = row[ 2] # We're using indexing since it could be either 'name' or 'host' if cell: name = cell.text else: logger.error('Could not find NAME header on {}s list...'.format( test_item.obj.__name__)) continue for field in test_item.fields_to_verify: try: value = getattr(row, field) except AttributeError: soft_assert( False, '{}\'s list table: field not exist: {}'.format( test_item.obj.__name__, field)) continue soft_assert( value, '{}\'s list table: {} row - has empty field: {}'.format( test_item.obj.__name__, name, field))
def test_tables_fields(provider, test_item, soft_assert): navigate_to(test_item.obj, 'All') tb.select('List View') # NOTE: We must re-instantiate here table # in order to prevent StaleElementException or UsingSharedTables # TODO: Switch to widgetastic paged_tbl = PagedTable(table_locator="//div[@id='list_grid']//table") for row in paged_tbl.rows(): cell = row[2] # We're using indexing since it could be either 'name' or 'host' if cell: name = cell.text else: logger.error('Could not find NAME header on {}s list...' .format(test_item.obj.__name__)) continue for field in test_item.fields_to_verify: try: value = getattr(row, field) except AttributeError: soft_assert(False, '{}\'s list table: field not exist: {}' .format(test_item.obj.__name__, field)) continue soft_assert(value, '{}\'s list table: {} row - has empty field: {}' .format(test_item.obj.__name__, name, field))
def paged_table(self): _paged_table_template = '//div[@id="list_grid"]/div[@class="{}"]/table/tbody' return version.pick({ version.LOWEST: SplitPagedTable(header_data=(_paged_table_template.format("xhdr"), 1), body_data=(_paged_table_template.format("objbox"), 0)), "5.5": PagedTable('//table'), })
import random import itertools from cfme.common import SummaryMixin, Taggable from cfme.fixtures import pytest_selenium as sel from cfme.web_ui import toolbar as tb, paginator, match_location,\ PagedTable, CheckboxTable from cfme.containers.provider import details_page, Labelable from utils.appliance.implementations.ui import navigator, CFMENavigateStep,\ navigate_to from navmazing import NavigateToAttribute, NavigateToSibling from utils.appliance import Navigatable from functools import partial list_tbl = CheckboxTable(table_locator="//div[@id='list_grid']//table") paged_tbl = PagedTable(table_locator="//div[@id='list_grid']//table") match_page = partial(match_location, controller='container_routes', title='Routes') class Route(Taggable, Labelable, SummaryMixin, Navigatable): def __init__(self, name, project_name, provider, appliance=None): self.name = name self.project_name = project_name self.provider = provider Navigatable.__init__(self, appliance=appliance) def load_details(self, refresh=False): navigate_to(self, 'Details')
def paged_table(self): return PagedTable('//table')
match_location, Form, AngularSelect, Input, form_buttons, flash, paginator) from utils import version from utils.appliance import Navigatable from utils.appliance.implementations.ui import CFMENavigateStep, navigator, navigate_to from utils.log import logger from utils.wait import wait_for, TimedOutError create_tenant_form = Form( fields=[('prov_select', AngularSelect("ems_id")), ('name', Input('name')), ('save_button', { version.LOWEST: form_buttons.angular_save, '5.8': form_buttons.simple_save }), ('reset_button', form_buttons.reset)]) listview_pagetable = PagedTable(table_locator="//div[@id='list_grid']//table") listview_checktable = CheckboxTable( table_locator="//div[@id='list_grid']//table") cfg_btn = partial(tb.select, 'Configuration') pol_btn = partial(tb.select, 'Policy') match_page = partial(match_location, controller='cloud_tenant', title='Cloud Tenants') class Tenant(Navigatable): _param_name = "Tenant" def __init__(self, name, provider, appliance=None):