예제 #1
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])
예제 #2
0
파일: sugar.py 프로젝트: gothos/germanium
 def xpath(self, selector):
     return SeleniumElement(self.driver.find_elements_by_xpath(selector),
                            selector)
예제 #3
0
 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')