Testing a webapp

rats on 2005-02-21T22:16:34

Another complication for me is that there are no automated tests for the existing app. Seems they tested by sitting one guy at one terminal to edit some test data and another guy at another terminal clicked the various buttons on the webpage to see that it responded appropriately. Not very efficient in my view (but I wasn't there when the deadline was a couple of hours away and reputations were on the line...)

So I need some repeatable automated tests to verify the rewrite at least does everything the old app did as well as being able to check the new stuff. I decided to write a controllable xmlrpc server to fake the real server. Two reasons for this: one is that I need to be able to repeat the information that the server hands my webapp (the real server data changes constantly (is that an oxymoron?)); and secondly the team handling the rewrite for the new processes are behind schedule and they can't give me the new data yet (at least the call names have been finalised) so I need a way to fake it.

I also want to have tests which automatically configure the server to supply known data then make a call on the webapp and scrape the results out of the HTML and verify the webapp has responded correctly. This is a job for Test::More, WWW::Mechanize. and Test::WWW::Mechanize