OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Tests for ChromeDriver. | 5 """Tests for ChromeDriver. |
6 | 6 |
7 If your test is testing a specific part of the WebDriver API, consider adding | 7 If your test is testing a specific part of the WebDriver API, consider adding |
8 it to the appropriate place in the WebDriver tree instead. | 8 it to the appropriate place in the WebDriver tree instead. |
9 """ | 9 """ |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 # Flaky on windows. See crbug.com/80295. | 200 # Flaky on windows. See crbug.com/80295. |
201 def DISABLED_testSendKeysNative(self): | 201 def DISABLED_testSendKeysNative(self): |
202 driver = self.GetNewDriver(NativeInputTest._CAPABILITIES) | 202 driver = self.GetNewDriver(NativeInputTest._CAPABILITIES) |
203 driver.get(self.GetTestDataUrl() + '/test_page.html') | 203 driver.get(self.GetTestDataUrl() + '/test_page.html') |
204 # Find the text input. | 204 # Find the text input. |
205 q = driver.find_element_by_name('key_input_test') | 205 q = driver.find_element_by_name('key_input_test') |
206 # Send some keys. | 206 # Send some keys. |
207 q.send_keys('tokyo') | 207 q.send_keys('tokyo') |
208 self.assertEqual(q.text, 'tokyo') | 208 self.assertEqual(q.text, 'tokyo') |
209 | 209 |
| 210 |
210 # Needs to run on a machine with an IME installed. | 211 # Needs to run on a machine with an IME installed. |
211 def DISABLED_testSendKeysNativeProcessedByIME(self): | 212 def DISABLED_testSendKeysNativeProcessedByIME(self): |
212 driver = self.GetNewDriver(NativeInputTest._CAPABILITIES) | 213 driver = self.GetNewDriver(NativeInputTest._CAPABILITIES) |
213 driver.get(self.GetTestDataUrl() + '/test_page.html') | 214 driver.get(self.GetTestDataUrl() + '/test_page.html') |
214 q = driver.find_element_by_name('key_input_test') | 215 q = driver.find_element_by_name('key_input_test') |
215 # Send key combination to turn IME on. | 216 # Send key combination to turn IME on. |
216 q.send_keys(Keys.F7) | 217 q.send_keys(Keys.F7) |
217 q.send_keys('toukyou') | 218 q.send_keys('toukyou') |
218 # Now turning it off. | 219 # Now turning it off. |
219 q.send_keys(Keys.F7) | 220 q.send_keys(Keys.F7) |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 self.assertTrue('INFO' in log, msg='INFO not in log: ' + log) | 795 self.assertTrue('INFO' in log, msg='INFO not in log: ' + log) |
795 | 796 |
796 | 797 |
797 class FileUploadControlTest(ChromeDriverTest): | 798 class FileUploadControlTest(ChromeDriverTest): |
798 """Tests dealing with file upload control.""" | 799 """Tests dealing with file upload control.""" |
799 | 800 |
800 def setUp(self): | 801 def setUp(self): |
801 super(FileUploadControlTest, self).setUp() | 802 super(FileUploadControlTest, self).setUp() |
802 self._driver = self.GetNewDriver() | 803 self._driver = self.GetNewDriver() |
803 | 804 |
804 def testSetFilePathToFileUploadControl(self): | 805 # Fails on win - crbug.com/131782 |
| 806 def DISABLED_testSetFilePathToFileUploadControl(self): |
805 """Verify a file path is set to the file upload control.""" | 807 """Verify a file path is set to the file upload control.""" |
806 self._driver.get(self.GetTestDataUrl() + '/upload.html') | 808 self._driver.get(self.GetTestDataUrl() + '/upload.html') |
807 | 809 |
808 file = tempfile.NamedTemporaryFile() | 810 file = tempfile.NamedTemporaryFile() |
809 | 811 |
810 fileupload_single = self._driver.find_element_by_name('fileupload_single') | 812 fileupload_single = self._driver.find_element_by_name('fileupload_single') |
811 multiple = fileupload_single.get_attribute('multiple') | 813 multiple = fileupload_single.get_attribute('multiple') |
812 self.assertEqual('false', multiple) | 814 self.assertEqual('false', multiple) |
813 fileupload_single.send_keys(file.name) | 815 fileupload_single.send_keys(file.name) |
814 path = fileupload_single.get_attribute('value') | 816 path = fileupload_single.get_attribute('value') |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 self._testExtensionView(driver, ext.get_popup_handle(), ext) | 1118 self._testExtensionView(driver, ext.get_popup_handle(), ext) |
1117 | 1119 |
1118 def testPageActionPopupView(self): | 1120 def testPageActionPopupView(self): |
1119 driver = self.GetNewDriver() | 1121 driver = self.GetNewDriver() |
1120 ext = driver.install_extension(self.PAGE_ACTION_EXTENSION) | 1122 ext = driver.install_extension(self.PAGE_ACTION_EXTENSION) |
1121 def is_page_action_visible(driver): | 1123 def is_page_action_visible(driver): |
1122 return ext.is_page_action_visible() | 1124 return ext.is_page_action_visible() |
1123 WebDriverWait(driver, 10).until(is_page_action_visible) | 1125 WebDriverWait(driver, 10).until(is_page_action_visible) |
1124 ext.click_page_action() | 1126 ext.click_page_action() |
1125 self._testExtensionView(driver, ext.get_popup_handle(), ext) | 1127 self._testExtensionView(driver, ext.get_popup_handle(), ext) |
OLD | NEW |