Chromium Code Reviews| Index: chrome/test/webdriver/webdriver_remote_tests.py |
| diff --git a/chrome/test/webdriver/webdriver_remote_tests.py b/chrome/test/webdriver/webdriver_remote_tests.py |
| index 1ff2b4461b7d035b49e34129fc302c06303605b1..cd9a826688f8a7f1d09a730764e6daabbea5ecf7 100644 |
| --- a/chrome/test/webdriver/webdriver_remote_tests.py |
| +++ b/chrome/test/webdriver/webdriver_remote_tests.py |
| @@ -140,6 +140,56 @@ class TestFindElement(RemoteWebDriverTest): |
| self.driver.find_element_by_id, "logocont") |
| +class testCookies(RemoteWebDriverTest): |
| + def testAddCookie(self): |
| + navigate(SEARCH) |
|
kkania
2011/01/28 23:25:59
this file seems to be broken; it doesn't run for m
Joe
2011/02/03 10:02:05
I added self. and this file runs for me, what erro
|
| + cookie_dict = {} |
| + cookie_dict["name"]= "chromedriver_cookie_test"; |
| + cookie_dict["value"] = "this is a test"; |
| + self.driver.add_cookie(cookie_dict) |
| + cookie_dict = None |
| + cookie_dict = self.driver.get_cookie("chromedriver_cookie_test") |
| + self.assertNotEqual(cookie_dict, None) |
| + self.assertEqual(cookie_dict["value"], "this is a test";); |
| + |
| + def testDeleteCookie(self): |
| + testAddCookie(); |
| + self.driver.delete_cookie("chromedriver_cookie_test") |
| + cookie_dict = self.driver.get_cookie("chromedriver_cookie_test") |
| + self.assertEqual(cookie_dict, None) |
| + |
| +class TestFindElement(RemoteWebDriverTest): |
| + def testFindByName(self): |
| + navigate(SEARCH) |
| + # Find the Google search button. |
| + q = self.driver.find_element_by_name("q") |
| + self.assertTrue(isinstance(q, WebElement)) |
| + # Trying looking for an element not on the page. |
| + self.assertRaises(NoSuchElementException, |
| + self.driver.find_elment_by_name, "q2") |
| + # Try to find the Google search button using the multiple find method. |
| + q = self.driver.find_elements_by_name("q") |
| + self.assertTrue(isinstance(q, list)) |
| + self.assertTrue(len(q), 1) |
| + self.assertTrue(isinstance(q[0], WebElement)) |
| + # Try finding something not on page, with multiple find an empty array |
| + # should return and no exception thrown. |
| + q = self.driver.find_elements_by_name("q2") |
| + assertTrue(q == []) |
| + # Find a hidden element on the page |
| + q = self.driver.find_element_by_name("oq") |
| + self.assertTrue(isinstance(q, WebElement)) |
| + |
| + def testFindElementById(self): |
| + navigate(SEARCH) |
| + # Find the padding for the logo near the search bar. |
| + elem = self.driver.find_element_by_id("logocont") |
| + self.assertTrue(isinstance(elem, WebElement)) |
| + # Look for an ID not there. |
| + self.assertRaises(NoSuchElementException, |
| + self.driver.find_element_by_id, "logocont") |
| + |
| + |
| class TestJavaScriptExecution(RemoteWebDriverTest): |
| """ Test the execute javascript ability of the remote driver""" |
| def testNoModification(self): |