[Checkins] SVN: gocept.selenium/trunk/ tests with plone.app.testing

Godefroid Chapelle gotcha at bubblenet.be
Tue Oct 19 09:59:18 EDT 2010


Log message for revision 117763:
  tests with plone.app.testing
  corresponding buildout
  

Changed:
  A   gocept.selenium/trunk/plone4-plone.testing.cfg
  A   gocept.selenium/trunk/src/gocept/selenium/plone/tests/plone4plonetesting/
  U   gocept.selenium/trunk/src/gocept/selenium/plone/tests/plone4plonetesting/test_plone4.py

-=-
Copied: gocept.selenium/trunk/plone4-plone.testing.cfg (from rev 117760, gocept.selenium/trunk/plone4.cfg)
===================================================================
--- gocept.selenium/trunk/plone4-plone.testing.cfg	                        (rev 0)
+++ gocept.selenium/trunk/plone4-plone.testing.cfg	2010-10-19 13:59:18 UTC (rev 117763)
@@ -0,0 +1,33 @@
+[buildout]
+extensions = mr.developer
+extends = http://dist.plone.org/release/4.0-latest/versions.cfg
+develop = .
+parts = instance test omelette
+package = gocept.selenium
+find-links = http://download.gocept.com/packages
+versions = versions
+sources-dir = devel
+
+[sources]
+plone.testing = svn https://svn.plone.org/svn/plone/plone.testing/trunk
+
+[versions]
+PILwoTK = 1.1.6.4
+
+[test]
+recipe = zc.recipe.testrunner
+defaults = ["--ignore_dir=ztk", "--ignore_dir=zope",  "--ignore_dir=static", "--tests-pattern=plone4plonetesting"]
+eggs = ${instance:eggs}
+       plone.app.testing
+
+[instance]
+recipe = plone.recipe.zope2instance
+user = admin:admin
+eggs = ${buildout:package}
+    Plone
+    PILwoTK
+zcml = gocept.selenium.tests.fixture
+
+[omelette]
+recipe = collective.recipe.omelette
+eggs = ${test:eggs}

Modified: gocept.selenium/trunk/src/gocept/selenium/plone/tests/plone4plonetesting/test_plone4.py
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/plone/tests/plone4/test_plone4.py	2010-10-19 13:29:18 UTC (rev 117760)
+++ gocept.selenium/trunk/src/gocept/selenium/plone/tests/plone4plonetesting/test_plone4.py	2010-10-19 13:59:18 UTC (rev 117763)
@@ -16,28 +16,27 @@
 import gocept.selenium.zope2
 from gocept.selenium.zope2 import testing
 import gocept.selenium.tests.isolation
-import Products.PloneTestCase.PloneTestCase
 
-from Products.PloneTestCase.layer import PloneSiteLayer
+from plone.app.testing.layers import PLONE_FIXTURE
+from plone.app.testing.layers import SITE_OWNER_NAME
+from plone.app.testing.layers import SITE_OWNER_PASSWORD
 
-Products.PloneTestCase.PloneTestCase.setupPloneSite(id='plone')
 
-
 class Plone4Tests(gocept.selenium.tests.isolation.IsolationTests,
                  gocept.selenium.plone.TestCase):
 
-    layer = gocept.selenium.zope2.Layer(PloneSiteLayer, testing.isolationLayer)
+    layer = gocept.selenium.zope2.Layer(PLONE_FIXTURE, testing.isolationLayer)
 
     def test_plone_login(self):
         sel = self.selenium
         sel.open('/plone')
         sel.click('link=Log in')
         sel.waitForElementPresent('name=__ac_name')
-        sel.type('name=__ac_name', 'portal_owner')
-        sel.type('name=__ac_password', 'secret')
+        sel.type('name=__ac_name', SITE_OWNER_NAME)
+        sel.type('name=__ac_password', SITE_OWNER_PASSWORD)
         sel.click('name=submit')
         sel.waitForPageToLoad()
-        sel.assertTextPresent('portal_owner')
+        sel.assertTextPresent(SITE_OWNER_NAME)
 
 
 def test_suite():



More information about the checkins mailing list