Support for WSGI and Grok testlayer flavours
`tha.selenium` is a package we use at The Health Agency, which adds support for 1) testing grok apps with gocept.selenium and 2) adjusting gocept.selenium behavior through environment variables. I ported the tha.selenium changes to gocept.selenium in the `janjaapdriessen-wsgi` branch in svn.zope.org and hope we can integrate these in gocept.selenium:
- gocept.selenium.wsgi.WSGILayer allows wsgi applications to be tested.
- gocept.selenium.grok.GrokLayer depends on gocept.selenium.wsgi.WSGILayer and can be used to test grok apps. Grok > 1.2 doesn't depend on zope.app.testing any longer, therefore we can not use gocept.selenium.ztk.Layer. Quite possibly, bluebream applications could also be tested with this layer, in which case we should rename it. The GrokLayer depends on the testlayers in zope.app.appsetup and zope.component.
- in gocept.selenium.base you will find the environment variables that can be used to:
1. locate the selenium server;
2. make the selenium server find the local application;
3. select a browser to run the tests with;
4. control the speed of the selenium tests.
At The Health Agency, we use buildbot and selenium grid to run tests on all common browsers. These environment variables help in setting up the interaction.
There are some caveats and questions that I would like your opinion on:
- There is no switch_db support in gocept.selenium.wsgi.WSGILayer, because we can not know whether the WSGI app is running a database that needs to be switched.
- The switch_db in gocept.selenium.grok.GrokLayer has been moved to the layer's testSetUp.
- Is gocept.selenium in any buildbot? Otherwise, I would like to add it to http://dev.thehealthagency.com/buildbot
- The default value for the APP_HOST is '0.0.0.0' in order to help the selenium grid slaves access the local application and because I use firefox on a different machine to dive into a running selenium test. With 'localhost' I can not access the application being tested as easily.
- python2.4 compliance - to what extend do changes to gocept.selenium need to be 2.4 compliant?
If you agree with these changes, I will update the documentation to reflect these changes and prepare a release.