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

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

Issue 2230053002: [chromedriver] Added option to make element references W3C compliant. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed presubmit errors. Created 4 years, 4 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 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 json 9 import json
10 import math 10 import math
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 'page_with_frame.html') 1279 'page_with_frame.html')
1280 url = 'file://' + urllib.pathname2url(path) 1280 url = 'file://' + urllib.pathname2url(path)
1281 self._driver.Load(url) 1281 self._driver.Load(url)
1282 frame = self._driver.FindElement('id', 'frm') 1282 frame = self._driver.FindElement('id', 'frm')
1283 self._driver.SwitchToFrame(frame) 1283 self._driver.SwitchToFrame(frame)
1284 a = self._driver.FindElement('id', 'btn') 1284 a = self._driver.FindElement('id', 'btn')
1285 a.Click() 1285 a.Click()
1286 self.WaitForCondition(lambda: self._driver.IsAlertOpen()) 1286 self.WaitForCondition(lambda: self._driver.IsAlertOpen())
1287 self._driver.HandleAlert(True) 1287 self._driver.HandleAlert(True)
1288 1288
1289 def testElementReference(self):
1290 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/element_ref.html'))
1291 element = self._driver.FindElement('id', 'link')
1292 self._driver.FindElements('tag name', 'br')
1293 w3c_id_length = 36
1294 if (self._driver.w3c_compliant):
1295 print element._id
1296 self.assertEquals(len(element._id), w3c_id_length)
1289 1297
1290 class ChromeDriverPageLoadTimeoutTest(ChromeDriverBaseTestWithWebServer): 1298 class ChromeDriverPageLoadTimeoutTest(ChromeDriverBaseTestWithWebServer):
1291 1299
1292 class _RequestHandler(object): 1300 class _RequestHandler(object):
1293 def __init__(self): 1301 def __init__(self):
1294 self.request_received_event = threading.Event() 1302 self.request_received_event = threading.Event()
1295 self.send_response_event = threading.Event() 1303 self.send_response_event = threading.Event()
1296 1304
1297 def handle(self, request): 1305 def handle(self, request):
1298 self.request_received_event.set() 1306 self.request_received_event.set()
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2176 2184
2177 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( 2185 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
2178 sys.modules[__name__]) 2186 sys.modules[__name__])
2179 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) 2187 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter)
2180 ChromeDriverTest.GlobalSetUp() 2188 ChromeDriverTest.GlobalSetUp()
2181 MobileEmulationCapabilityTest.GlobalSetUp() 2189 MobileEmulationCapabilityTest.GlobalSetUp()
2182 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) 2190 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests)
2183 ChromeDriverTest.GlobalTearDown() 2191 ChromeDriverTest.GlobalTearDown()
2184 MobileEmulationCapabilityTest.GlobalTearDown() 2192 MobileEmulationCapabilityTest.GlobalTearDown()
2185 sys.exit(len(result.failures) + len(result.errors)) 2193 sys.exit(len(result.failures) + len(result.errors))
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/session_commands.cc ('k') | chrome/test/chromedriver/window_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698