selenium +TestNG+ reportng 的ant配置
2014-09-06 20:11
477 查看
<project name="AUTO_TEST" basedir="." default="run_tests"> <property name="src" value="src" /> <property name="dest" value="classes" /> <property name="lib.dir" value="${basedir}/lib" /> <property name="output.dir" value="${basedir}/test-output" /> <!--<property name="testcase" value="${src}/com/selenium/testcase" />--> <path id="compile.path"> <fileset dir="${lib.dir}/"> <include name="*.jar" /> </fileset> <pathelement location="${src}" /> <pathelement location="${dest}" /> </path> <target name="init"> <mkdir dir="${dest}" /> <!--<delete dir="${dest}"></delete> <delete dir="${testcase}"></delete> <mkdir dir="${dest}" />--> </target> <target name="compile" depends="init"> <echo>compile tests</echo> <javac srcdir="${src}" destdir="${dest}" encoding="UTF-8" classpathref="compile.path" /> </target> <!-- <target name="run" depends ="compile"> <java classname ="Proxy"> <classpath> <pathelement path="${dest}/com/selenium/util"/> </classpath> </java> </target>--> <taskdef resource="testngtasks" classpath="${lib.dir}/testng-6.8.5.jar" /> <!-- <taskdef name="testng" classname="${dest}/org.testng.TestNGAntTask"/>--> <!-- 开始测试 --> <target name="run_tests" depends="compile"> <echo>running tests</echo> <testng classpathref="compile.path" outputdir="${output.dir}" haltonfailure="no" failureproperty="failed" parallel="true" useDefaultListeners="true" listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter" threadCount="3" > <xmlfileset dir="${basedir}/src/com/selenium" includes="TestNG1.xml" /> <classfileset dir="${dest}"> <include name="/*.class" /> </classfileset> <sysproperty key="org.uncommons.reportng.title" value="My Test Report"/> </testng> <!--<antcall target="transform1" />--> <!-- <fail message="TEST FAILURE" if="failed" /> --> </target> <target name="transform1" description="report"> <testng classpathref="compile.path" outputdir="${output.dir}" haltonfailure="true" useDefaultListeners="false" listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter"> <xmlfileset dir="${basedir}/src/com/selenium" includes="TestNG1.xml"/> <sysproperty key="org.uncommons.reportng.title" value="My Test Report"/> </testng> </target> <!-- 生成报告 --> <target name="transform" description="report"> <xslt in="${output.dir}/testng-results.xml" style="${output.dir}/testng-results.xsl" out="${output.dir}/Report.html" force="yes"> <!-- you need to specify the directory here again --> <param name="testNgXslt.outputDir" expression="${output.dir}" /> <classpath refid="compile.path" /> </xslt> </target> </project>
相关文章推荐
- selenium+testng+reportng+ant+jenkins集成日记
- Maven 配置 Selenium + testNG + reportNG 运行环境
- Jenkins + Ant + Java + TestNg + ReportNg + Appium 进行持续集成
- temp backup:selenium testng ant report POM testng.xml build.xml
- Selenium+TestNG+ReportNG Demo
- Selenium 我的自动化测试历程 (Selenium+TestNG+Java+ReportNG+Jenkins)
- IDEA+selenium+testng&reportng 环境搭建
- selenium+testng+reprotng+ant配置
- Java+maven+selenium+testng+reportNG+jenkins自动化环境搭建【全网最详细的搭建过程指导】
- WebDriver+testng+reportng+ant测试框架整合
- 我的自动化测试历程(Selenium+TestNG+Java+ReportNG+Jenkins)
- 基于Ant+Selenium+TestNG的测试框架配置
- Ant+testng+selenium基本配置
- 我的自动化测试历程(Selenium+TestNG+Java+ReportNG+Jenkins)
- selenium+testng+reprotng+ant框架搭建配置
- selenium01-搭建MAVEN+Eclipse+TestNG+ReportNG+Nexus环境
- Dagger学习之一步一步搭建简单的自动化测试平台(Selenium+TestNG+Ant+Jenkins)
- selenium+testNG+Ant
- testng:ant安装、环境变量配置及验证
- Configuration ReportNG with TestNG