[Webtest] Unique Directory for reports not possible?

Troy McGuire webtest@lists.canoo.com
Thu, 06 Jul 2006 17:01:05 -0700


So I finally figured out how to make a suite of tests run and have 
everything reported in HTML.  Today I decided to make WebTest create a 
directory for the results based on the timestamp from when the test was 
run.  It does create a directory named after the timestamp with 
everything except the "results.html" file.  I even added <include 
name="results.html"/> to a portion of my script, but same results.  Does 
anyone know what's going on here?  It seems like something in the 
background is hard-coded.  Do I have to have my previous report 
over-written by the current one every time I run a test?  Below is my 
script.

Thank You,

Troy
troy at spawn or die dot com
----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project SYSTEM 
"/usr/local/sbin/canoo_webtest/selftests/config/WebTest.dtd">

<project name="All Tests" basedir="." default="testSuite">
    <tstamp>
        <format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss" />
    </tstamp>
    <property name="webtest.home" 
location="/usr/local/sbin/canoo_webtest" />
    <property name="test.dir" 
location="/usr/local/www/customer.com/qa/canoo_webtest" />
    <property name="test.file" value="mybuild_02.xml" />
    <property name="webtest.resultpath" 
value="${test.dir}/webtest-results/${timestamp}"/>
    <property name="webtest.resultfile" value="results.xml"/>
    <property name="webtest.resultfile.html" 
value="${webtest.resultpath}/results.html"/>
    <import file="${webtest.home}/lib/taskdef.xml" />
   
    <target name="init" description="Checks that needed properties are 
defined">
        <fail message="test.file should be set" unless="test.file" />
        <fail message="test.dir should be set" unless="test.dir" />
    </target>
   
    <target name="testSuite" depends="init" description="Runs the Test 
Suite">
        <mkdir dir="${webtest.resultpath}" />
        <antcall target="cleanUp" />
        <antcall target="test.suite" />
        <antcall target="formatResults" />
    </target>
   
    <target name="cleanUp" description="Deletes all generated files" 
unless="webtest.skipCleanup">
        <delete>
            <fileset dir="${webtest.resultpath}" includes="**/*.*ml" />
        </delete>
    </target>
   
    <target name="formatResults" description="Formats the XML result 
file using XSL">
        <tstamp>
            <format property="report.time" pattern="dd.MM.yyyy HH:mm" 
locale="us" />
        </tstamp>
        <property name="resources.dir" value="${webtest.home}/resources"/>
        <style
                basedir="${webtest.resultpath}"
                destdir="${webtest.resultpath}"
                includes="${webtest.resultfile}"
                force="true"
                extension=".html"
                style="${resources.dir}/WebTestReport.xsl">
            <param name="reporttime" expression="${report.time}"/>
            <param name="title" expression="${ant.project.name}"/>
        </style>
        <!-- copy resources needed by the html page to the same dir: the 
report must be ok too when opened from filesystem (without webserver) -->
        <copy todir="${webtest.resultpath}">
            <fileset dir="${resources.dir}">
                <include name="report.css"/>
                <include name="showHide.js"/>
                <include name="images/*.*"/>
                <include name="results.html"/>
            </fileset>
        </copy>       
        <echo message="Webtest result overview available in 
${webtest.resultfile.html}"/>
    </target>

    <target name="test.suite">
        <ant antfile="customer_loginpage_02.xml"/>
        <ant antfile="customer_login_02.xml"/>
    </target>
</project>