testNg-build.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="run" name="Demo">
    <property name="src" value="${basedir}\src" />
    <property name="bin" value="${basedir}\bin" />
    <property name="lib" value="${basedir}\libs" />
    <property name="report" value="${basedir}\test-output" />
    <property name="suite" value="${basedir}" />
    <property name="debuglevel" value="source,lines,vars" />
 
    <tstamp>
        <format property="nowstamp" pattern="yyyyMMdd-HHmmss" locale="en" />
    </tstamp>
 
    <path id="classpath">
        <pathelement location="." />
        <pathelement location="${bin}" />
        <fileset dir="${lib}/">
            <include name="**/*.jar" />
        </fileset>
    </path>
 
    <path id="sourcepath">
        <pathelement location="./src" />
    </path>
 
    <target name="clean">
        <delete dir="${bin}" failοnerrοr="No" />
        <mkdir dir="${bin}" />
    </target>
 
    <target depends="clean" name="build">
        <javac srcdir="${src}" debug="true" sourcepathref="sourcepath" debuglevel="${debuglevel}" destdir="${bin}">
 
            <classpath refid="classpath" />
 
        </javac>
    </target>
 
    <taskdef resource="testngtasks" classpath="${lib}/testng-6.8.5.jar" />
    <target name="run" depends="build">
        <testng classpathref="classpath" outputdir="${report}/${nowstamp}" failureproperty="test.failed">
            <!--xml test suite file -->
            <xmlfileset dir="${suite}">
                <include name="adminTestNG.xml" />
            </xmlfileset>
        </testng>
 
        <xslt in="${report}/${nowstamp}/testng-results.xml" style="${report}/tool/testng-results.xsl" out="${report}/${nowstamp}/indexNew.html">
 
            <!-- you need to specify the directory here again -->
 
            <param name="testNgXslt.outputDir" expression="${report}/${nowstamp}/" />
 
            <classpath refid="classpath" />
        </xslt>
 
        <fail message="ERROR: One or more tests failed! Check test reports " if="test.failed" />
 
    </target>
 

</project>



转载于:https://www.cnblogs.com/xxyBlogs/p/6151785.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值