[Checkins] SVN: zc.selenium/trunk/ - Feature: Added a `--base-url` option to the selenium script, so that one is

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri May 9 11:05:23 EDT 2008


Log message for revision 86573:
  - Feature: Added a `--base-url` option to the selenium script, so that one is
    not depndent to include the default layer in the default skin.
  
  More goodies to come! :-)
  

Changed:
  _U  zc.selenium/trunk/
  A   zc.selenium/trunk/CHANGES.txt
  U   zc.selenium/trunk/src/zc/selenium/selenium.py

-=-

Property changes on: zc.selenium/trunk
___________________________________________________________________
Name: svn:ignore
   - develop-eggs
bin
parts

   + .installed.cfg
develop-eggs
bin
parts


Added: zc.selenium/trunk/CHANGES.txt
===================================================================
--- zc.selenium/trunk/CHANGES.txt	                        (rev 0)
+++ zc.selenium/trunk/CHANGES.txt	2008-05-09 15:05:22 UTC (rev 86573)
@@ -0,0 +1,22 @@
+=======
+CHANGES
+=======
+
+
+1.1.0 (2008-??-??)
+------------------
+
+- Feature: Added a `--base-url` option to the selenium script, so that one is
+  not depndent to include the default layer in the default skin. (Who does
+  this? What a security hole!)
+
+- Bug: Added documentation on how to setup `zc.selenium`.
+
+- First public release.
+
+
+1.0.0 (200?-??-??)
+------------------
+
+- Internal release.
+


Property changes on: zc.selenium/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: zc.selenium/trunk/src/zc/selenium/selenium.py
===================================================================
--- zc.selenium/trunk/src/zc/selenium/selenium.py	2008-05-09 14:41:22 UTC (rev 86572)
+++ zc.selenium/trunk/src/zc/selenium/selenium.py	2008-05-09 15:05:22 UTC (rev 86573)
@@ -41,15 +41,15 @@
     from zope.app.server.main import main
     main(["-C", config, "-X", "http0/address=" + port] + sys.argv[1:])
 
-def run_tests(zope_thread, auto_start, browser_name, port):
+def run_tests(zope_thread, auto_start, browser_name, port, base_url):
     start_time = time.time()
 
     # wait for the server to start
     old_timeout = socket.getdefaulttimeout()
     socket.setdefaulttimeout(5)
-    url = ('http://localhost:%s/@@/selenium/TestRunner.html'
-           '?test=tests%%2FTestSuite.html&resultsUrl=/@@/selenium_results'
-           % port)
+    url = base_url %{'port': port}
+    url += ('/@@/selenium/TestRunner.html'
+           '?test=tests%2FTestSuite.html&resultsUrl=/@@/selenium_results')
     time.sleep(1)
     while zope_thread.isAlive():
         try:
@@ -69,7 +69,6 @@
         extra = '&auto=true'
     else:
         extra = ''
-
     browser.open(url + extra)
 
     # wait for the test results to come in (the reason we don't do a
@@ -150,6 +149,9 @@
     parser.add_option('-r', '--random-port', dest='random_port',
                       action='store_true',
                       help='use a random port for the server')
+    parser.add_option('-u', '--base-url', dest='base_url',
+                      default='http://localhost:%(port)s/',
+                      help='The base URL of the Zope site (may contain skin).')
 
     options, positional = parser.parse_args()
     options.config = config
@@ -178,7 +180,8 @@
     zope_thread.setDaemon(True)
     zope_thread.start()
     test_result = run_tests(
-        zope_thread, options.auto_start, options.browser, options.port)
+        zope_thread, options.auto_start, options.browser, options.port,
+        options.base_url)
 
     if options.keep_running or not options.auto_start:
         while True:



More information about the Checkins mailing list