[Webtest] Change to display test file name and line in reports

Dierk Koenig webtest@lists.canoo.com
Wed, 24 Sep 2003 18:37:28 +0200


Hi Marc,

thanx for the contribution.

The file reference is currently only reported in the error case.
I agree that it is also usefull for the general case.

cheers
Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Marc Guillemot
> Sent: Mittwoch, 24. September 2003 17:35
> To: webtest@gate.canoo.com
> Subject: [Webtest] Change to display test file name and line in reports
> 
> 
> I'm missing in the test reports an indication of the location of 
> the test script 
> (which file at which line). I think this is really usefull when 
> the number of 
> tests increases.
> I've performed a small change in
> com.canoo.webtest.reporting.addResultAttributes(Element resultElement)
> (line 179 in build 365)
> 
> Before:
> --------
> List steps = 
> fResult.getContext().getTestSpecification().getUserTestSteps();
> addNewAttribute(resultElement, "starttime", ((Step) 
> steps.get(0)).getStarted().toString());
> --------
> 
> after
> --------
> List steps = 
> fResult.getContext().getTestSpecification().getUserTestSteps();
> Step firstStep = (Step) steps.get(0);
> addNewAttribute(resultElement, "location", 
> firstStep.getLocation().toString());
> addNewAttribute(resultElement, "starttime", 
> firstStep.getStarted().toString());
> --------
> 
> this allows to have in the xml file something like:
> 
> <testresult
>    endtime="Wed Sep 24 16:51:57 CEST 2003"
> location="file:/home/marc/EWorkspace/junetz/web-app/WEB-INF/src/we
> btests/admin/accessLoginPage.def.xml:29: 
> "
>          starttime="Wed Sep 24 16:51:51 CEST 2003"
>          successful="yes" testspecname="add contact to institution">
> 
> This is not exactly the location of the <testSpec> opening tag as 
> it seems it 
> would need more changes to the current code, but it allows 
> already to get an 
> information on the location that can be formatted by the xslt.
> 
> Marc.
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 
>