0 Star 0 Fork 2

KevinGit@OSChina/PageObjectModelSelenium

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.xml 3.74 KB
一键复制 编辑 原始数据 按行查看 历史
hellotester 提交于 2016-03-15 18:14 +08:00 . ad testCase
<project basedir="." default="all" name="automation test">
<tstamp>
<format property="time" pattern="yyyyMMddhhmm" />
</tstamp>
<!-- 项目所在的目录 -->
<property name="base.dir" value="D:/Users/liuchao448/git/PageObjectModelSelenium"/>
<!-- jar包路径-->
<property name="lib.dir" value="${base.dir}/lib"/>
<!-- testng的路径-->
<property name="suite.file" value="${base.dir}/testSuits"/>
<!-- 文件格式-->
<property name="testng.file" value="*.xml"/>
<!-- 生成的报告的前缀 -->
<property name="ReportName" value="TestReport" />
<!-- 生成报告的路径 -->
<property name="testng.output.dir" value="${base.dir}/report/${ReportName}${time}"/>
<!-- 接收测试报告的邮箱 -->
<property name="mail_from" value="lcmanburensheng@126.com"/>
<property name="mail_password" value="XXXXX"/>
<property name="mail_to" value="lcmanburensheng@126.com" />
<!-- 电脑地址 -->
<property name="ComputerName" value="jkqsh-l0285"/>
<taskdef resource="testngtasks" classpath="${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">
<!-- 编译时为了和项目的编码保持一致 -->
<compilerarg line="-encoding GBK "/>
</javac>
<!-- 将配置文件复制到编辑目录 -->
<copy todir="${base.dir}/bin">
<fileset dir="${base.dir}/src">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<path id="classes">
<fileset dir="${lib.dir}" includes="*jar"/>
<fileset dir="${lib.dir}" includes="*zip"/>
<pathelement location="${base.dir}/bin"/>
</path>
<!-- 运行testng文件 -->
<target name="regression" depends="compile">
<!-- testng属性设置,自定义的测试报告 ,用到了第三方的jar包(guice-3.0.jar,reportng.jar,velocity-dep.jar -->
<testng classpathref="classes"
useDefaultListeners="false"
listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter"
outputdir="${testng.output.dir}"
failureproperty="test.failed"
delegateCommandSystemProperties="true">
<!-- 设置测试报告标题 -->
<sysproperty key="org.uncommons.reportng.title" value="自动化测试报告" />
<xmlfileset dir="${suite.file}" includes="${testng.file}" />
</testng>
</target>
<!-- 发送邮件 -->
<target name="sendmail" description="发送邮件">
<mail mailhost="smtp.126.com" user="${mail_from}" password="${mail_password}" subject="AutomationTest" mailport="25">
<from address="${mail_from}" />
<to address="${mail_to}" />
<!-- 发送附件 -->
<fileset dir="${testng.output.dir}/html/">
<include name="index.html"/>
</fileset>
<message>This email was sent automatically by ANT. &lt; &gt;Please check the automation test report by the link below. &lt;&gt;If there are any questions, please contact with QA. Thank you! &lt;&gt;&lt; &gt;
http://${ComputerName}/${testng.output.dir}/html/index.html
</message>
</mail>
</target>
<target name="all">
<antcall target="regression" />
<!-- <antcall target="sendmail" /> -->
</target>
</project>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/KevinGit/PageObjectModelSelenium.git
git@gitee.com:KevinGit/PageObjectModelSelenium.git
KevinGit
PageObjectModelSelenium
PageObjectModelSelenium
master

搜索帮助