您的位置:軟件測(cè)試 > 開(kāi)源軟件測(cè)試 > 開(kāi)源單元測(cè)試工具 > TestNG
jenkins+testng+ant+webdriver持續(xù)集成測(cè)試
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2013/12/18 10:24:20 ] 推薦標(biāo)簽:

    <target name="init" description = "create classes file">

<!--mkdir means : create file:classes-->

        <mkdir dir="${dest}" />

    </target>

    <target name="compile" depends="init">

        <javac srcdir="${src}" destdir="${dest}" classpathref="compile.path" encoding="UTF-8"/>

    </target>

     <!--run testng ant task-->

     <taskdef resource="testngtasks" classpath="${lib.dir}/testng-6.4.jar" />       

     <target name="start_server_and_run_tests" depends="compile" description="start selenium server and run tests">

         <parallel>           

             <antcall target="run_tests">

             </antcall>

         </parallel>

     </target>

    

     <target name="run_tests" depends="compile">   

         <testng classpathref="compile.path"  failureproperty="test.failed">        

             <!--xml test suite file -->

             <xmlfileset dir="${basedir}">

                 <include name="testng.xml" />

             </xmlfileset>                       

         </testng>       

         <antcall target="sendReport" />      

         <fail message="ERROR: test failed!!!!!" if="test.failed" />

     </target>    

    <target name="sendReport">   

        <delete dir="${dest}"/>   

        <antcall target="transform" />

    </target>   

    <target name="transform">

        <xslt in="${basedir}/test-output/testng-results.xml" style="${basedir}/test-output/testng-results.xsl" out="${basedir}/test-output/index1.html" classpathref="compile.path">

            <!-- you need to specify the directory here again -->

            <param name="testNgXslt.outputDir" expression="${basedir}/test-output/" />

            <param name="testNgXslt.showRuntimeTotals" expression="true"/>

            <!--<classpath refid="compile.path" />-->

        </xslt>

    </target>

</project>

這樣我的整個(gè)環(huán)境搭成了,寫代碼及調(diào)試用了將近一周,而配置實(shí)際上只用了一個(gè)上午;

希望你也能成功;從此不用打開(kāi)idea直接用jenkins可以搞定了。

上一頁(yè)12345下一頁(yè)
軟件測(cè)試工具 | 聯(lián)系我們 | 投訴建議 | 誠(chéng)聘英才 | 申請(qǐng)使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd