Package omeroweb :: Package webgateway :: Package tests :: Module seleniumbase
[hide private]
[frames] | no frames]

Module seleniumbase

source code


Base class and utils to ease implementation of selenium tests.

To use this, create a file called C{seleniumtests.py} inside your app C{tests} folder,
and include the following template::

  from omeroweb.webgateway.tests.seleniumbase import SeleniumTestBase, Utils
  
  class MyTests (SeleniumTestBase):
      def runTest (self):
          " Implement your tests here "
  
  if __name__ == "__main__":
      Utils.runAsScript('MyDjangoAppURLPrefix')

Of course you'll need to replace C{MyDjangoAppURLPrefix} with a real value, and you
can implement tests in any way you want, so as long as unittest can run them.

By extending L{SeleniumTestBase} you get an instance variable names C{selenium} which
has the selenium RC client connected.

After all this is done, and assuming you have a standard C{Omero} installation, you'll
be able to issue:

  C{omero web seleniumtest MyDjangoApp seleniumserver.host http://omeroweb.host:port firefox}

The values above are just examples.

Classes [hide private]
  SeleniumTestServer
  Utils
  SeleniumTestBase
The base class for selenium tests.

Imports: selenium, unittest, time, urllib2, cookielib