本文整理匯總了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("")