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

Side by Side Diff: chrome/test/chromedriver/run_py_tests.py

Issue 12764021: [chromedriver] Support clicking an element in sub frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """End to end tests for ChromeDriver.""" 6 """End to end tests for ChromeDriver."""
7 7
8 import base64 8 import base64
9 import ctypes 9 import ctypes
10 import optparse 10 import optparse
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 def GetHttpUrlForFile(file_path): 57 def GetHttpUrlForFile(file_path):
58 return ChromeDriverTest._http_server.GetUrl() + file_path 58 return ChromeDriverTest._http_server.GetUrl() + file_path
59 59
60 def setUp(self): 60 def setUp(self):
61 self._driver = chromedriver.ChromeDriver( 61 self._driver = chromedriver.ChromeDriver(
62 _CHROMEDRIVER_LIB, 62 _CHROMEDRIVER_LIB,
63 chrome_binary=_CHROME_BINARY, 63 chrome_binary=_CHROME_BINARY,
64 android_package=_ANDROID_PACKAGE) 64 android_package=_ANDROID_PACKAGE)
65 65
66 def testStartStop(self): 66 def testStartStop(self):
67 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/frame_test.html'))
kkania 2013/03/12 04:04:07 ?
chrisgao (Use stgao instead) 2013/03/12 17:41:18 Whoops, forgot to remove this...
68 iframe = self._driver.FindElement('tag name', 'iframe')
69 self._driver.ExecuteScript('arguments[0].src = "page_test.html";', iframe)
70 import pdb; pdb.set_trace()
71 self._driver.SwitchToFrame(iframe)
72 self.assertTrue(self._driver.ExecuteScript('return window.top != window'))
73 link = self._driver.FindElement('tag name', 'a')
74 import pdb; pdb.set_trace()
75 link.Click()
67 pass 76 pass
68 77
69 def testLoadUrl(self): 78 def testLoadUrl(self):
70 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/empty.html')) 79 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/empty.html'))
71 80
72 def testGetCurrentWindowHandle(self): 81 def testGetCurrentWindowHandle(self):
73 self._driver.GetCurrentWindowHandle() 82 self._driver.GetCurrentWindowHandle()
74 83
75 def _WaitForNewWindow(self, old_handles): 84 def _WaitForNewWindow(self, old_handles):
76 """ Wait until at least one new window is opened, and return a handle to a 85 """ Wait until at least one new window is opened, and return a handle to a
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 global _ANDROID_PACKAGE 438 global _ANDROID_PACKAGE
430 _ANDROID_PACKAGE = options.android_package 439 _ANDROID_PACKAGE = options.android_package
431 440
432 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( 441 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
433 sys.modules[__name__]) 442 sys.modules[__name__])
434 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) 443 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter)
435 ChromeDriverTest.GlobalSetUp() 444 ChromeDriverTest.GlobalSetUp()
436 result = unittest.TextTestRunner(stream=sys.stdout).run(tests) 445 result = unittest.TextTestRunner(stream=sys.stdout).run(tests)
437 ChromeDriverTest.GlobalTearDown() 446 ChromeDriverTest.GlobalTearDown()
438 sys.exit(len(result.failures) + len(result.errors)) 447 sys.exit(len(result.failures) + len(result.errors))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698