Re: [tclwebtest] Passing variable parameters to test scripts
Status: Abandoned
Brought to you by:
tils
From: Tilmann S. <ti...@ti...> - 2003-02-15 11:17:45
|
Is your cambios-tclwebtest-2003-01-27b patch the latest one regarding the issue of avoiding the usage of temporary files? The approach I took with the temporary files looks like a huge hack to me and it would be greatly appreciated if you'd remove that. I remember that it seemed necessary in order to be able to retrieve the _comment_ lines immediately before the command that failed, which looks like an unnecessary requirement to me now. We should consider introducing a better way to include msg-if-next-command-fails in the tests. One way would be to include a parameter for each of the commands that can cause a test failure. I think that is the standard testing framework approach. Another idea would be to add a command like msg that takes one string as argument, which will be saved internally and only output if a following command produces a failure. To reset the fail_msg one would simply call it with no arguments or an empty string. A test could thus look like this: msg { Logging in } do_request $some_url link follow "login" field fill $password form submit msg Or it could optionally wrap the code in a block so that the message is only valid for that block: msg { Logging in } { do_request $some_url link follow "login" field fill $password form submit } What is your opinion on the best syntax? We might also introduce a common test declaration command along with it which could come at the top of each file and which would make use of the api doc generator, like this: twt_test login { This test logs in to the website using the standard password. @author til } do_request ... There are propably better names for these and maybe more that could be learnt from other testing frameworks, but why I actually wrote it is to say that the current requirement to be able to read the tcl comments from the test source code is not really important, so don't jump through big loops to preserve it when modifying tclwebtest to use strings instead of temporary files, and please commit your patch with these modifications, if not already done. cheers, Til |