Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8948)

Unified Diff: chrome/test/webdriver/chromedriver_tests.py

Issue 6723004: ChromeDriver should be able to focus on a frame using its frame element, (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/webdriver/WEBDRIVER_TESTS ('k') | chrome/test/webdriver/commands/find_element_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/chromedriver_tests.py
===================================================================
--- chrome/test/webdriver/chromedriver_tests.py (revision 79141)
+++ chrome/test/webdriver/chromedriver_tests.py (working copy)
@@ -26,6 +26,7 @@
import simplejson as json
+from selenium.webdriver.remote.command import Command
from selenium.webdriver.remote.webdriver import WebDriver
@@ -108,6 +109,14 @@
except urllib2.HTTPError, expected:
self.assertEquals(404, expected.code)
+ def testShouldReturn204ForFaviconRequests(self):
+ request_url = self._launcher.GetURL() + '/favicon.ico'
+ response = SendRequest(request_url, method='GET')
+ try:
+ self.assertEquals(204, response.code)
+ finally:
+ response.close()
+
def testCanStartChromeDriverOnSpecificPort(self):
launcher = ChromeDriverLauncher(port=9520)
self.assertEquals(9520, launcher.GetPort())
@@ -290,6 +299,31 @@
self.assertEquals(data['sessionId'], url_parts[4])
kkania 2011/03/24 17:19:33 how about a test for switching to a frame by eleme
Jason Leyba 2011/03/24 17:27:53 There are some in the WebDriver python tests, whic
+# TODO(jleyba): Port this to WebDriver's own python test suite.
+class ElementEqualityTest(unittest.TestCase):
+ """Tests that the server properly checks element equality."""
+
+ def setUp(self):
+ self._launcher = ChromeDriverLauncher(root_path=os.path.dirname(__file__))
+ self._driver = WebDriver(self._launcher.GetURL(), {})
+
+ def tearDown(self):
+ self._driver.quit()
+ self._launcher.Kill()
+
+ def testElementEquality(self):
+ self._driver.get(self._launcher.GetURL() + '/test_page.html')
+ body1 = self._driver.find_element_by_tag_name('body')
+ body2 = self._driver.execute_script('return document.body')
+
+ # TODO(jleyba): WebDriver's python bindings should expose a proper API
+ # for this.
+ result = body1.execute(Command.ELEMENT_EQUALS, {
+ 'other': body2.id
+ })
+ self.assertTrue(result['value'])
+
+
if __name__ == '__main__':
unittest.main(module='chromedriver_tests',
testRunner=GTestTextTestRunner(verbosity=1))
« no previous file with comments | « chrome/test/webdriver/WEBDRIVER_TESTS ('k') | chrome/test/webdriver/commands/find_element_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698