ant构建testNG测试输出测试报告
2013-11-18 22:21
441 查看
1.在Eclipse中安装testNG插件
在线安装地址:http://beust.com/eclipse
2.build.xml
3.注意:
(1)需要在工程的根目录下创建一个libs文件夹,将testNG.jar放在里面
(2)需要在根目录下创建一个testNG.xml文件
在线安装地址:http://beust.com/eclipse
2.build.xml
<project basedir="." default="regression" name="automation test"> <property name="base.dir" value="."/> <property name="testng.output.dir" value="${base.dir}/test-output"/> <property name="3rd.lib.dir" value="${base.dir}/libs"/> <property name="testng.file" value="testNG.xml"/> <taskdef resource="testngtasks" classpath="${3rd.lib.dir}/testng.jar"/> <target name="clean"> <delete dir="${base.dir}/bin"/> </target> <target name="compile" depends="clean"> <mkdir dir="${base.dir}/bin"/> <javac srcdir="${base.dir}/src" destdir="${base.dir}/bin" classpathref="classes" includeantruntime="off" debug="on" debuglevel="lines,vars,source"/> </target> <path id="classes"> <fileset dir="${3rd.lib.dir}" includes="*jar"/> <fileset dir="${3rd.lib.dir}" includes="*zip"/> <pathelement location="${base.dir}/bin"/> </path> <target name="regression" depends="compile"> <testng outputdir="${testng.output.dir}" classpathref="classes" delegateCommandSystemProperties="true"> <xmlfileset dir="${base.dir}" includes="${testng.file}"/> </testng> </target> <target name="copyResult"> <copy todir="${basedir}" overwrite="yes"> <fileset dir="${base.dir}/test-output"> <include name="testng-failed.xml"/> <include name="testng-results.xml"/> </fileset> </copy> </target> </project>
3.注意:
(1)需要在工程的根目录下创建一个libs文件夹,将testNG.jar放在里面
(2)需要在根目录下创建一个testNG.xml文件
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" > <test name="TestNGTest" > <classes> <class name="com.android.build.TestNGTest" /> <methods> <include name="testRun" /> </methods> </classes> </test> </suite>
相关文章推荐
- ant构建Junit测试并输出测试报告
- Ant中批量调用TestNG的XML文件,并调用TestNgXlst生成漂亮的html测试报告
- selenuim+testng集成ant和reportNG自动执行和发送测试报告
- ant+testng-xslt生成selenium测试报告
- TestNG+Ant 测试报告美化
- TestNG设置输出测试报告的内容级别和设置测试用例按顺序执行
- TestNG设置输出测试报告的内容级别和设置测试用例按顺序执行
- TestNG+Ant 测试报告美化
- Ant中批量调用TestNG的XML文件,并调用TestNgXlst生成漂亮的html测试报告
- ant+TestNG-xslt生成selenium测试报告
- Ant中批量调用TestNG的XML文件,并调用TestNgXlst生成漂亮的html测试报告
- ant 构建junit 测试生成报告
- 使用Ant构建web项目 从编译到测试 生成测试报告 打包 邮件发送 远程下载tomcat 部署运行一条龙服务之ant脚本
- robotium+TMTS混合使用,ant构建成html测试报告
- robotium+TMTS混合使用,ant构建成html测试报告
- ant+TestNG-xslt生成selenium测试报告
- 使用TestNG-xslt+ant来美化selenium测试报告
- jenkins+maven+junit构建自动化测试,整合junit xml生成直观的测试报告
- Ant结合Junit生成测试报告
- 利用Ant实现项目自动构建测试备份并发布到项目web