[Checkins] SVN: gocept.selenium/trunk/ Merge janjaapdriessen-wsgi branch

Wolfgang Schnerring wosc at wosc.de
Sun Dec 12 04:20:01 EST 2010


Log message for revision 118812:
  Merge janjaapdriessen-wsgi branch
  
  * Fixes #8260: Provide integration with the recent testlayer approach
    (zope.app.appsetup/zope.app.wsgi) used by Grok.
  * Fixes #6484: Make browser and RC server configurable.
  
  

Changed:
  U   gocept.selenium/trunk/CHANGES.txt
  A   gocept.selenium/trunk/buildout.cfg
  A   gocept.selenium/trunk/grok.cfg
  U   gocept.selenium/trunk/setup.py
  U   gocept.selenium/trunk/src/gocept/selenium/README.txt
  U   gocept.selenium/trunk/src/gocept/selenium/base.py
  A   gocept.selenium/trunk/src/gocept/selenium/grok/
  U   gocept.selenium/trunk/src/gocept/selenium/selenese.py
  U   gocept.selenium/trunk/src/gocept/selenium/static/__init__.py
  U   gocept.selenium/trunk/src/gocept/selenium/static/tests/test_static.py
  A   gocept.selenium/trunk/src/gocept/selenium/wsgi/
  U   gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py
  U   gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py
  U   gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py
  U   gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py
  U   gocept.selenium/trunk/static.cfg
  A   gocept.selenium/trunk/wsgi.cfg
  U   gocept.selenium/trunk/ztk.cfg

-=-
Modified: gocept.selenium/trunk/CHANGES.txt
===================================================================
--- gocept.selenium/trunk/CHANGES.txt	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/CHANGES.txt	2010-12-12 09:20:01 UTC (rev 118812)
@@ -4,6 +4,9 @@
 0.9 (unreleased)
 ----------------
 
+- Provide integration with the recent testlayer approach
+  (zope.app.appsetup/zope.app.wsgi) used by Grok (#8260).
+- Make browser and RC server configurable (#6484).
 - Show current test case in command log (#7876).
 - Raise readable error when connection to RC server fails (#6489).
 - Quit browser when the testrunner terminates (#6485).

Copied: gocept.selenium/trunk/buildout.cfg (from rev 118790, gocept.selenium/branches/janjaapdriessen-wsgi/buildout.cfg)
===================================================================
--- gocept.selenium/trunk/buildout.cfg	                        (rev 0)
+++ gocept.selenium/trunk/buildout.cfg	2010-12-12 09:20:01 UTC (rev 118812)
@@ -0,0 +1,15 @@
+[buildout]
+parts = test
+develop = .
+versions = versions
+package = gocept.selenium
+
+[versions]
+gocept.selenium =
+selenium = 1.0.3
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = ${buildout:package}
+
+

Copied: gocept.selenium/trunk/grok.cfg (from rev 118790, gocept.selenium/branches/janjaapdriessen-wsgi/grok.cfg)
===================================================================
--- gocept.selenium/trunk/grok.cfg	                        (rev 0)
+++ gocept.selenium/trunk/grok.cfg	2010-12-12 09:20:01 UTC (rev 118812)
@@ -0,0 +1,7 @@
+[buildout]
+extends = buildout.cfg
+          http://svn.zope.org/repos/main/groktoolkit/trunk/grok.cfg
+
+[test]
+eggs = gocept.selenium[grok, test_grok]
+defaults = ['--ignore_dir', 'wsgi', '--ignore_dir', 'ztk', '--ignore_dir', 'zope2', '--ignore_dir', 'plone', '--ignore_dir', 'static', '-v', '--auto-color']

Modified: gocept.selenium/trunk/setup.py
===================================================================
--- gocept.selenium/trunk/setup.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/setup.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -37,10 +37,20 @@
         'setuptools',
         ],
     extras_require=dict(
-        ztk=['zope.app.server',
+        grok=[
+            'zope.app.appsetup',
+            'zope.app.wsgi',
+            ],
+        test_grok=[
+            'grok',
+            'ZODB3',
+            ],
+        ztk=[
+            'zope.app.server',
             'zope.app.testing',
             'zope.app.wsgi',
-            'zope.server'],
+            'zope.server',
+            ],
         test_ztk=[
             'zope.app.appsetup',
             'zope.app.zcmlfiles',

Modified: gocept.selenium/trunk/src/gocept/selenium/README.txt
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/README.txt	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/README.txt	2010-12-12 09:20:01 UTC (rev 118812)
@@ -1,7 +1,8 @@
 Selenium RC integration with zope.testing
 =========================================
 
-gocept.selenium integrates Selenium RC with your Plone/Zope 2/ZTK test suite.
+gocept.selenium integrates Selenium RC with your Plone/Zope 2/ZTK/Grok test
+suite.
 
 
 Quick start with ZTK
@@ -11,14 +12,16 @@
 zope.testing, you need to do this to enable Selenium tests:
 
 1. Add gocept.selenium to the list of eggs either in your setup.py, or in
-   buildout.cfg
+   buildout.cfg, using the extra ``ztk``, i.e. ``gocept.selenium[ztk]``.
 
 2. Install Selenium RC by some means, e.g. by downloading a version from
-    <http://release.seleniumhq.org/selenium-remote-control/>. We do not
-    recommend using the ``collective.recipe.seleniumrc`` buildout recipe for
-    this since we have had some bad experiences with it related to new
-    versions of Selenium RC and Firefox.
+   `seleniumhq.org`_ . We do not recommend using the
+   ``collective.recipe.seleniumrc`` buildout recipe for
+   this since we have had some bad experiences with it related to new
+   versions of Selenium RC and Firefox.
 
+.. _`seleniumhq.org`: http://release.seleniumhq.org/selenium-remote-control
+
 3. Run buildout to install gocept.selenium and selenium (the Python bindings
    for Selenium RC).
 
@@ -60,6 +63,91 @@
 instead of gocept.selenium.ztk.
 
 
+Quick start with Grok
+---------------------
+
+The layer works a little different than in the ZTK steps above, instead of
+delegating to a (probably alredy existing functional-testing) layer, you'll
+need a separate one for the Selenium tests.
+
+1. Use the ``grok`` extra when requiring gocept.selenium.
+
+4. Create a layer for your tests::
+
+    import gocept.selenium.grok
+
+    selenium_layer = gocept.selenium.grok.Layer(my.package)
+
+5. Inherit from `gocept.selenium.grok.TestCase`. You will probably want to
+   setup your app in your test setup::
+
+    import transaction
+
+    class MyTest(gocept.selenium.grok.TestCase):
+        layer = selenium_layer
+
+         def setUp(self):
+             super(MyTest, self).setUp()
+             root = self.getRootFolder()
+             root['app'] = mypackage.App()
+             transaction.commit()
+
+         def test(self):
+             self.selenium.open('/app')
+             self.selenium.assertBodyText('foo')
+
+The Grok Layer is based on a WSGI layer. You can test WSGI applications with
+gocept.selenium by following the steps described above and substituting:
+
+1. Use the ``wsgi`` extra when requiring gocept.selenium.
+
+4. Create a layer for your tests::
+
+    import gocept.selenium.wsgi
+
+    from mypackage import App
+
+    test_layer = gocept.selenium.wsgi.Layer(App())
+
+5. Inherit from `gocept.selenium.wsgi.TestCase`::
+
+    class TestWSGITestCase(gocept.selenium.wsgi.TestCase):
+
+        layer = test_layer
+
+Controlling gocept.selenium through environment variables
+---------------------------------------------------------
+
+You can configure the selenium server that gocept.selenium connects to from the
+command line. Selenium RC defaults to localhost:4444, but you can also connect
+to a selenium grid in your organization by using the following environment
+variables::
+
+    GOCEPT_SELENIUM_SERVER_HOST=selenium.mycompany.com
+    GOCEPT_SELENIUM_SERVER_PORT=8888
+
+If multiple browsers are connected to your selenium grid, you can choose the
+browser to run the tests with as such::
+
+    GOCEPT_SELENIUM_BROWSER=*iexplore
+
+When you are running your selenium tests on a selenium grid, you need to
+instruct the browser which host and port to connect to::
+
+    GOCEPT_SELENIUM_APP_HOST=10.0.0.15
+    GOCEPT_SELENIUM_APP_PORT=8001
+
+When you are testing an application on one machine, you can access the running
+application from another machine if you set ``GOCEPT_SELENIUM_APP_HOST = 0.0.0.0``
+instead of the default ``localhost``.
+
+You can set the speed with which the tests are run through an environment
+variable::
+
+    GOCEPT_SELENIUM_SPEED=500
+
+This example will introduce a 500 millisecond pause between tests.
+
 Similar packages
 ----------------
 
@@ -73,5 +161,5 @@
 
 Get the latest source with ::
 
-  svn co http://svn.gocept.com/repos/gocept/gocept.selenium/trunk gocept.selenium
+  svn co http://svn.zope.org/repos/main/gocept.selenium/trunk gocept.selenium
 

Modified: gocept.selenium/trunk/src/gocept/selenium/base.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/base.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/base.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -1,6 +1,6 @@
 #############################################################################
 #
-# Copyright (c) 2009 Zope Foundation and Contributors.
+# Copyright (c) 2010 Zope Foundation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -14,6 +14,7 @@
 
 import atexit
 import gocept.selenium.selenese
+import os
 import selenium
 import socket
 import sys
@@ -27,50 +28,62 @@
 
 class Layer(object):
 
-    # XXX make configurable:
     # hostname and port of the Selenium RC server
-    _server = 'localhost'
-    _port = 4444
-    _browser = '*firefox'
+    _server = os.environ.get('GOCEPT_SELENIUM_SERVER_HOST', 'localhost')
+    _port = int(os.environ.get('GOCEPT_SELENIUM_SERVER_PORT', 4444))
 
-    # override in subclass:
-    # hostname and port of the app web server
-    host = None
-    port = None
+    _browser = os.environ.get('GOCEPT_SELENIUM_BROWSER', '*firefox')
 
-    __name__ = 'Layer'
+    # hostname and port of the local application.
+    host = os.environ.get('GOCEPT_SELENIUM_APP_HOST', 'localhost')
+    port = int(os.environ.get('GOCEPT_SELENIUM_APP_PORT', 5698))
 
     def __init__(self, *bases):
         self.__bases__ = bases
-        self.__name__ = '[%s].selenium' % (
-            '/'.join('%s.%s' % (x.__module__, x.__name__) for x in bases))
+        if self.__bases__:
+            base = bases[0]
+            self.__name__ = '(%s.%s)' % (base.__module__, base.__name__)
+        else:
+            self.__name__ = self.__class__.__name__
 
     def setUp(self):
-        self.selenium = selenium.selenium(
+        self.seleniumrc = selenium.selenium(
             self._server, self._port, self._browser,
             'http://%s:%s/' % (self.host, self.port))
         try:
-            self.selenium.start()
+            self.seleniumrc.start()
         except socket.error, e:
             raise socket.error(
                 'Failed to connect to Selenium RC server at %s:%s,'
                 ' is it running? (%s)'
                 % (self._server, self._port, e))
-        atexit.register(self.selenium.stop)
+        atexit.register(self.seleniumrc.stop)
+        speed = os.environ.get('GOCEPT_SELENIUM_SPEED')
+        if speed is not None:
+            self.seleniumrc.set_speed(speed)
 
     def tearDown(self):
-        self.selenium.stop()
+        self.seleniumrc.stop()
 
-    def switch_db(self):
-        raise NotImplemented
+    def testSetUp(self):
+        # instantiate a fresh one per test run, so any configuration
+        # (e.g. timeout) is reset
+        self.selenium = gocept.selenium.selenese.Selenese(
+            self.seleniumrc, self.host, self.port)
 
 
 class TestCase(object):
+    # the various flavours (ztk, zope2, grok, etc.) are supposed to provide
+    # their own TestCase as needed, and mix this class in to get the
+    # convenience functionality.
+    #
+    # Example:
+    # some.flavour.TestCase(gocept.selenium.base.TestCase,
+    #                       the.actual.base.TestCase):
+    #     pass
 
     def setUp(self):
         super(TestCase, self).setUp()
-        self.layer.switch_db()
-        self.selenium = gocept.selenium.selenese.Selenese(
-            self.layer.selenium, self)
+        self.selenium = self.layer.selenium
         self.selenium.setContext('%s.%s' % (
             self.__class__.__name__, getattr(self, TEST_METHOD_NAME)))

Modified: gocept.selenium/trunk/src/gocept/selenium/selenese.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/selenese.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/selenese.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -44,17 +44,17 @@
 
 class Selenese(object):
 
-    def __init__(self, selenium, testcase):
+    failureException = AssertionError
+
+    def __init__(self, selenium, app_host, app_port):
         self.selenium = selenium
-        self.failureException = testcase.failureException
-        self.testcase = testcase
+        self.host = app_host
+        self.port = app_port
         self.timeout = 30
-        self.variables = {}
 
     @property
     def server(self):
-        # we expect the testcase to have a gocept.selenium.layer.SeleniumLayer
-        return '%s:%s' % (self.testcase.layer.host, self.testcase.layer.port)
+        return '%s:%s' % (self.host, self.port)
 
     # Actions
 

Modified: gocept.selenium/trunk/src/gocept/selenium/static/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/static/__init__.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/static/__init__.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -17,9 +17,7 @@
 import os.path
 import posixpath
 import shutil
-import SimpleHTTPServer
-import subprocess
-import sys
+from SimpleHTTPServer import SimpleHTTPRequestHandler
 import tempfile
 import threading
 import time
@@ -31,7 +29,7 @@
 _suffix = 'gocept.selenium.static'
 
 
-class StaticFileRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
+class StaticFileRequestHandler(SimpleHTTPRequestHandler):
 
     # The documentroot is set on the class just before passing the class on
     # to the BaseHTTPServer.HTTPServer.
@@ -43,8 +41,8 @@
         # "documentroot".
         # The rest of the method's implementation is copied verbatim from
         # SimpleHTTPServer.SimpleHTTPRequestHandler.
-        path = path.split('?',1)[0]
-        path = path.split('#',1)[0]
+        path = path.split('?', 1)[0]
+        path = path.split('#', 1)[0]
         path = posixpath.normpath(urllib.unquote(path))
         words = path.split('/')
         words = filter(None, words)
@@ -53,12 +51,15 @@
         for word in words:
             drive, word = os.path.splitdrive(word)
             head, word = os.path.split(word)
-            if word in (os.curdir, os.pardir): continue
+            if word in (os.curdir, os.pardir):
+                continue
             path = os.path.join(path, word)
         return path
 
+    # Add conditional logging to handler.
     def log_request(self, *args):
-        pass
+        if 'GOCEPT_SELENIUM_VERBOSE_LOGGING' in os.environ:
+            SimpleHTTPRequestHandler.log_request(self, *args)
 
 
 class HTTPServer(BaseHTTPServer.HTTPServer):
@@ -71,14 +72,23 @@
 
     def shutdown(self):
         self._continue = False
-        urllib.urlopen('http://%s:%s/' % (self.server_name, self.server_port))
+        # We fire a last request at the server in order to take it out of the
+        # while loop in `self.serve_until_shutdown`.
+        try:
+            urllib.urlopen('http://%s:%s/' % (self.server_name,
+                                              self.server_port))
+        except IOError:
+            # If the server is already shut down, we receive a socket error,
+            # which we ignore.
+            pass
         self.server_close()
 
 
 class StaticFilesLayer(gocept.selenium.base.Layer):
 
-    host = 'localhost'
-    port = 5698
+    def __init__(self):
+        # we don't need any __bases__
+        super(StaticFilesLayer, self).__init__()
 
     def setUp(self):
         super(StaticFilesLayer, self).setUp()
@@ -92,6 +102,7 @@
             (self.host, self.port), StaticFileRequestHandler)
         self.server_thread = threading.Thread(
             target=self.server.serve_until_shutdown)
+        self.server_thread.daemon = True
         self.server_thread.start()
         # Wait a little as it sometimes takes a while to get the server
         # started.
@@ -102,6 +113,7 @@
             return
         self.server.shutdown()
         self.server_thread.join()
+        # Make the server really go away and give up the socket:
         self.server = None
 
     def tearDown(self):
@@ -110,9 +122,8 @@
         shutil.rmtree(self.documentroot)
         super(StaticFilesLayer, self).tearDown()
 
-    def switch_db(self):
-        # Part of the gocept.selenium test layer contract. We use the
-        # hook to clear out all the files from the documentroot.
+    def testSetUp(self):
+        super(StaticFilesLayer, self).testSetUp()
         paths = os.listdir(self.documentroot)
         for path in paths:
             fullpath = os.path.join(self.documentroot, path)

Modified: gocept.selenium/trunk/src/gocept/selenium/static/tests/test_static.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/static/tests/test_static.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/static/tests/test_static.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -12,6 +12,7 @@
 #
 ##############################################################################
 
+import os
 import unittest
 import gocept.selenium.static
 
@@ -29,21 +30,19 @@
         self.assert_(self.testlayer.documentroot.startswith('/tmp'))
 
     def test_documentroot_initially_empty(self):
-        import os
         documentroot = self.testlayer.documentroot
         self.assert_(not os.listdir(self.testlayer.documentroot))
         open(os.path.join(documentroot, 'foo.txt'), 'w').write('Hello World!')
         self.assertEquals(
             ['foo.txt'], os.listdir(self.testlayer.documentroot))
 
-    def test_documentroot_empty_after_switchdb(self):
-        import os
+    def test_documentroot_empty_after_testsetup(self):
         documentroot = self.testlayer.documentroot
         self.assert_(not os.listdir(self.testlayer.documentroot))
         open(os.path.join(documentroot, 'bar.txt'), 'w').write('Hello World!')
         self.assertEquals(
             ['bar.txt'], os.listdir(self.testlayer.documentroot))
-        self.testlayer.switch_db()
+        self.testlayer.testSetUp()
         self.assert_(not os.listdir(self.testlayer.documentroot))
 
     def test_server_startup_shutdown(self):

Modified: gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -64,11 +64,7 @@
         Lifetime.shutdown(0, fast=1)
         super(Layer, self).tearDown()
 
-    def switch_db(self):
-        # Nothing to do, we rely on ZopeLiteLayer et. al.
-        pass
 
-
 class TestCase(gocept.selenium.base.TestCase,
                Testing.ZopeTestCase.FunctionalTestCase):
 

Modified: gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -24,15 +24,11 @@
 
 class Layer(gocept.selenium.base.Layer):
 
-    # Hostname and port of the Zope webserver
-    host = 'localhost'
-    port = 8087
-
     def setUp(self):
         task_dispatcher = ThreadedTaskDispatcher()
         task_dispatcher.setThreadCount(1)
         db = zope.app.testing.functional.FunctionalTestSetup().db
-        self.http = SwitchableDBServerType.create(
+        self.http = zope.app.server.wsgi.http.create(
             'WSGI-HTTP', task_dispatcher, db, port=self.port)
         self.thread = threading.Thread(target=self.run_server)
         self.thread.setDaemon(True)
@@ -50,39 +46,18 @@
             asyncore.poll(0.1)
         self.http.close()
 
-    def switch_db(self):
-        """switches the HTTP-server's database to the currently active
-        DemoStorage"""
-        db = zope.app.testing.functional.FunctionalTestSetup().db
-        self.http.application.set_db(db)
 
-
 class TestCase(gocept.selenium.base.TestCase,
                zope.app.testing.functional.FunctionalTestCase):
     # note: MRO requires the gocept.selenium.base.TestCase to come first,
     # otherwise setUp/tearDown happens in the wrong order
-    pass
 
-
-class SwitchableDBApplication(zope.app.wsgi.WSGIPublisherApplication):
-
-    def __init__(self, *args, **kw):
-        self.db = kw.get('db', None)
-        super(SwitchableDBApplication, self).__init__(*args, **kw)
-
-    def __call__(self, environ, start_response):
-        if self.db is not None:
-            factory = type(self.requestFactory)
-            self.requestFactory = factory(self.db)
-        return super(SwitchableDBApplication, self).__call__(
-            environ, start_response)
-
-    def set_db(self, db):
-        self.db = db
-
-
-SwitchableDBServerType = zope.app.server.wsgi.ServerType(
-    zope.server.http.wsgihttpserver.WSGIHTTPServer,
-    SwitchableDBApplication,
-    zope.server.http.commonaccesslogger.CommonAccessLogger,
-    8087, True)  # The port number here is just the default value
+    def setUp(self):
+        # switches the HTTP-server's database to the currently active
+        # DemoStorage (which is set by FunctionalTestCase)
+        super(TestCase, self).setUp()
+        db = zope.app.testing.functional.FunctionalTestSetup().db
+        application = self.layer.http.application
+        assert isinstance(application, zope.app.wsgi.WSGIPublisherApplication)
+        factory = type(application.requestFactory)
+        application.requestFactory = factory(db)

Modified: gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -19,7 +19,7 @@
 zcml_layer = zope.app.testing.functional.ZCMLLayer(
     pkg_resources.resource_filename(
         'gocept.selenium.ztk.tests', 'ftesting.zcml'),
-    __name__, __name__, allow_teardown=True)
+    __name__, 'zcml_layer', allow_teardown=True)
 
 selenium_layer = gocept.selenium.ztk.Layer(zcml_layer)
 

Modified: gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py	2010-12-12 09:20:01 UTC (rev 118812)
@@ -73,7 +73,7 @@
             def get_with_wrong_assert_type(self):
                 pass
 
-        self.selenese = Selenese(None, TestCase())
+        self.selenese = Selenese(None, None, None)
 
     def assertError(self, error, name, expected_msg):
         try:
@@ -160,7 +160,7 @@
     def test_location(self):
         self.selenium.open('/')
         self.assertEquals(
-            'http://localhost:8087/',
+            'http://%s:%s/' % (self.layer.host, self.layer.port),
             self.selenium.getLocation())
 
     def test_alert_not_present(self):

Modified: gocept.selenium/trunk/static.cfg
===================================================================
--- gocept.selenium/trunk/static.cfg	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/static.cfg	2010-12-12 09:20:01 UTC (rev 118812)
@@ -1,10 +1,6 @@
 [buildout]
-extends = http://svn.zope.org/repos/main/zopetoolkit/trunk/ztk.cfg
-develop = .
-parts = test
-package = gocept.selenium
+extends = buildout.cfg
+          http://svn.zope.org/repos/main/zopetoolkit/trunk/ztk.cfg
 
 [test]
-recipe = zc.recipe.testrunner
-eggs = ${buildout:package}
-defaults = ['--ignore_dir', 'zope2', '--ignore_dir', 'plone', '--ignore_dir', 'ztk', '-v', '--auto-color']
+defaults = ['--ignore_dir', 'wsgi','--ignore_dir', 'grok',  '--ignore_dir', 'zope2', '--ignore_dir', 'plone', '--ignore_dir', 'ztk', '-v', '--auto-color']

Copied: gocept.selenium/trunk/wsgi.cfg (from rev 118790, gocept.selenium/branches/janjaapdriessen-wsgi/wsgi.cfg)
===================================================================
--- gocept.selenium/trunk/wsgi.cfg	                        (rev 0)
+++ gocept.selenium/trunk/wsgi.cfg	2010-12-12 09:20:01 UTC (rev 118812)
@@ -0,0 +1,5 @@
+[buildout]
+extends = buildout.cfg
+
+[test]
+defaults = ['--ignore_dir', 'grok', '--ignore_dir', 'ztk', '--ignore_dir', 'zope2', '--ignore_dir', 'plone', '--ignore_dir', 'static', '-v', '--auto-color']

Modified: gocept.selenium/trunk/ztk.cfg
===================================================================
--- gocept.selenium/trunk/ztk.cfg	2010-12-11 23:12:03 UTC (rev 118811)
+++ gocept.selenium/trunk/ztk.cfg	2010-12-12 09:20:01 UTC (rev 118812)
@@ -1,15 +1,12 @@
 [buildout]
-extends = http://download.zope.org/zopetoolkit/index/1.0a3/ztk-versions.cfg
-          http://download.zope.org/zopetoolkit/index/1.0a3/zopeapp-versions.cfg
-develop = .
-parts = test instance
-package = gocept.selenium
-versions = versions
+extends = buildout.cfg
+          http://download.zope.org/zopetoolkit/index/1.0/ztk-versions.cfg
+          http://download.zope.org/zopetoolkit/index/1.0/zopeapp-versions.cfg
+parts += instance
 
 [test]
-recipe = zc.recipe.testrunner
 eggs = ${buildout:package} [test_ztk,ztk]
-defaults = ['--ignore_dir', 'zope2', '--ignore_dir', 'plone', '--ignore_dir', 'static', '-v', '-c']
+defaults = ['--ignore_dir', 'grok', '--ignore_dir', 'wsgi', '--ignore_dir', 'zope2', '--ignore_dir', 'plone', '--ignore_dir', 'static', '-v', '--auto-color']
 
 [instance]
 recipe = zc.zope3recipes:instance



More information about the checkins mailing list