[Checkins] SVN: zc.selenium/trunk/ added a selenium test for selftesting

Christian Zagrodnick cz at gocept.com
Mon Jan 19 07:59:45 EST 2009


Log message for revision 94833:
  added a selenium test for selftesting
  
  

Changed:
  U   zc.selenium/trunk/buildout.cfg
  U   zc.selenium/trunk/src/zc/selenium/configure.zcml
  U   zc.selenium/trunk/src/zc/selenium/tests.py

-=-
Modified: zc.selenium/trunk/buildout.cfg
===================================================================
--- zc.selenium/trunk/buildout.cfg	2009-01-19 12:53:46 UTC (rev 94832)
+++ zc.selenium/trunk/buildout.cfg	2009-01-19 12:59:45 UTC (rev 94833)
@@ -2,6 +2,7 @@
 parts =
     test
     py
+    application demo selenium
 develop = .
 
 [test]
@@ -14,3 +15,42 @@
 recipe = zc.recipe.egg
 eggs = zc.selenium
 interpreter = py
+
+
+### Selenium tests
+
+[application]
+recipe = zc.zope3recipes:application
+servers = zserver
+eggs =
+   ZODB3 == 3.8.1
+   zc.selenium
+   zope.app.server
+   zope.app.zcmlfiles
+site.zcml = <include package="zope.app.zcmlfiles" />
+            <include package="zope.app.server" />
+            <include package="zc.selenium" />
+
+[demo]
+recipe = zc.zope3recipes:instance
+application = application
+zope.conf =
+    devmode on
+    <zodb>
+      <demostorage>
+      </demostorage>
+    </zodb>
+    <server http0>
+      address 39857
+      type WSGI-HTTP
+    </server>
+    
+
+[selenium]
+recipe = zc.recipe.egg:scripts
+eggs = ${application:eggs}
+scripts = selenium
+entry-points = selenium=zc.selenium.selenium:main
+initialization =
+    sys.argv[1:1] = ['${demo:run-directory}/zope.conf', '-r']
+

Modified: zc.selenium/trunk/src/zc/selenium/configure.zcml
===================================================================
--- zc.selenium/trunk/src/zc/selenium/configure.zcml	2009-01-19 12:53:46 UTC (rev 94832)
+++ zc.selenium/trunk/src/zc/selenium/configure.zcml	2009-01-19 12:59:45 UTC (rev 94833)
@@ -39,4 +39,10 @@
     <allow attributes="suite" />
   </module>
 
+  <adapter
+    factory=".tests.TestSelenium"
+    name="zc.selenium.tests.TestSelenium"
+    permission="zope.Public"
+    />
+
 </configure>

Modified: zc.selenium/trunk/src/zc/selenium/tests.py
===================================================================
--- zc.selenium/trunk/src/zc/selenium/tests.py	2009-01-19 12:53:46 UTC (rev 94832)
+++ zc.selenium/trunk/src/zc/selenium/tests.py	2009-01-19 12:59:45 UTC (rev 94833)
@@ -17,9 +17,17 @@
 """
 
 import unittest
+import zc.selenium.pytest
 from zope.testing import doctest
 
 
+class TestSelenium(zc.selenium.pytest.Test):
+
+    def test_open(self):
+        self.selenium.open('http://%s/' % self.selenium.server)
+        self.selenium.verifyTextPresent('Login')
+
+
 def test_suite():
     return unittest.TestSuite([
         doctest.DocFileSuite('pytest.txt',



More information about the Checkins mailing list