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