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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
OLDNEW
(Empty)
1 #!/usr/bin/python
Siggi Cherem (dart-lang) 2011/11/10 23:04:37 a few nits: - add license - rename the file to fit
2
3 from selenium import webdriver
4 import sys
5
6 browser = webdriver.Firefox() # Get local session of firefox
7 firefox_source = runTestInBrowser(browser)
8
9 # Note: you need ChromeDriver in your path to run chrome, in addition to
10 #installing Chrome.
11 # TODO(efortuna): Currently disabled for ease of setup for running on other
12 # developer machines. Uncomment when frog is robust enough to be tested on
13 # multiple platforms at once.
14 #browser = webdriver.Chrome()
15 #chrome_source = runTestInBrowser(browser)
16
17 ie_source = ''
18 if platform.system() == 'Windows':
19 browser = webdriver.Ie()
20 ie_source = runTestInBrowser(browser)
21
22 def runTestInBrowser(browser):
23 browser.get("file://" + sys.argv[1])
24 element = webdriver.support.ui.WebDriverWait(browser, 10).until( \
25 lambda driver : ('PASS' in driver.page_source) or \
26 ('FAIL' in driver.page_source))
27 source = browser.page_source
28 browser.close()
29 return source
30
31
32 #TODO(efortuna): Test if all three return correct responses. If not, throw error
33 # particular to that browser.
34 if ('PASS' in firefox_source):
35 print 'Content-Type: text/plain\nPASS'
36 else:
37 print firefox_source
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698