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

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

Issue 7055004: File upload API in chromedriver (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added missing fixs and an additional test. Created 9 years, 7 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
Index: chrome/test/webdriver/chromedriver_tests.py
diff --git a/chrome/test/webdriver/chromedriver_tests.py b/chrome/test/webdriver/chromedriver_tests.py
index 94f15928e52866fc34e6044da3164ef9520670f3..a218211c1e743665e2094a3087efa47c393002d3 100755
--- a/chrome/test/webdriver/chromedriver_tests.py
+++ b/chrome/test/webdriver/chromedriver_tests.py
@@ -290,7 +290,7 @@ class CookieTest(unittest.TestCase):
cookie_dict = None
cookie_dict = self._driver.get_cookie("chromedriver_cookie_test")
cookie_dict = {}
- cookie_dict["name"]= "chromedriver_cookie_test"
+ cookie_dict["name"] = "chromedriver_cookie_test"
cookie_dict["value"] = "this is a test"
self._driver.add_cookie(cookie_dict)
cookie_dict = self._driver.get_cookie("chromedriver_cookie_test")
@@ -596,6 +596,28 @@ class AutofillTest(unittest.TestCase):
'Saved CC line item not same as what was entered.')
+class FileUploadControlTest(unittest.TestCase):
+ """Tests dealing with file upload control."""
+
+ def setUp(self):
+ self._launcher = ChromeDriverLauncher(root_path=os.path.dirname(__file__))
+ self._driver = WebDriver(self._launcher.GetURL(),
+ DesiredCapabilities.CHROME)
+
+ def tearDown(self):
+ self._driver.quit()
+ self._launcher.Kill()
+
+ def testSetFilePathToFileUploadControl(self):
+ """Verify a file path is set to the file upload control."""
+ self._driver.get(self._launcher.GetURL() + '/upload.html')
+
+ f = self._driver.find_element_by_name('fileupload')
+ f.send_keys('upload.html')
+ path = f.value
+ self.assertTrue(path.endswith('upload.html'))
kkania 2011/06/01 16:16:41 can you also have a test for multiple files? Or is
nodchip 2011/06/02 07:15:53 Done.
+
+
if __name__ == '__main__':
unittest.main(module='chromedriver_tests',
testRunner=GTestTextTestRunner(verbosity=1))

Powered by Google App Engine
This is Rietveld 408576698