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

Unified Diff: tools/testing/runSelenium.py

Issue 8469016: Adding in-browser correctness testing via selenium. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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: tools/testing/runSelenium.py
===================================================================
--- tools/testing/runSelenium.py (revision 0)
+++ tools/testing/runSelenium.py (revision 0)
@@ -0,0 +1,38 @@
+#!/usr/bin/python
Siggi Cherem (dart-lang) 2011/11/10 23:04:37 a few nits: - add license - rename the file to fit
+
+from selenium import webdriver
+import sys
+
+browser = webdriver.Firefox() # Get local session of firefox
+firefox_source = runTestInBrowser(browser)
+
+# Note: you need ChromeDriver in your path to run chrome, in addition to
+#installing Chrome.
+# TODO(efortuna): Currently disabled for ease of setup for running on other
+# developer machines. Uncomment when frog is robust enough to be tested on
+# multiple platforms at once.
+#browser = webdriver.Chrome()
+#chrome_source = runTestInBrowser(browser)
+
+ie_source = ''
+if platform.system() == 'Windows':
+ browser = webdriver.Ie()
+ ie_source = runTestInBrowser(browser)
+
+def runTestInBrowser(browser):
+ browser.get("file://" + sys.argv[1])
+ element = webdriver.support.ui.WebDriverWait(browser, 10).until( \
+ lambda driver : ('PASS' in driver.page_source) or \
+ ('FAIL' in driver.page_source))
+ source = browser.page_source
+ browser.close()
+ return source
+
+
+#TODO(efortuna): Test if all three return correct responses. If not, throw error
+# particular to that browser.
+if ('PASS' in firefox_source):
+ print 'Content-Type: text/plain\nPASS'
+else:
+ print firefox_source
+
Property changes on: tools/testing/runSelenium.py
___________________________________________________________________
Added: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698