[Checkins] SVN: zc.selenium/branches/benji-use-mozrunner/s if "firefox" is the specified browser, use mozrunner to start it
Benji York
benji at zope.com
Sun Jun 28 16:13:26 EDT 2009
Log message for revision 101305:
if "firefox" is the specified browser, use mozrunner to start it
Changed:
U zc.selenium/branches/benji-use-mozrunner/setup.py
U zc.selenium/branches/benji-use-mozrunner/src/zc/selenium/selenium.py
-=-
Modified: zc.selenium/branches/benji-use-mozrunner/setup.py
===================================================================
--- zc.selenium/branches/benji-use-mozrunner/setup.py 2009-06-28 20:12:39 UTC (rev 101304)
+++ zc.selenium/branches/benji-use-mozrunner/setup.py 2009-06-28 20:13:26 UTC (rev 101305)
@@ -2,7 +2,7 @@
setup(
name='zc.selenium',
- version='1.3.0dev',
+ version='0',
author='Zope Corporation',
author_email='info at zope.com',
url='http://svn.zope.org/zc.seleinum',
@@ -17,12 +17,13 @@
license='ZPL 2.1',
namespace_packages = ['zc'],
install_requires =[
+ 'mozrunner',
'setuptools',
+ 'wsgiref',
+ 'z3c.zrtresource',
+ 'zope.component',
'zope.interface',
- 'zope.component',
'zope.publisher',
- 'z3c.zrtresource',
'zope.testing>=3.7.4',
- 'wsgiref',
]
)
Modified: zc.selenium/branches/benji-use-mozrunner/src/zc/selenium/selenium.py
===================================================================
--- zc.selenium/branches/benji-use-mozrunner/src/zc/selenium/selenium.py 2009-06-28 20:12:39 UTC (rev 101304)
+++ zc.selenium/branches/benji-use-mozrunner/src/zc/selenium/selenium.py 2009-06-28 20:13:26 UTC (rev 101305)
@@ -12,10 +12,10 @@
#
##############################################################################
"""Script to run Selenium tests.
+"""
-$Id$
-"""
from Queue import Queue, Empty
+import mozrunner
import optparse
import os
import random
@@ -72,14 +72,19 @@
if not zope_thread.isAlive():
return
- # start the tests
- browser = webbrowser.get(browser_name)
- if auto_start:
- extra = '&auto=true'
+ # if Firefox is specified, use mozrunner instead of the built-in webbrowser
+ # module
+ if browser_name == 'firefox':
+ runner = mozrunner.FirefoxRunner(cmdargs=[url])
+ runner.start()
else:
- extra = ''
- browser.open(url + extra)
+ browser = webbrowser.get(browser_name)
+ if auto_start:
+ url += '&auto=true'
+ # start the tests
+ browser.open(url)
+
# wait for the test results to come in (the reason we don't do a
# blocking-get here is because it keeps Ctrl-C from working)
exit_now = False
@@ -147,7 +152,7 @@
parser = optparse.OptionParser(usage)
parser.add_option('-b', '--browser', metavar="BROWSER", default=None,
help='choose browser to use (mozilla, netscape, '
- 'kfm, internet-config)')
+ 'kfm, internet-config, firefox)')
parser.add_option('-k', '--keep-running',
action='store_true',
help='keep running after finishing the tests')
More information about the Checkins
mailing list