IronPython-based utilities for testing via the WatiN framework
Python
Latest commit 85f4117 Oct 16, 2009 @rtyler Implement screenshotting capability in IronWatin in the form of a ser…
…ies of GIFs

In order to record a series of screenshots, you only need to use the
@IronWatin.record decorator i.e.:

	@IronWatin.record(prefix='mytest')
	def runTest(self):
		# Your test here
		self.browser.Element() # blah
		self.browser.Element() # blah

Will result in a series of screenshots being taken after each line of
execution, plus one final screenshot at the end of the runTest()

Additionall, IronWatin.captureScreenshot call can be used independently of the
@IronWatin.record() decorator to quickly snap a screenshot

README.markdown

IronWatin

The basic notion behind IronWatin is to use the flexibilty provided by IronPython and the testing power that WatiN provides for integration testing on Windows (not yet tested on Mac OS X or Linux via Mono).

Status

Currently IronWatin is quite basic in its implementation, providing a basic BrowserTest class which subclasses from the unittest.TestCase class provided by the standard unittest Python module.

Usage

IronWatin is intended on being used from a single-runner perspective, i.e.:

#!/usr/bin/env ipy

# The import of IronWatin will add a reference to WatiN.Core.dll
# and update `sys.path` to include C:\Python25\Lib and C:\Python26\Lib
# so you can import from the Python standard library
import IronWatin

import WatiN.Core as Watin

class MyTest(IronWatin.BrowserTest):
    url = 'http://www.github.com'

    def runTest(self):
        # Run some Watin commands

if __name__ == '__main__':
    IronWatin.main()

You can also add your own custom command-line parameters which will be added to every instance of your test cases, i.e.:

#!/usr/bin/env ipy

# The import of IronWatin will add a reference to WatiN.Core.dll
# and update `sys.path` to include C:\Python25\Lib and C:\Python26\Lib
# so you can import from the Python standard library
import IronWatin

import WatiN.Core as Watin
import optparse

class OptionTest(IronWatin.BrowserTest):
    url = 'http://www.github.com'

    def runTest(self):
        # Run some Watin commands
        assert self.testval

if __name__ == '__main__':
    opts = optparse.OptionParser()
    opts.add_option('--testval', dest='testval', help='Specify a value')
    IronWatin.main(options=opts)