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

Unified Diff: chrome/test/functional/pyauto_webdriver.py

Issue 7634031: Let pyauto create an attached webdriver instance to manipulate web pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgot to re-add the previously added files Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/functional/pyauto_webdriver.py
diff --git a/chrome/test/functional/pyauto_webdriver.py b/chrome/test/functional/pyauto_webdriver.py
new file mode 100644
index 0000000000000000000000000000000000000000..b72570c5c009827e543ad3c1302802fc39eb80fb
--- /dev/null
+++ b/chrome/test/functional/pyauto_webdriver.py
@@ -0,0 +1,33 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import pyauto_functional
+import pyauto
+
+
+class PyAutoWebDriverTest(pyauto.PyUITest):
+ """Tests PyAuto-WebDriver integration."""
+
+ def testTypeIntoTextBox(self):
+ """Type into a text input box and verify its value."""
+ driver = self.NewWebDriver()
+ driver.get('about:blank')
+ driver.execute_script('document.body.innerHTML = "<input type=\'text\'>"')
+ input = driver.find_element_by_tag_name('input')
+ self.assertEquals('', input.get_attribute('value'))
+ input.send_keys('test')
+ self.assertEquals('test', input.get_attribute('value'))
+
+ def testCanConnectToRestartedBrowser(self):
+ """Restart the browser and connect again with WebDriver."""
+ driver = self.NewWebDriver()
+ self.RestartBrowser()
+ driver = self.NewWebDriver()
+ driver.get('about:blank')
+ self.assertEquals('about:blank', driver.title)
+
+
+if __name__ == '__main__':
+ pyauto_functional.Main()

Powered by Google App Engine
This is Rietveld 408576698