本文整理汇总了Python中unit.ewslib_testcase.LIB._get_via_dummy_class方法的典型用法代码示例。如果您正苦于以下问题:Python LIB._get_via_dummy_class方法的具体用法?Python LIB._get_via_dummy_class怎么用?Python LIB._get_via_dummy_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unit.ewslib_testcase.LIB
的用法示例。
在下文中一共展示了LIB._get_via_dummy_class方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify_elements_in_widget
# 需要导入模块: from unit.ewslib_testcase import LIB [as 别名]
# 或者: from unit.ewslib_testcase.LIB import _get_via_dummy_class [as 别名]
def verify_elements_in_widget(self, widget_name,dummy_class,expected_link_names,expected_ids):
links = LIB._get_via_dummy_class(dummy_class, widget_name=widget_name)
#verify link names
link_names = [link.text for link in links]
self.assertItemsEqual(expected_link_names, link_names)
#verify link IDs
link_ids = [link.get_attribute('id') for link in links]
self.assertItemsEqual(expected_ids, link_ids)
示例2: test_get_elements_via_dummy_class_with_no_widget_still_finds_elements_inside_widget
# 需要导入模块: from unit.ewslib_testcase import LIB [as 别名]
# 或者: from unit.ewslib_testcase.LIB import _get_via_dummy_class [as 别名]
def test_get_elements_via_dummy_class_with_no_widget_still_finds_elements_inside_widget(self):
self.navigate(data.PD_URL)
labels = LIB._get_via_dummy_class(DC.Label)
#list of labels that don't implmenet the for_ ID pattern to identify the associated control
#print "\n".join([lbl.text for lbl in labels if not lbl.get_attribute("id").startswith("for_")])
self.assertEquals(39, len(labels))
#ensure we find stuff like Title, Last name, first name that are in the Personal Data widget
from sets import Set
expected_Label_Names=Set(["Title","Last name","First name"])
actual_Label_Names =Set([lbl.text for lbl in labels])
self.assertTrue(expected_Label_Names.issubset(actual_Label_Names))
示例3: verify_elements_in_widget_by_attribute
# 需要导入模块: from unit.ewslib_testcase import LIB [as 别名]
# 或者: from unit.ewslib_testcase.LIB import _get_via_dummy_class [as 别名]
def verify_elements_in_widget_by_attribute(self, widget_name,dummy_class,attrib,expected_vals):
elements = LIB._get_via_dummy_class(dummy_class, widget_name=widget_name)
#verify attribute
attribs = [elem.get_attribute(attrib) for elem in elements]
self.assertItemsEqual(expected_vals, attribs)
示例4: test_get_label_via_dummy_class_no_widget
# 需要导入模块: from unit.ewslib_testcase import LIB [as 别名]
# 或者: from unit.ewslib_testcase.LIB import _get_via_dummy_class [as 别名]
def test_get_label_via_dummy_class_no_widget(self):
self.navigate(data.LOGIN_URL)
expected_labels=("User", "Password")
labels = LIB._get_via_dummy_class(DC.Label)
actual_labels = [lb.text for lb in labels]
self.assertItemsEqual(expected_labels,actual_labels)