Wednesday, June 25, 2008

concordion:run

I just became a committer at Concordion.org and I'm really happy for the confidence.

The basic questions: What have I committed?

The answer is: concordion:run which is a way to run another Concordion testes form this test. An example (would be handy right about now):

check this test

code:

<html>...<body> ... <a href="checkThis.html" concordion:run="concordion">check this test</a> ... </body></html>

This test will run the "checkThis.html" concordion test.

You might think that it doesn't matter what you put in attribute value. That it's just there for completeness and the story would end there, but that’s not the case.

One to rule them all

I think that a lot of people have invested a lot of time and effort in learning other frameworks like FIT, CubicTest and so on. So why can’t we just write Concordion tests like this:

Given users in the database when Bob logs in with password "password" and changes password to "secret" then the password is "secret".

code:

<html>
...
<body>
...
<p>
<a href="../fit/userSetup.html" concordion:run="fit">Given users in the database </a>
when <span concordion:set="#user">Bob</span> <a href="../cubictest/login.aat" concordion:run="cubictest">logs in</a> with password "<span concordion:set="#password">password</span>"
and <a href="../cubictest/changePassword.aat"
concordion:run="cubictest">changes password </a> to "<span concordion:set="#newpassword">secret</span>" then the password is "<span concordion:assertEquals="passwordFor(#user)">secret</span>".
</p>
...
</body>
</html>

I've just used FIT to set up the database as I had that functionality in a fit test already, then I used concordion to set what user to log in with in CubicTest and changed the username with CubicTest before I used Concordion to check the database to see if the new password was set. The functionality isn’t there yet, but it’s coming.

0 comments: