[Checkins] SVN: gocept.selenium/trunk/ Described how to test a Zope 2/Plone application if using `plone.testing` to set up test layers.

Michael Howitz mh at gocept.com
Wed Jul 27 04:47:45 EDT 2011


Log message for revision 122371:
  Described how to test a Zope 2/Plone application if using `plone.testing` to set up test layers.
  
  

Changed:
  U   gocept.selenium/trunk/CHANGES.txt
  U   gocept.selenium/trunk/src/gocept/selenium/README.txt

-=-
Modified: gocept.selenium/trunk/CHANGES.txt
===================================================================
--- gocept.selenium/trunk/CHANGES.txt	2011-07-26 15:28:47 UTC (rev 122370)
+++ gocept.selenium/trunk/CHANGES.txt	2011-07-27 08:47:44 UTC (rev 122371)
@@ -6,7 +6,10 @@
 
 - Added some notes how to test a Zope 2 WSGI application.
 
+- Described how to test a Zope 2/Plone application if using `plone.testing`
+  to set up test layers.
 
+
 0.10.1 (2011-02-02)
 -------------------
 

Modified: gocept.selenium/trunk/src/gocept/selenium/README.txt
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/README.txt	2011-07-26 15:28:47 UTC (rev 122370)
+++ gocept.selenium/trunk/src/gocept/selenium/README.txt	2011-07-27 08:47:44 UTC (rev 122371)
@@ -114,7 +114,7 @@
 
     $ java -jar /path/to/selenium-server.jar
 
-#. Run bin/test and see it work!
+#. Run `bin/test` and see it work!
 
 
 Quick start with ZTK (zope.app.wsgi)
@@ -125,13 +125,42 @@
 start with Grok`_.
 
 
-Quick start with Zope 2/Plone
------------------------------
+Quick start with Zope 2/Plone (general)
+---------------------------------------
 
-Essentially the same, just use gocept.selenium.zope2 or gocept.selenium.plone
-instead of gocept.selenium.ztk.
+Essentially the same like `Quick start with ZTK (zope.app.testing)`_, just:
 
+* depend on `gocept.selenium[zope2]` resp. `gocept.selenium[plone]` instead
+  of `gocept.selenium[ztk]`.
 
+* use ``gocept.selenium.zope2`` resp. ``gocept.selenium.plone`` instead of
+  ``gocept.selenium.ztk``.
+
+Quick start with Zope 2/Plone (plone.testing)
+---------------------------------------------
+
+If you use `plone.testing` to set up the test layers for your Zope2
+resp. Plone package you can follow these steps:
+
+#. Depend on `gocept.selenium[zope2]` resp. `gocept.selenium[plone]` in your
+   `setup.py`.
+
+#. Create a `plone.testing` layer which loads your package and its ZCML
+   configuration. (See documentation of `plone.testing` how to do this.)
+
+#. Create a layer for the selenium tests like this::
+
+    selenium_layer = gocept.selenium.zope2.Layer(MY_PLONE_TESTING_LAYER)
+
+   (You might need to exchange ``zope2`` by ``plone`` in this statement.)
+
+#. Create a test case and run the tests like described in `Quick start with
+   ZTK (zope.app.testing)`_. But use ``gocept.selenium.zope2.TestCase`` resp.
+   ``gocept.selenium.plone.TestCase`` instead of
+   ``gocept.selenium.ztk.TestCase`` as test base class.
+
+
+
 Quick start with Grok
 ---------------------
 



More information about the checkins mailing list