def test_multiple_elements(self):
     test_list = ['one string', 'another string']
     se = SeleniumElement(test_list, 'selector')
     self.assertEquals(se.replace('one', 'two'), 'two string')
     for i, elem in enumerate(se):
         self.assertEquals(elem, test_list[i])
示例#2
0
文件: sugar.py 项目: gothos/germanium
 def xpath(self, selector):
     return SeleniumElement(self.driver.find_elements_by_xpath(selector),
                            selector)
 def test_no_element_exception(self):
     se = SeleniumElement([], 'selector')
     with self.assertRaises(NoElementException):
         se.replace('one', 'two')
示例#4
0
文件: sugar.py 项目: gothos/germanium
 def css(self, selector):
     return SeleniumElement(
         self.driver.find_elements_by_css_selector(selector), selector)
示例#5
0
 def test_no_element_exception(self):
     se = SeleniumElement([], "selector")
     with self.assertRaises(NoElementException):
         se.replace("one", "two")
示例#6
0
 def test_multiple_elements(self):
     test_list = ["one string", "another string"]
     se = SeleniumElement(test_list, "selector")
     self.assertEquals(se.replace("one", "two"), "two string")
     for i, elem in enumerate(se):
         self.assertEquals(elem, test_list[i])
示例#7
0
 def test_multiple_elements(self):
     test_list = ['one string', 'another string']
     se = SeleniumElement(test_list, 'selector')
     self.assertEquals(se.replace('one', 'two'), 'two string')
     for i, elem in enumerate(se):
         self.assertEquals(elem, test_list[i])
示例#8
0
 def test_no_element_exception(self):
     se = SeleniumElement([], 'selector')
     with self.assertRaises(NoElementException):
         se.replace('one', 'two')