[Checkins] SVN: gocept.selenium/trunk/ import from gocept repository
Wolfgang Schnerring
wosc at wosc.de
Mon Dec 7 08:07:15 EST 2009
Log message for revision 106245:
import from gocept repository
Changed:
A gocept.selenium/trunk/
A gocept.selenium/trunk/CHANGES.txt
A gocept.selenium/trunk/bootstrap.py
A gocept.selenium/trunk/plone.cfg
A gocept.selenium/trunk/setup.py
A gocept.selenium/trunk/src/
A gocept.selenium/trunk/src/gocept/
A gocept.selenium/trunk/src/gocept/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/
A gocept.selenium/trunk/src/gocept/selenium/README.txt
A gocept.selenium/trunk/src/gocept/selenium/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/base.py
A gocept.selenium/trunk/src/gocept/selenium/plone/
A gocept.selenium/trunk/src/gocept/selenium/plone/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/plone/tests/
A gocept.selenium/trunk/src/gocept/selenium/plone/tests/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/plone/tests/test_plone.py
A gocept.selenium/trunk/src/gocept/selenium/selenese.py
A gocept.selenium/trunk/src/gocept/selenium/tests/
A gocept.selenium/trunk/src/gocept/selenium/tests/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/tests/fixture/
A gocept.selenium/trunk/src/gocept/selenium/tests/fixture/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml
A gocept.selenium/trunk/src/gocept/selenium/tests/fixture/display-delay.pt
A gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py
A gocept.selenium/trunk/src/gocept/selenium/tests/isolation.py
A gocept.selenium/trunk/src/gocept/selenium/zope2/
A gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/zope2/tests/
A gocept.selenium/trunk/src/gocept/selenium/zope2/tests/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/zope2/tests/test_zope2.py
A gocept.selenium/trunk/src/gocept/selenium/ztk/
A gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py
A gocept.selenium/trunk/src/gocept/selenium/ztk/tests/
A gocept.selenium/trunk/src/gocept/selenium/ztk/tests/__init__.py
A gocept.selenium/trunk/src/gocept/selenium/ztk/tests/ftesting.zcml
A gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py
A gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py
A gocept.selenium/trunk/zope2.cfg
A gocept.selenium/trunk/ztk.cfg
-=-
Added: gocept.selenium/trunk/CHANGES.txt
===================================================================
--- gocept.selenium/trunk/CHANGES.txt (rev 0)
+++ gocept.selenium/trunk/CHANGES.txt 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,13 @@
+Changes
+=======
+
+0.2 (unreleased)
+----------------
+
+- Make Zope 2 test server reachable from the outside.
+
+
+0.1 (2009-11-08)
+----------------
+
+- first release
Added: gocept.selenium/trunk/bootstrap.py
===================================================================
--- gocept.selenium/trunk/bootstrap.py (rev 0)
+++ gocept.selenium/trunk/bootstrap.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 1139 2008-09-01 11:21:37Z czagrodnick $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
Added: gocept.selenium/trunk/plone.cfg
===================================================================
--- gocept.selenium/trunk/plone.cfg (rev 0)
+++ gocept.selenium/trunk/plone.cfg 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,39 @@
+[buildout]
+develop = .
+parts = test instance seleniumrc
+package = gocept.selenium
+extends = http://dist.plone.org/release/3.2.2/versions.cfg
+versions = versions
+find-links = http://download.gocept.com/packages
+
+[versions]
+zc.buildout =
+setuptools =
+PILwoTK = 1.1.6.4
+
+[seleniumrc]
+recipe = collective.recipe.seleniumrc
+url = http://release.seleniumhq.org/selenium-remote-control/1.0.1/selenium-remote-control-1.0.1-dist.zip
+md5sum = 068b1adb26a7450717e6d6d67e261b58
+
+[test]
+recipe = collective.recipe.z2testrunner
+zope2part = instance
+defaults = --ignore_dir=ztk --ignore_dir=zope2
+packages = ${buildout:package}
+
+[instance]
+recipe = plone.recipe.zope2instance
+zope2-location = ${zope2:location}
+user = admin:admin
+eggs = ${buildout:package}
+ Plone
+ PILwoTK
+zcml = gocept.selenium.tests.fixture
+
+[zope2]
+recipe = plone.recipe.zope2install
+fake-zope-eggs = true
+additional-fake-eggs =
+ ZODB3
+url = ${versions:zope2-url}
Added: gocept.selenium/trunk/setup.py
===================================================================
--- gocept.selenium/trunk/setup.py (rev 0)
+++ gocept.selenium/trunk/setup.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,53 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import os.path
+from setuptools import setup, find_packages
+
+
+setup(
+ name='gocept.selenium',
+ version = '0.2dev',
+ author='Wolfgang Schnerring',
+ author_email='ws at gocept.com',
+ description='zope.testing layer that integrates Selenium-RC',
+ long_description = (
+ open(os.path.join('src', 'gocept', 'selenium', 'README.txt')).read() +
+ '\n\n' +
+ open('CHANGES.txt').read()),
+ packages=find_packages('src'),
+ package_dir = {'': 'src'},
+ include_package_data=True,
+ zip_safe=False,
+ license='ZPL 2.1',
+ namespace_packages=['gocept'],
+ install_requires=[
+ 'selenium',
+ 'setuptools',
+ ],
+ extras_require=dict(
+ ztk=['zope.app.server',
+ 'zope.app.testing',
+ 'zope.app.wsgi',
+ 'zope.server'],
+ test_ztk=[
+ 'zope.app.appsetup',
+ 'zope.app.zcmlfiles',
+ 'zope.securitypolicy',
+ 'zope.testing >= 3.8.0',
+ 'zope.interface',
+ 'zope.schema',
+ 'ZODB3',
+ ]),
+)
Added: gocept.selenium/trunk/src/gocept/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,20 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+# namespace package boilerplate
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError, e:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
Added: gocept.selenium/trunk/src/gocept/selenium/README.txt
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/README.txt (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/README.txt 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+XXX writeme
\ No newline at end of file
Added: gocept.selenium/trunk/src/gocept/selenium/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+# python package
Added: gocept.selenium/trunk/src/gocept/selenium/base.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/base.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/base.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,54 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import gocept.selenium.selenese
+import selenium
+
+
+class Layer(object):
+
+ # XXX make configurable
+ _server = 'localhost'
+ _port = 4444
+ _browser = '*firefox'
+
+ # override in subclass
+ host = None
+ port = None
+
+ __name__ = 'Layer'
+
+ def __init__(self, *bases):
+ self.__bases__ = bases
+
+ def setUp(self):
+ self.selenium = selenium.selenium(
+ self._server, self._port, self._browser,
+ 'http://%s:%s/' % (self.host, self.port))
+ self.selenium.start()
+
+ def tearDown(self):
+ self.selenium.stop()
+
+ def switch_db(self):
+ raise NotImplemented
+
+
+class TestCase(object):
+
+ def setUp(self):
+ super(TestCase, self).setUp()
+ self.layer.switch_db()
+ self.selenium = gocept.selenium.selenese.Selenese(
+ self.layer.selenium, self)
Added: gocept.selenium/trunk/src/gocept/selenium/plone/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plone/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/plone/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,24 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+from Products.PloneTestCase.layer import PloneSiteLayer
+import Products.PloneTestCase.PloneTestCase
+import gocept.selenium.base
+import gocept.selenium.zope2
+
+
+class TestCase(gocept.selenium.base.TestCase,
+ Products.PloneTestCase.PloneTestCase.FunctionalTestCase):
+
+ layer = gocept.selenium.zope2.Layer(PloneSiteLayer)
Added: gocept.selenium/trunk/src/gocept/selenium/plone/tests/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plone/tests/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/plone/tests/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+# python package
Added: gocept.selenium/trunk/src/gocept/selenium/plone/tests/test_plone.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plone/tests/test_plone.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/plone/tests/test_plone.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,38 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import unittest
+import gocept.selenium.zope2
+import gocept.selenium.tests.isolation
+import Products.PloneTestCase.PloneTestCase
+
+
+Products.PloneTestCase.PloneTestCase.setupPloneSite(id='plone')
+
+
+class PloneTests(gocept.selenium.tests.isolation.IsolationTests,
+ gocept.selenium.plone.TestCase):
+
+ def test_plone_login(self):
+ sel = self.selenium
+ sel.open('/plone')
+ sel.type('name=__ac_name', 'portal_owner')
+ sel.type('name=__ac_password', 'secret')
+ sel.click('name=submit')
+ sel.waitForPageToLoad()
+ sel.assertTextPresent('Welcome! You are now logged in.')
+
+
+def test_suite():
+ return unittest.makeSuite(PloneTests)
Added: gocept.selenium/trunk/src/gocept/selenium/selenese.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/selenese.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/selenese.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,349 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import re
+import time
+
+
+def camelcase_to_underscore(name):
+ new = ''
+ for char in name:
+ if char.isupper():
+ new += '_'
+ new += char
+ return new.lower()
+
+
+def passthrough(func):
+ name = camelcase_to_underscore(func.__name__)
+
+ def inner(self, *args, **kw):
+ return getattr(self.selenium, name)(*args, **kw)
+
+ inner.__name__ = func.__name__
+ return inner
+
+
+def assert_type(type):
+ def decorate(func):
+ func.assert_type = type
+ return func
+ return decorate
+
+
+class Selenese(object):
+
+ def __init__(self, selenium, testcase):
+ self.selenium = selenium
+ self.failureException = testcase.failureException
+ self.testcase = testcase
+ 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)
+
+ # Actions
+
+ def pause(self, milliseconds):
+ time.sleep(milliseconds / 1000)
+
+ def setTimeout(self, timeout):
+ self.timeout = timeout / 1000.0
+
+ def waitForPageToLoad(self):
+ self.selenium.wait_for_page_to_load(self.timeout * 1000)
+
+ @passthrough
+ def createCookie(self, nameAndValue, options):
+ pass
+
+ @passthrough
+ def deleteCookie(self, name, options):
+ pass
+
+ @passthrough
+ def dragAndDropToObject(self, locatorSource, locatorDestination):
+ pass
+
+ @passthrough
+ def dragAndDrop(self, locator, movement):
+ pass
+
+ @passthrough
+ def check(self, locator):
+ pass
+
+ @passthrough
+ def click(self, locator):
+ pass
+
+ def clickAndWait(self, locator):
+ self.click(locator)
+ self.waitForPageToLoad()
+
+ @passthrough
+ def chooseCancelOnNextConfirmation(self):
+ pass
+
+ @passthrough
+ def fireEvent(self, locator, eventName):
+ pass
+
+ @passthrough
+ def mouseDownAt(self, locator, coord):
+ pass
+
+ @passthrough
+ def mouseMoveAt(self, locator, coord):
+ pass
+
+ @passthrough
+ def mouseOut(self, locator):
+ pass
+
+ @passthrough
+ def mouseOver(self, locator):
+ pass
+
+ @passthrough
+ def mouseUpAt(self, locator, coord):
+ pass
+
+ @passthrough
+ def open(self):
+ pass
+
+ @passthrough
+ def refresh(self):
+ pass
+
+ @passthrough
+ def select(self):
+ pass
+
+ @passthrough
+ def selectFrame(self):
+ pass
+
+ @passthrough
+ def setSpeed(self):
+ pass
+
+ @passthrough
+ def type(self):
+ pass
+
+ @passthrough
+ def typeKeys(self):
+ pass
+
+ # Getter
+
+ @assert_type('pattern')
+ def getAlert(self):
+ if not self.selenium.is_alert_present():
+ raise self.failureException(
+ 'No alert occured.')
+ return self.selenium.get_alert()
+
+ @assert_type('locator_pattern')
+ @passthrough
+ def getAttribute(self, locator):
+ pass
+
+ @assert_type('pattern')
+ @passthrough
+ def getBodyText(self):
+ pass
+
+ @assert_type('pattern')
+ @passthrough
+ def getConfirmation(self):
+ pass
+
+ @assert_type('locator_pattern')
+ @passthrough
+ def getEval(self, script):
+ pass
+
+ @assert_type('locator_pattern')
+ @passthrough
+ def getText(self, locator):
+ pass
+
+ @assert_type('locator_pattern')
+ @passthrough
+ def getValue(self, locator):
+ pass
+
+ @assert_type('locator')
+ @passthrough
+ def isElementPresent(self, locator):
+ pass
+
+ @assert_type('locator')
+ @passthrough
+ def isVisible(self, locator):
+ pass
+
+ def getElementWidth(self, locator):
+ return int(self.selenium.get_element_width(locator))
+
+ def getElementHeight(self, locator):
+ return int(self.selenium.get_element_height(locator))
+
+ @passthrough
+ def isTextPresent(self, pattern):
+ pass
+
+ # Assertions
+
+ def assertTextPresent(self, pattern):
+ if not self.isTextPresent(pattern):
+ raise self.failureException('Text %r not present' % pattern)
+
+ def assertCondition(self, condition):
+ # Extension to selenese API to make automatic `waitForCondition`
+ # generation work
+ # XXX comparing to `true` on a string-exact match might not be a good
+ # idea as implicit bool conversion might happen in original Selenese.
+ return self.assertEval(condition, 'exact:true')
+
+ def assertXpathCount(self, xpath, count):
+ result = self.selenium.get_xpath_count(xpath)
+ if result != count:
+ raise self.failureException(
+ 'Actual count of XPath %r is %s, expected %s'
+ % (xpath, result, count))
+
+ def assertOrdered(self, locator1, locator2):
+ if not self.selenium.is_ordered(locator1, locator2):
+ raise self.failureException(
+ 'Element order did not match expected %r,%r'
+ % (locator1, locator2))
+
+ # Internal
+
+ def __getattr__(self, name):
+ if name.startswith('waitFor'):
+ name = name.replace('waitFor', 'assert', 1)
+ assertion = getattr(self, name)
+ return (lambda *args, **kw:
+ self._waitFor(assertion, *args, **kw))
+
+ if 'Not' in name:
+ name = name.replace('Not', '', 1)
+ assertion = getattr(self, name)
+ return (lambda *args, **kw:
+ self._negate(assertion, *args, **kw))
+
+ if name.startswith('verify'):
+ name = name.replace('verify', 'assert', 1)
+ return getattr(self, name)
+
+ if name.startswith('assert'):
+ getter_name = name.replace('assert', 'get', 1)
+ getter = getattr(self, getter_name, None)
+ if getter is None:
+ getter_name = name.replace('assert', 'is', 1)
+ getter = getattr(self, getter_name, None)
+ if getter.assert_type == 'pattern':
+ return lambda pattern: self._assert_pattern(getter, pattern)
+ elif getter.assert_type == 'locator':
+ return lambda locator: self._assert(getter, locator)
+ elif getter.assert_type == 'locator_pattern':
+ return lambda locator, pattern: \
+ self._assert_pattern(getter, pattern, locator)
+
+ raise AttributeError(name)
+
+ def _assert(self, getter, *args, **kw):
+ if not getter(*args, **kw):
+ raise self.failureException(
+ 'not: %s(%r, %r)' % (getter.__name__, args, kw))
+
+ def _assert_pattern(self, getter, pattern, *args):
+ result = getter(*args)
+ if not selenese_pattern_equals(result, pattern):
+ raise self.failureException(
+ '%r did not match expected %r'
+ % (result, pattern))
+
+ def _negate(self, assertion, *args, **kw):
+ try:
+ assertion(*args, **kw)
+ except self.failureException, e:
+ return
+ else:
+ raise self.failureException('not %r with %r' %
+ (assertion, (args, kw)))
+
+ def _waitFor(self, assertion, *args, **kw):
+ start = time.time()
+ while True:
+ try:
+ assertion(*args, **kw)
+ except self.failureException, e:
+ if time.time() - start > self.timeout:
+ raise self.failureException(
+ 'Timed out waiting for: %s' % e.args[0])
+ else:
+ break
+ time.sleep(0.1)
+
+
+def match_glob(text, pattern):
+ pattern = re.escape(pattern)
+ pattern = pattern.replace(r'\*', '.*')
+ pattern = pattern.replace(r'\?', '.')
+ pattern = '^%s$' % pattern
+ return match_regex(text, pattern)
+
+
+def match_regex(text, pattern):
+ return re.search(pattern, text)
+
+
+def match_exact(text, pattern):
+ return text == pattern
+
+
+def selenese_pattern_equals(text, pattern):
+ """Various Pattern syntaxes are available for matching string values:
+
+ * glob:pattern: Match a string against a"glob" (aka "wildmat") pattern.
+ "Glob" is a kind of limited regular-expression syntax typically used in
+ command-line shells. In a glob pattern, "*" represents any sequence of
+ characters, and "?" represents any single character. Glob patterns match
+ against the entire string.
+ * regexp:regexp: Match a string using a regular-expression. The full power
+ of python regular-expressions is available.
+ * exact:string: Match a string exactly, verbatim, without any of that fancy
+ wildcard stuff.
+
+ If no pattern prefix is specified, assume that it's a"glob"
+ pattern.
+ """
+ matcher = match_glob
+ if ':' in pattern:
+ prefix, remainder = pattern.split(':', 1)
+ try:
+ matcher = globals()['match_' + prefix]
+ pattern = remainder
+ except KeyError:
+ pass
+ return matcher(text, pattern)
Added: gocept.selenium/trunk/src/gocept/selenium/tests/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+# python package
Added: gocept.selenium/trunk/src/gocept/selenium/tests/fixture/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/fixture/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/fixture/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+# python package
Added: gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/fixture/configure.zcml 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,27 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ >
+
+ <browser:page
+ for="*"
+ name="set.html"
+ class=".dummy.Set"
+ permission="zope.Public"
+ />
+
+ <browser:page
+ for="*"
+ name="get.html"
+ class=".dummy.Get"
+ permission="zope.Public"
+ />
+
+ <browser:page
+ for="*"
+ name="display-delay.html"
+ template="display-delay.pt"
+ permission="zope.Public"
+ />
+
+</configure>
Added: gocept.selenium/trunk/src/gocept/selenium/tests/fixture/display-delay.pt
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/fixture/display-delay.pt (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/fixture/display-delay.pt 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
+<head>
+<script type="text/javascript">
+function display() {
+ var div = document.createElement('div');
+ div.appendChild(document.createTextNode('Hello, world'));
+ document.body.appendChild(div);
+}
+</script>
+</head>
+
+<body onload="window.setTimeout(display, 5000)">
+
+</body>
+</html>
Added: gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/fixture/dummy.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,30 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import zope.security.proxy
+
+
+class Set(object):
+
+ def __call__(self):
+ c = zope.security.proxy.removeSecurityProxy(self.context)
+ c.foo = 1
+ return 'setting done'
+
+
+class Get(object):
+
+ def __call__(self):
+ c = zope.security.proxy.removeSecurityProxy(self.context)
+ return str(c.foo)
Added: gocept.selenium/trunk/src/gocept/selenium/tests/isolation.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/tests/isolation.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/tests/isolation.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,33 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+ENSURE_ORDER = False
+
+
+class IsolationTests(object):
+
+ def test_0_set(self):
+ global ENSURE_ORDER
+ self.selenium.open('http://%s/set.html' % self.selenium.server)
+ self.selenium.open('http://%s/get.html' % self.selenium.server)
+ self.selenium.assertBodyText('1')
+ ENSURE_ORDER = True
+
+ def test_1_get(self):
+ global ENSURE_ORDER
+ self.assertEquals(ENSURE_ORDER, True,
+ 'Set test was not run before get test')
+ self.selenium.open('http://%s/get.html' % self.selenium.server)
+ self.selenium.assertNotBodyText('1')
+ ENSURE_ORDER = False
Added: gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/zope2/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,73 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import Lifetime
+import Testing.ZopeTestCase
+import Testing.ZopeTestCase.utils
+import gocept.selenium.base
+
+try:
+ # Zope 2 >= 2.11
+ import Testing.ZopeTestCase.layer
+ BASE_LAYERS = (Testing.ZopeTestCase.layer.ZopeLiteLayer, )
+except ImportError:
+ # Zope 2 < 2.11
+ BASE_LAYERS = ()
+
+
+class Layer(gocept.selenium.base.Layer):
+
+ def setUp(self):
+ # five threads
+ self.startZServer()
+ super(Layer, self).setUp()
+
+ @property
+ def host(self):
+ return Testing.ZopeTestCase.utils._Z2HOST
+
+ @property
+ def port(self):
+ return Testing.ZopeTestCase.utils._Z2PORT
+
+ def startZServer(self):
+ if self.host is not None:
+ return
+ host = '195.62.106.98'
+ import random, time
+ port = random.choice(range(55000, 55500))
+ from Testing.ZopeTestCase.threadutils import setNumberOfThreads
+ setNumberOfThreads(5)
+ from Testing.ZopeTestCase.threadutils import QuietThread, zserverRunner
+ t = QuietThread(target=zserverRunner, args=(host, port, None))
+ t.setDaemon(1)
+ t.start()
+ time.sleep(0.1) # Sandor Palfy
+
+ Testing.ZopeTestCase.utils._Z2HOST = host
+ Testing.ZopeTestCase.utils._Z2PORT = port
+
+ def tearDown(self):
+ 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):
+
+ layer = Layer(*BASE_LAYERS)
Added: gocept.selenium/trunk/src/gocept/selenium/zope2/tests/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/zope2/tests/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/zope2/tests/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+# python package
Added: gocept.selenium/trunk/src/gocept/selenium/zope2/tests/test_zope2.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/zope2/tests/test_zope2.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/zope2/tests/test_zope2.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,29 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import unittest
+import gocept.selenium.zope2
+import gocept.selenium.tests.isolation
+import Testing.ZopeTestCase
+
+Testing.ZopeTestCase.installProduct('Five')
+
+
+class Zope2Tests(gocept.selenium.tests.isolation.IsolationTests,
+ gocept.selenium.zope2.TestCase):
+ pass
+
+
+def test_suite():
+ return unittest.makeSuite(Zope2Tests)
Added: gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,78 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+from zope.server.taskthreads import ThreadedTaskDispatcher
+import gocept.selenium.base
+import gocept.selenium.selenese
+import threading
+import zope.app.server.main
+import zope.app.server.wsgi
+import zope.app.testing.functional
+import zope.app.wsgi
+
+
+class Layer(gocept.selenium.base.Layer):
+
+ def setUp(self):
+ task_dispatcher = ThreadedTaskDispatcher()
+ task_dispatcher.setThreadCount(1)
+ db = zope.app.testing.functional.FunctionalTestSetup().db
+ self.http = SwitchableDBServerType.create(
+ 'WSGI-HTTP', task_dispatcher, db, port=8087)
+ thread = threading.Thread(target=zope.app.server.main.run)
+ thread.setDaemon(True)
+ thread.start()
+
+ # XXX make configurable
+ self.host = 'localhost'
+ self.port = '8087'
+
+ super(Layer, self).setUp()
+
+ 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)
Added: gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/testing.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,29 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import gocept.selenium.ztk
+import pkg_resources
+import zope.app.testing.functional
+
+zcml_layer = zope.app.testing.functional.ZCMLLayer(
+ pkg_resources.resource_filename(
+ 'gocept.selenium.ztk.tests', 'ftesting.zcml'),
+ __name__, __name__, allow_teardown=True)
+
+selenium_layer = gocept.selenium.ztk.Layer(zcml_layer)
+
+
+class TestCase(gocept.selenium.ztk.TestCase):
+
+ layer = selenium_layer
Added: gocept.selenium/trunk/src/gocept/selenium/ztk/tests/__init__.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/tests/__init__.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/tests/__init__.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1 @@
+# python package
Added: gocept.selenium/trunk/src/gocept/selenium/ztk/tests/ftesting.zcml
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/tests/ftesting.zcml (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/tests/ftesting.zcml 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,35 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope">
+
+ <include package="zope.app.zcmlfiles"/>
+ <include package="gocept.selenium.tests.fixture" file="configure.zcml"/>
+
+ <!-- typical functional testing security setup -->
+ <include package="zope.securitypolicy" file="meta.zcml"/>
+ <include package="zope.app.authentication"/>
+ <securityPolicy
+ component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+ />
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User"
+ />
+ <grant
+ permission="zope.View"
+ principal="zope.anybody"
+ />
+
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="admin"
+ password="admin"
+ />
+
+ <role id="zope.Manager" title="Site Manager" />
+ <grantAll role="zope.Manager" />
+ <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>
Added: gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_selenese.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,103 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+from gocept.selenium.selenese import selenese_pattern_equals as match
+from gocept.selenium.selenese import camelcase_to_underscore
+import gocept.selenium.ztk.testing
+import unittest
+import time
+
+
+class PatternTest(unittest.TestCase):
+
+ def test_no_prefix(self):
+ self.assert_(match('foo', 'foo'))
+ self.assert_(not match('foo', 'bar'))
+ self.assert_(match('foo:bar', 'foo:bar'))
+
+ def test_exact(self):
+ self.assert_(match('foo', 'exact:foo'))
+ self.assert_(not match('foo', 'exact:bar'))
+
+ def test_glob(self):
+ self.assert_(match('foo', 'glob:f*'))
+ self.assert_(match('foo', 'glob:fo?'))
+ self.assert_(not match('foo', 'glob:'))
+
+ self.assert_(not match('foo', 'glob:b*'))
+ self.assert_(not match('foo', 'glob:?ar'))
+
+ def test_glob_with_regex_chars_should_work(self):
+ self.assert_(match('(foo)', 'glob:(foo)'))
+ self.assert_(match('[foo]', 'glob:[foo]'))
+
+ def test_regex(self):
+ self.assert_(match('foo', 'regex:^fo+$'))
+ self.assert_(not match('foo', 'regex:^f+$'))
+
+
+class UtilsTest(unittest.TestCase):
+
+ def test_camelcaseconvert(self):
+ self.assertEquals('asdf', camelcase_to_underscore('asdf'))
+ self.assertEquals('foo_bar', camelcase_to_underscore('fooBar'))
+
+
+class AssertionTest(gocept.selenium.ztk.testing.TestCase):
+
+ def test_wait_for(self):
+ self.selenium.open('/display-delay.html')
+ self.selenium.assertElementNotPresent('css=div')
+ self.selenium.waitForElementPresent('css=div')
+
+ def test_wait_for_timeout(self):
+ self.selenium.open('/display-delay.html')
+ self.selenium.assertElementNotPresent('css=div')
+ try:
+ self.selenium.setTimeout(10)
+ self.selenium.waitForElementPresent('css=div')
+ except AssertionError:
+ pass
+ else:
+ self.fail('Timeout did not raise')
+
+ def test_assert_element_present_failure(self):
+ self.selenium.open('/display-delay.html')
+ try:
+ self.selenium.assertElementNotPresent('css=body')
+ except AssertionError:
+ pass
+ else:
+ self.fail('assertion should have failed')
+
+ def test_pause(self):
+ start = time.time()
+ self.selenium.pause(5000)
+ if time.time()-start < 4:
+ self.fail('Pause did not pause long enough')
+
+ def test_deleteCookie_smoke(self):
+ # Smoke test: just check that we don't break
+ self.selenium.deleteCookie('foo', '/')
+
+ def test_selectFrame_frame_doesnt_exist(self):
+ self.assertRaises(Exception, self.selenium.selectFrame, 'foo')
+
+ def test_waitForCondition_timeout(self):
+ self.selenium.setTimeout(100)
+ self.assertRaises(
+ AssertionError, self.selenium.waitForCondition, 'false')
+
+ def test_fireEvent_smoke(self):
+ self.selenium.fireEvent('css=body', 'click')
Added: gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py (rev 0)
+++ gocept.selenium/trunk/src/gocept/selenium/ztk/tests/test_ztk.py 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,21 @@
+#############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import gocept.selenium.ztk.testing
+import gocept.selenium.tests.isolation
+
+
+class ZTKTests(gocept.selenium.tests.isolation.IsolationTests,
+ gocept.selenium.ztk.testing.TestCase):
+ pass
Added: gocept.selenium/trunk/zope2.cfg
===================================================================
--- gocept.selenium/trunk/zope2.cfg (rev 0)
+++ gocept.selenium/trunk/zope2.cfg 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,29 @@
+[buildout]
+develop = .
+parts = test instance seleniumrc
+package = gocept.selenium
+
+[seleniumrc]
+recipe = collective.recipe.seleniumrc
+url = http://release.seleniumhq.org/selenium-remote-control/1.0.1/selenium-remote-control-1.0.1-dist.zip
+md5sum = 068b1adb26a7450717e6d6d67e261b58
+
+[test]
+recipe = collective.recipe.z2testrunner
+zope2part = instance
+defaults = --ignore_dir=ztk --ignore_dir=plone
+packages = ${buildout:package}
+
+[instance]
+recipe = plone.recipe.zope2instance
+zope2-location = ${zope2:location}
+user = admin:admin
+eggs = ${buildout:package}
+zcml = gocept.selenium.tests.fixture
+
+[zope2]
+recipe = plone.recipe.zope2install
+fake-zope-eggs = true
+additional-fake-eggs =
+ ZODB3
+url = http://www.zope.org/Products/Zope/2.11.4/Zope-2.11.4-final.tgz
Added: gocept.selenium/trunk/ztk.cfg
===================================================================
--- gocept.selenium/trunk/ztk.cfg (rev 0)
+++ gocept.selenium/trunk/ztk.cfg 2009-12-07 13:07:15 UTC (rev 106245)
@@ -0,0 +1,41 @@
+[buildout]
+develop = .
+parts = test seleniumrc instance
+package = gocept.selenium
+versions = versions
+
+[seleniumrc]
+recipe = collective.recipe.seleniumrc
+url = http://release.seleniumhq.org/selenium-remote-control/1.0.1/selenium-remote-control-1.0.1-dist.zip
+md5sum = 068b1adb26a7450717e6d6d67e261b58
+
+[versions]
+zope.testing = 3.8.3
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = ${buildout:package} [test_ztk,ztk]
+defaults = ['--ignore_dir', 'zope2', '--ignore_dir', 'plone']
+
+[instance]
+recipe = zc.zope3recipes:instance
+application = application
+zope.conf =
+ devmode on
+ <zodb>
+ <demostorage>
+ </demostorage>
+ </zodb>
+ <server http0>
+ address 9090
+ type WSGI-HTTP
+ </server>
+
+[application]
+recipe = zc.zope3recipes:application
+servers = zserver
+eggs =
+ ${test:eggs}
+site.zcml =
+ <include package="${buildout:package}" file="ftesting.zcml" />
+ <include package="zope.app.server"/>
More information about the checkins
mailing list