Skip to main content

Plone TestCase integration with Windmill testing

Project description

About

niteoweb.windmill wraps Plone’s FunctionalTestCase with support of running Windmill tests. This is achieved by specifying additional layer which starts ZServer and Windmill server.

Windmill supports most of modern browser. Controller API can be found at http://trac.getwindmill.com/wiki/ControllerApi

Terminology

WindmillTestCase will have wm object available (instance of WindmillClient) as an attribute. This client has an extra wm.open_site method which automatically adds plone site to url and later calls wm.open.

All configuration is done on WindmillTestCase.layer object.

Usage

Basic usage:

from Products.PloneTestCase import PloneTestCase as ptc
from niteoweb.windmill import WindmillTestCase


ptc.setupPloneSite()

class TestSample(WindmillTestCase):
    def afterSetUp(self):
        self.setRoles(['Manager'])
        self.login_user()

    def test_foo(self):
        self.wm.open_site(url="/about")
        self.wm.waits.forPageLoad(timeout=30000)


def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestSample))
    return suite

Advanced usage:

from Products.PloneTestCase import PloneTestCase as ptc

from niteoweb.windmill import WindmillTestCase, WindmillLayer

WindmillLayer.site = 'plone2'
WindmillLayer.windmill_settings['START_FIREFOX'] = False
WindmillLayer.windmill_settings['START_CHROME'] = True

ptc.setupPloneSite()

class TestWM(WindmillTestCase):
    layer = WindmillLayer

    def afterSetUp(self):
        self.setRoles(['Manager'])
        self.login_user()

    def test_foo(self):
        self.wm.open_site('/login_form', site='plone2')
        self.wm.waits.forPageLoad(timeout=30000)

    def test_suite():
        from unittest import TestSuite, makeSuite
        suite = TestSuite()
        suite.addTest(makeSuite(TestWM))
        return suite

and run tests with debug mode to stop on error/failure:

bin/instance test -s package.module -t test_foo -D

Known issues

  • First request made with windmill on startup always fails. This defaults to http://ip:port/. Also if you make this default to plone site, some wierd PortletManager error occurs

  • On teardown, sometimes you will get AttributeError: ‘NoneType’ object has no attribute ‘exc_info’, ignore it

  • windmill is very poorly tested on Python2.4, submit bugs if you stumble upon any;)

TODO

  • Some simple integration to load existing ZODB storages

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

niteoweb.windmill-0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

niteoweb.windmill-0.1-py2.4.egg (9.5 kB view details)

Uploaded Egg

File details

Details for the file niteoweb.windmill-0.1.tar.gz.

File metadata

File hashes

Hashes for niteoweb.windmill-0.1.tar.gz
Algorithm Hash digest
SHA256 b0e3e35d48cf101c49fd8fcd9b74eedfb6c4ef2ec88febfc7a9f9ef995117428
MD5 a22e03c4953b089e01e21cae999a4044
BLAKE2b-256 928f703a801a6e9501fd0b327cb72fba6329b8d4968fe86d2852ee786e8deecc

See more details on using hashes here.

File details

Details for the file niteoweb.windmill-0.1-py2.4.egg.

File metadata

File hashes

Hashes for niteoweb.windmill-0.1-py2.4.egg
Algorithm Hash digest
SHA256 29fee42ae764d5ea3335236f1db6001dbee2bc8bbca88a6d67eb01312f1a0e83
MD5 2513c92d355ec3aaf8a06f60647d26d7
BLAKE2b-256 1eddaf52a1844b3f970b41a78e9f3e52a5ecddbc30cf887f47d7ca70c81b49bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page