当前位置: 首页>>代码示例>>Python>>正文


Python CheckboxTable.rows_as_list方法代码示例

本文整理汇总了Python中cfme.web_ui.CheckboxTable.rows_as_list方法的典型用法代码示例。如果您正苦于以下问题:Python CheckboxTable.rows_as_list方法的具体用法?Python CheckboxTable.rows_as_list怎么用?Python CheckboxTable.rows_as_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cfme.web_ui.CheckboxTable的用法示例。


在下文中一共展示了CheckboxTable.rows_as_list方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_search_bar

# 需要导入模块: from cfme.web_ui import CheckboxTable [as 别名]
# 或者: from cfme.web_ui.CheckboxTable import rows_as_list [as 别名]
def test_search_bar(provider, soft_assert):
    """ <object> summary page - Search bar
    This test checks Search bar functionality on every object summary page
    Steps:
        * Goes to <object> page
        * Inserts: Irregular symbol, '*' character, full search string, partial search string
        * Verify proper results
    """
    for obj in TEST_OBJECTS:
        rows = navigate_and_get_rows(provider, obj, 1)
        if not rows:
            pytest.skip('No Records Found in {} table. Could not test search. skipping...'
                        .format(obj))
        exist_member_str = choice(rows).name.text
        # Mapping the search string and the expected found result:
        search_strings_and_result = {
            '***': None,
            exist_member_str: exist_member_str,
            '$$$': None,
            exist_member_str[:len(exist_member_str) / 2]: exist_member_str
        }

        try:
            for search_string, result in search_strings_and_result.items():
                search.normal_search(search_string)
                # NOTE: We must re-instantiate here table
                # in order to prevent StaleElementException or UsingSharedTables
                list_tbl = CheckboxTable(table_locator="//div[@id='list_grid']//table")
                results_row_names = ([r.name.text for r in list_tbl.rows_as_list()]
                             if not sel.is_displayed_text("No Records Found.") else [])
                if result:
                    soft_assert(result in results_row_names,
                        'Expected to get result "{}" '
                        'for search string "{}". search results: {}'
                        .format(result, search_string, results_row_names))
                else:
                    soft_assert(not results_row_names,
                        'Unexpected result for search string "{}", '
                        'Should not find records, search results: "{}"'
                        .format(search_string, results_row_names))
        finally:
            # search.ensure_no_filter_applied() -> TimedOutError
            # https://github.com/ManageIQ/integration_tests/issues/4401
            search.normal_search("")
开发者ID:dajohnso,项目名称:cfme_tests,代码行数:46,代码来源:test_search_bar.py


注:本文中的cfme.web_ui.CheckboxTable.rows_as_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。