[Webtest] Re: Simplifications
Denis N. Antonioli
webtest@lists.canoo.com
Tue, 21 Jun 2005 21:30:08 +0200
On 21 juin 05, at 12:14, Marc Guillemot wrote:
> it's now possible (but now yet documented) to skip <config> and to
> write a simple test like
>
> mytest.xml
> ----------
> <project name="webtest" default="simple" basedir=".">
> <target name="simple">
> <testSpec name="my first webtest">
> <steps>
> <invoke url="http://www.myHost.org/my/page.html"/>
> <verifyTitle description="test against fully constant
> title" text="My title"/>
> </steps>
> </testSpec>
> </target>
> </project>
> ----------
>
> and to run it with
> WEBTEST_HOME/bin/runWebtest.{bat|sh} mytest.xml
>
> This runs the test script and makes the html result file available
> in sub dir webtest-results/results.html.
>
> It works currently only with one test file (perhaps with many test
> files in the same dir but not in subdir) and
> therefore still needs some improvements. Nevertheless I think that
> it can already be usefull in particular for newbies
> and I propose to put such an example on Webtest stard page together
> with a screen copy of the resulting html report.
> What do you think?
+1
> Further simplification propositions (it has to stay compatible with
> current situation!!!):
>
> 1) we have the testSpec task:
> <testSpec name="my first webtest">
> What about:
> a- renaming it to "webtest"?
> -> more natural, doesn't need to "learn" a new keyword
+1
> b- use "description" attribute instead of "name"?
> -> it is the standard way for an ant task to describe its function
-1
Webtest's reports are a very strong selling point now with some users.
If I think at the usage I have, I'd like to have both a name and a
description, so that I could have for example:
<webtest name="verifyCookie_1" description="Shows how basic usage of
verifyCookie. Note that the test verify both blah blah blah..." >
The report could then looks like:
<h4> verifyCookie_1</h4>
<p>Shows how basic usage of verifyCookie. Note that the test verify
both blah blah blah...</p>
<table>
... results of the steps ...
</table>
How about:
c- make both "name" and "description" optional
> 2) remove <steps>
> the steps could be directly in the <webtest>. As far as I know,
> this additional nested level doesn't bring anything.
>
> With these simplifications, the simple test could look like
>
> mytest.xml
> ----------
> <project name="webtest" default="simple" basedir=".">
> <target name="simple">
> <webtest>
--> note, there is even less to write ;-)
> <invoke url="http://www.myHost.org/my/page.html"/>
> <verifyTitle description="test against fully constant title"
> text="My title"/>
> </webtest>
> </target>
> </project>
> ----------
dna
--
perl cannot be taught. It is an art form unto itself.
-- Jason Hoos