OLD | NEW |
---|---|
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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1281 'page_with_frame.html') | 1281 'page_with_frame.html') |
1282 url = 'file://' + urllib.pathname2url(path) | 1282 url = 'file://' + urllib.pathname2url(path) |
1283 self._driver.Load(url) | 1283 self._driver.Load(url) |
1284 frame = self._driver.FindElement('id', 'frm') | 1284 frame = self._driver.FindElement('id', 'frm') |
1285 self._driver.SwitchToFrame(frame) | 1285 self._driver.SwitchToFrame(frame) |
1286 a = self._driver.FindElement('id', 'btn') | 1286 a = self._driver.FindElement('id', 'btn') |
1287 a.Click() | 1287 a.Click() |
1288 self.WaitForCondition(lambda: self._driver.IsAlertOpen()) | 1288 self.WaitForCondition(lambda: self._driver.IsAlertOpen()) |
1289 self._driver.HandleAlert(True) | 1289 self._driver.HandleAlert(True) |
1290 | 1290 |
1291 def testElementReference(self): | |
1292 self._driver.Load(self.GetHttpUrlForFile('/chromedriver/element_ref.html')) | |
1293 print self._driver.FindElement('id', 'link') | |
1294 print self._driver.FindElements('tag name', 'br') | |
samuong
2016/08/11 18:13:20
we should have a test that explicitly tests the w3
roisinmcl
2016/08/13 01:47:26
I added a statement in this test to check the leng
| |
1291 | 1295 |
1292 class ChromeDriverPageLoadTimeoutTest(ChromeDriverBaseTestWithWebServer): | 1296 class ChromeDriverPageLoadTimeoutTest(ChromeDriverBaseTestWithWebServer): |
1293 | 1297 |
1294 class _RequestHandler(object): | 1298 class _RequestHandler(object): |
1295 def __init__(self): | 1299 def __init__(self): |
1296 self.request_received_event = threading.Event() | 1300 self.request_received_event = threading.Event() |
1297 self.send_response_event = threading.Event() | 1301 self.send_response_event = threading.Event() |
1298 | 1302 |
1299 def handle(self, request): | 1303 def handle(self, request): |
1300 self.request_received_event.set() | 1304 self.request_received_event.set() |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2178 | 2182 |
2179 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( | 2183 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( |
2180 sys.modules[__name__]) | 2184 sys.modules[__name__]) |
2181 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) | 2185 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) |
2182 ChromeDriverTest.GlobalSetUp() | 2186 ChromeDriverTest.GlobalSetUp() |
2183 MobileEmulationCapabilityTest.GlobalSetUp() | 2187 MobileEmulationCapabilityTest.GlobalSetUp() |
2184 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) | 2188 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) |
2185 ChromeDriverTest.GlobalTearDown() | 2189 ChromeDriverTest.GlobalTearDown() |
2186 MobileEmulationCapabilityTest.GlobalTearDown() | 2190 MobileEmulationCapabilityTest.GlobalTearDown() |
2187 sys.exit(len(result.failures) + len(result.errors)) | 2191 sys.exit(len(result.failures) + len(result.errors)) |
OLD | NEW |