[ckan-dev] RFC: Webtests for CKAN

Dominik Moritz domoritz at gmail.com
Wed Sep 19 12:10:19 UTC 2012


As discussed in the last standup, 

There are quite a few testing frameworks available but I think only two major once make sense for ckan. The first is Twill and the second is WebTest.

# A few words about Twill:
Docs: http://twill.idyll.org/

## Pros:
* more straight forward language
* record sequences of actions

## Cons:
* uses only beautiful soup
* poor docs
* not actively maintained (however, there is a retwill fork on github)


# And a few words about WebTest:
Docs: http://webtest.pythonpaste.org/en/latest/index.html

## Pros:
* actively maintained
* integrated into major python web frameworks, recommended for pylons
* you can choose between lxml html, lxml xml, beautiful soup, pyquery and json
* good documentation

## Cons:
* No real webtesting (in an actual browser) since js is ignored
* sometimes a little bit difficult to understand how to select links/ forms.

Overall, I think WebTest is the way to go which is why I added a few quick examples tat demonstrate how to use forms, `click` and xpaths/ pyquery. Pull request: https://github.com/okfn/ckan/pull/130

The ticket for the whole thing is here: http://trac.ckan.org/ticket/2934

Sean suggested that we should talk about this in the next standup tomorrow.

Cheers,
Dominik



More information about the ckan-dev mailing list