예제 #1
0
 def test_finds_nodes_by_the_given_css_selector(self):
     xpath = to_xpath(x.css("#preference p"))
     results = self.find_all(xpath)
     self.assertEqual(results[0].text, "allamas")
     self.assertEqual(results[1].text, "llama")
예제 #2
0
파일: simple.py 프로젝트: ofek/capybara.py
 def _find_css(self, css):
     xpath = to_xpath(x.css(css))
     return self._find_xpath(xpath)
예제 #3
0
 def test_is_composable(self):
     xpath = to_xpath(x.css("#moar").descendant("p"))
     results = self.find_all(xpath)
     self.assertEqual(results[0].text, "chimp")
     self.assertEqual(results[1].text, "flamingo")
예제 #4
0
 def _find_css(self, css):
     return self._find_xpath(to_xpath(x.css(css)))
예제 #5
0
 def test_finds_nodes_by_the_given_css_selector(self):
     xpath = to_xpath(x.css("#preference p"))
     results = self.find_all(xpath)
     self.assertEqual(results[0].text, "allamas")
     self.assertEqual(results[1].text, "llama")
예제 #6
0
 def test_is_composable(self):
     xpath = to_xpath(x.css("#moar").descendant("p"))
     results = self.find_all(xpath)
     self.assertEqual(results[0].text, "chimp")
     self.assertEqual(results[1].text, "flamingo")
예제 #7
0
 def _find_css(self, css):
     elements = self.browser.dom.xpath(to_xpath(x.css(css)))
     return [Node(self, element) for element in elements]