forked from baozhida/AutoTestMacaca
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?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"/> | ||
<!--生成报告junit4.xml路径 --> | ||
<property name="report.path" value="./report"/> | ||
<!--终端平台类型--> | ||
<property name="platform" value="ios"/> | ||
|
||
<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"> | ||
<!-- 清除Junit生成的报表文档 | ||
//<delete dir="${report.path}/${platform}"/> | ||
//<mkdir dir="${report.path}/${platform}"/> | ||
清除历史编译class | ||
<delete dir="${bulid.path}"/> | ||
//<mkdir dir="${bulid.path}"/> | ||
--> | ||
<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" | ||
haltonfailure="true" | ||
useDefaultListeners="false" | ||
listeners="org.uncommons.reportng.HTMLReporter,org.testng.reporters.FailedReporter,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"> | ||
<arg value="${platform}"/> | ||
</exec> | ||
</target> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.tn.qa.automation</groupId> | ||
<artifactId>MacacaAutomation</artifactId> | ||
<version>1.0.0</version> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.0</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.4</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>macaca.webdriver.client</groupId> | ||
<artifactId>macacaclient</artifactId> | ||
<version>2.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>6.9.10</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- 数据库Driver依赖 --> | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<version>5.1.13</version> | ||
</dependency> | ||
<!-- 依赖reportNg 关联testNg --> | ||
<dependency> | ||
<groupId>org.uncommons</groupId> | ||
<artifactId>reportng</artifactId> | ||
<version>1.1.4</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<settings | ||
xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' | ||
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> | ||
<profiles> | ||
<profile> | ||
<repositories> | ||
<repository> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
<id>central</id> | ||
<name>bintray</name> | ||
<url>http://jcenter.bintray.com</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
<id>central</id> | ||
<name>bintray-plugins</name> | ||
<url>http://jcenter.bintray.com</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
<id>bintray</id> | ||
</profile> | ||
</profiles> | ||
<activeProfiles> | ||
<activeProfile>bintray</activeProfile> | ||
</activeProfiles> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> | ||
<suite name="IOS" parallel="tests" thread-count="2"> | ||
<test name="IOSTest1"> | ||
<parameter name="port" value="3456" /> | ||
<parameter name="proxyport" value="8900" /> | ||
<parameter name="udid" value="f593db43a8469b44cb54745b2b5c85915bc9d701" /> | ||
<classes> | ||
<class name="testngcase.ios.IOSAppTest" /> | ||
</classes> | ||
</test> | ||
|
||
<test name="IOSTest2"> | ||
<parameter name="port" value="3457" /> | ||
<parameter name="proxyport" value="8910" /> | ||
<parameter name="udid" value="e084de7f7049555955142ba8eec4712d9ff03a87" /> | ||
<classes> | ||
<class name="testngcase.ios.IOSAppTest" /> | ||
</classes> | ||
</test> | ||
</suite> |