當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。