forked from baozhida/AutoTestMacaca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_testng.xml
62 lines (54 loc) · 2.49 KB
/
build_testng.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?xml version="1.0" encoding="UTF-8"?>
<project name="Macaca" default="runall" basedir=".">
<!-- =================================================================== -->
<!-- 变量设置-->
<!-- =================================================================== -->
<!-- 编译文件class路径 -->
<property name="bulid.path" value="./build"/>
<!-- 单元测试代码路径 -->
<property name="test.path" value="./src"/>
<!-- lib包路径 根据实际情况修改-->
<property name="lib.path" value="/Users/MAC/.m2/repository"/>
<!--生成报告路径 -->
<property name="report.path" value="./report"/>
<taskdef name="testng" classname="org.testng.TestNGAntTask">
<classpath>
<pathelement location="lib/testng-6.9.10.jar"/>
</classpath>
</taskdef>
<!-- =================================================================== -->
<!-- 设置classpath -->
<!-- =================================================================== -->
<path id="compile.path">
<fileset dir="${lib.path}">
<include name="**/*.jar"/>
</fileset>
<pathelement path="${bulid.path}"/>
</path>
<target name="init">
<delete dir="${bulid.path}"/>
</target>
<!-- =================================================================== -->
<!-- 编译测试文件,初始化目录 -->
<!-- =================================================================== -->
<target name="compile" depends="init">
<mkdir dir="build"/>
<javac srcdir="${test.path}" destdir="${bulid.path}" classpathref="compile.path" includeantruntime="on" encoding="UTF-8"/>
</target>
<!-- =================================================================== -->
<!-- 执行测试案例 -->
<!-- =================================================================== -->
<target name="runtestng" depends="compile">
<testng classpathref="compile.path" outputDir="report"
useDefaultListeners="false"
listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter" >
<xmlfileset dir="${basedir}" includes="testng.xml"/>
<jvmarg value="-Dfile.encoding=UTF-8" />
<sysproperty key="org.uncommons.reportng.title" value="IOSUIAutoTestReport" />
</testng>
</target>
<target name="runall" depends="runtestng" description="deal the lable">
<exec executable="./bin/exec_replace.sh">
</exec>
</target>
</project>