[Checkins] SVN: gocept.selenium/trunk/ Script that generates python tests from Selenium HTML tables.

Godefroid Chapelle gotcha at bubblenet.be
Tue Jan 18 06:13:11 EST 2011


Log message for revision 119639:
  Script that generates python tests from Selenium HTML tables.
  
  merged from branch gotcha-generator
  

Changed:
  _U  gocept.selenium/trunk/
  U   gocept.selenium/trunk/CHANGES.txt
  U   gocept.selenium/trunk/plonetesting-plone3.cfg
  A   gocept.selenium/trunk/scripts.cfg
  U   gocept.selenium/trunk/setup.py
  U   gocept.selenium/trunk/src/gocept/selenium/README.txt
  A   gocept.selenium/trunk/src/gocept/selenium/scripts/

-=-

Property changes on: gocept.selenium/trunk
___________________________________________________________________
Modified: svn:ignore
   - develop-eggs
fake-eggs
var
downloads
bin
parts
.installed.cfg
dist
.mr.developer.cfg
devel

   + develop-eggs
fake-eggs
var
downloads
bin
parts
.installed.cfg
dist
.mr.developer.cfg
devel
coverage


Modified: gocept.selenium/trunk/CHANGES.txt
===================================================================
--- gocept.selenium/trunk/CHANGES.txt	2011-01-18 11:00:16 UTC (rev 119638)
+++ gocept.selenium/trunk/CHANGES.txt	2011-01-18 11:13:11 UTC (rev 119639)
@@ -4,11 +4,13 @@
 0.10 (unreleased)
 -----------------
 
+- Script that generates python tests from Selenium HTML tables.
+  Reused from KSS project, courtesy of Jeroen Vloothuis, original author.
+
 - Using a URL of `Selenium RC` in README where version 1.0.3 can be
   downloaded (instead of 1.0.1) which works fine with Firefox on Mac OS X,
   too.
 
-
 0.9 (2010-12-28)
 ----------------
 

Modified: gocept.selenium/trunk/plonetesting-plone3.cfg
===================================================================
--- gocept.selenium/trunk/plonetesting-plone3.cfg	2011-01-18 11:00:16 UTC (rev 119638)
+++ gocept.selenium/trunk/plonetesting-plone3.cfg	2011-01-18 11:13:11 UTC (rev 119639)
@@ -1,10 +1,11 @@
 [buildout]
 extends = common.cfg
           common-zope210.cfg
+          scripts.cfg
 flavour = [plonetesting, test_plonetesting]
 extensions = mr.developer
 sources-dir = devel
-parts += omelette
+parts += omelette scripts
 
 [sources]
 plone.testing = svn https://svn.plone.org/svn/plone/plone.testing/branches/3.x
@@ -18,9 +19,22 @@
 
 [test]
 defaults = ['-s', 'gocept.selenium.plonetesting.tests.plone3',
+            '-s', 'gocept.selenium.scripts.tests',
             '--tests-pattern', 'test_']
+eggs += gocept.selenium [test_script]
 extra-paths = ${zope2:location}/lib/python
 
+[coverage-test]
+recipe = zc.recipe.testrunner
+eggs = ${test:eggs}
+defaults = ['--coverage', '${buildout:directory}/coverage']
+extra-paths = ${zope2:location}/lib/python
+
+[coverage-report]
+recipe = zc.recipe.egg
+eggs = z3c.coverage
+arguments = ('coverage', 'coverage/report')
+
 [omelette]
 recipe = collective.recipe.omelette
 eggs = ${test:eggs}

Copied: gocept.selenium/trunk/scripts.cfg (from rev 119638, gocept.selenium/branches/gotcha-generator/scripts.cfg)
===================================================================
--- gocept.selenium/trunk/scripts.cfg	                        (rev 0)
+++ gocept.selenium/trunk/scripts.cfg	2011-01-18 11:13:11 UTC (rev 119639)
@@ -0,0 +1,3 @@
+[scripts]
+recipe = zc.recipe.egg:scripts
+eggs = gocept.selenium [script]

Modified: gocept.selenium/trunk/setup.py
===================================================================
--- gocept.selenium/trunk/setup.py	2011-01-18 11:00:16 UTC (rev 119638)
+++ gocept.selenium/trunk/setup.py	2011-01-18 11:13:11 UTC (rev 119639)
@@ -78,5 +78,16 @@
             'PILwoTK',
             'plone.app.testing',
             ],
+        script=[
+            'elementtree',
+            ],
+        test_script=[
+            'mock',
+            ],
     ),
+    entry_points={
+          'console_scripts': [
+                  'converthtmltests = gocept.selenium.scripts.converthtmltests:main',
+                  ],
+          }
 )

Modified: gocept.selenium/trunk/src/gocept/selenium/README.txt
===================================================================
--- gocept.selenium/trunk/src/gocept/selenium/README.txt	2011-01-18 11:00:16 UTC (rev 119638)
+++ gocept.selenium/trunk/src/gocept/selenium/README.txt	2011-01-18 11:13:11 UTC (rev 119639)
@@ -126,7 +126,50 @@
    plonetesting.testing_plone/plonetesting.tests.plone{3,4} for some examples
    of integrating with Zope2 and Plone, respectively.
 
+Selenium HTML tests conversion script
+-------------------------------------
 
+Selenium tests can be written in HTML tables. 
+
+Their syntax is a bit clunky. But their development and debugging is eased a
+lot by using Selenium IDE Firefox extension. 
+Selenium IDE provides both initial recording of tests and stepping through 
+those tests.
+However, HTML tests have a main drawback : they are hard to include in a
+continuous integration system.
+
+``gocept.selenium`` provides a script that converts a set of
+Selenium HTML tests into a Python module (based on ``gocept.selenium`` and
+``plone.testing``). That Python module contains a ``TestCase`` that can be included in any
+``zope.testing`` test suite.
+
+Using the ``converthtmltests`` script, the developer can use HTML tests - written, 
+debugged and maintained with the Selenium tools -
+while being able to easily include those Selenium
+tests in a continuous integration system.
+
+Usage
+~~~~~
+
+See hereunder an excerpt of the help provided by the script ::
+
+    converthtmltests -l LAYER [options] directory
+
+    options:
+      -f FILE, --file=FILE  write tests to FILE
+      -l LAYER, --layer=LAYER
+                            full python import path to layer instance
+
+The script gathers and converts all Selenium HTML tests found in the mentioned
+directory.
+
+The user must refer to a ``plone.testing`` layer by specifying its Python import path.
+That layer is set on the test case generated in the Python module.
+
+An output file can be specified. In case no output file name is specified,
+the module produced is named ``tests_all_selenium.py``.
+
+
 Controlling gocept.selenium through environment variables
 ---------------------------------------------------------
 



More information about the checkins mailing list