Commit 008f2219 authored by mabo's avatar mabo

test

parent 47b912dd
*.log
/target/
/screenshot/
.settings
.classpath
.project
git_version = $$(git branch 2>/dev/null | sed -e '/^[^*]/d'-e's/* \(.*\)/\1/')
npm_bin= $$(npm bin)
all: test
test: server
mvn -s settings.xml clean install
mvn test
server:
macaca server --verbose &
install:
mvn -s settings.xml clean install -Dmaven.test.skip=true
.PHONY: test
# bootstrap
基于Macaca-Java版的UI自动化实现demo
### 安装Macaca环境
参考链接:(Macaca-Java版入门指南)[https://testerhome.com/topics/6431)
### 使用步骤
### 1. 下载源码
```
$ git clone https://github.com/macaca-sample/macaca-java-biz-sample.git
```
### 2. 更新依赖
```
$ cd macaca-java-biz-sample
$ make install
```
如果下载依赖过程中报错,可能是由于mvn -s命令没有生效导致的,建议将根目录下settings.xml中的依赖配置到本地Maven目录下的settings.xml中。
### 如何修改目标平台 ios/android?
```
//package com.javademo.common;
// Config.java
// 目标平台- ios android
public static final String PLATFORM = "ios";
```
注意:执行iOS用例时需要将XCode升级到最新的8.1,执行用例前请先启动目标模拟器。
### 3. 启动server
```
$ macaca server --verbose
```
注意启动server时不能加代理,因为server在本机启动需要连接localhost,加代理会导致无法建立连接。
### 4. 执行测试用例
新建cmd窗口(记得新建cmd窗口哦,不要跟macaca server在同一个窗口执行) ,执行mvn test(默认为启动iOS用例)
```
$ mvn -s settings.xml test
```
或者选中SampleTest.java,右键执行run as -> JunitTest
### ReleaseNotes
#### v0.0.2
将原公共库代码common部分提出来单独建立了代码库,以jar包的形式上传至Jcenter,可通过Maven直接引用。
公共库代码也已开源: [https://github.com/macaca-sample/macaca-java-biz-framework](https://github.com/macaca-sample/macaca-java-biz-framework)
欢迎大家引用biz.jar,使用过程中遇到问题,可以提issue,我会尽快解决。
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: macaca.java:biz:1.1.2" level="project" />
<orderEntry type="library" name="Maven: macaca.webdriver.client:macacaclient:2.0.10" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.4" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.2" level="project" />
</component>
</module>
\ No newline at end of file
<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>com.javademo</groupId>
<artifactId>autoui</artifactId>
<version>0.0.2</version>
<packaging>jar</packaging>
<name>autoui</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>macaca.java</groupId>
<artifactId>biz</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.15</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<?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>
<!-- MacacaClient所在仓库 -->
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-orgz-macaca-java-biz</id>
<name>bintray</name>
<url>http://dl.bintray.com/orgz/macaca-java-biz</url>
</repository>
<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>bintray-orgz-macaca-java-biz</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/orgz/macaca-java-biz</url>
</pluginRepository>
<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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment