[ckan-dev] RFC: Webtests for CKAN

Sean Hammond sean.hammond at okfn.org
Thu Sep 20 15:00:08 UTC 2012


> P.P.S. Dominik I see that you're calling these "integration" tests, in
> CKAN currently these kind of UI tests (that use paste.fixture.TestApp)
> are called "functional" tests (see ckan/tests/functional). So maybe you
> just want to call yours functional tests, or maybe there's a distinction
> to be made between functional tests that test the contents of individual
> pages in detail and process or integration tests that test clicking
> through multiple pages but without checking the contents of each page in
> thorough detail.

Ah, I see you already clarified this in your trac ticket:

"The tests in CKAN only test single pages (functional tests) or single
methods (unit tests). In order to make sure that the whole system still
works as expected, we need tests that cover whole processes.

"An example user story to be tested would be: "As a user with create
permissions I want to be able to log in, create a new resource, save it
and then make sure that it is in the system." or: "As a user I want to
use the search functionality and open a resource from the search page."

"These user stories require a different testing system with interaction
and processes."

That's fine then. I really like the idea that we can take user stories
and translate them directly into one test per user story.

So I think there are two main jobs to be done for CKAN 2.0 with WebTest:

1. Write some of these process tests, which CKAN has never had before

2. Write new functional tests that work with the new templates (afaik
there are currently no functional tests for the new templates, right?)

P.S. Your example tests in your pull request look fine to me Dominik.
One complaint, I don't like your WebAppTest class, I know it's just a
small handy class but I don't like using inheritance in tests cases even
if it does save a bit of typing, I would rather see repetitive but super
simple code in the tests, look at some of the base classes in the
existing CKAN classes to see why it's not a good idea to start down this
road.




More information about the ckan-dev mailing list