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