Macaca ubuntu16.04 Eclipse 尝试 Macaca Java 记

小马 · August 19, 2016 · Last by gang replied at September 11, 2016 · 1269 hits

一 先配置好Eclipse及其相关的maven插件和git插件等和android开发环境

当然还有ubuntu环境下的 macaca-cli 和各种驱动 等macaca执行环境,请参考ubuntu16.04 环境折腾 macaca 总结记
此处省略,自行度娘 谷哥.许久之前就配置好了,这次是直接拿来用的.

二 创建Macaca Java项目的三种方式

2.1 Eclipse导入已存在的maven项目

2.1.1 Eclipse中Git仓库的clone a git repository

Eclipse中Git仓库的clone a git repository项目到本地git仓库
或者直接下载项目的zip包到本地解压,再导入已存在的Maven项目.下载地址 https://github.com/macacajs/wd.java

打开Eclipse导入 /home/cmd/workspace/git/wd.java/ 已存在的Maven项目. 参考 https://hacpai.com/article/1358680207381
首先开一终端 macaca server --verbose
然后选中项目macacaclient 右键 Run as ->Maven Test. 这时Eclipse Console 控制台会输出.

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building macacaclient 1.0.0

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ macacaclient ---

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ macacaclient ---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

[INFO] Compiling 20 source files to /home/cmd/workspace/git/wd.java/target/classes

[INFO]

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ macacaclient ---

[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] skip non existing resourceDirectory /home/cmd/workspace/git/wd.java/src/test/resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ macacaclient ---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!

[INFO] Compiling 1 source file to /home/cmd/workspace/git/wd.java/target/test-classes

[INFO]

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ macacaclient ---

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom (3 KB at 1.4 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.pom (3 KB at 1.9 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.pom (6 KB at 10.7 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.pom (2 KB at 3.1 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.1/maven-plugin-tools-3.1.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.1/maven-plugin-tools-3.1.pom (16 KB at 19.7 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.pom (2 KB at 3.1 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting/2.0.9/maven-reporting-2.0.9.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting/2.0.9/maven-reporting-2.0.9.pom (2 KB at 2.5 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.pom (4 KB at 5.9 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.pom (17 KB at 28.0 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom (4 KB at 6.3 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/12/maven-shared-components-12.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/12/maven-shared-components-12.pom (10 KB at 15.8 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/13/maven-parent-13.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/13/maven-parent-13.pom (23 KB at 38.0 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/apache/6/apache-6.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/apache/6/apache-6.pom (13 KB at 21.2 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.pom (2 KB at 1.1 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.jar (34 KB at 38.1 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.jar (115 KB at 67.9 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.jar (257 KB at 104.0 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar (309 KB at 31.2 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar (31 KB at 15.8 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar (227 KB at 41.1 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar (10 KB at 17.3 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.jar (38 KB at 26.7 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.jar (14 KB at 23.9 KB/sec)

[INFO] Surefire report directory: /home/cmd/workspace/git/wd.java/target/surefire-reports

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.pom (3 KB at 2.8 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.12.4/surefire-providers-2.12.4.pom

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.12.4/surefire-providers-2.12.4.pom (3 KB at 4.2 KB/sec)

[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.jar

[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.jar (37 KB at 31.6 KB/sec)


-------------------------------------------------------

T E S T S

-------------------------------------------------------

Running macaca.client.SampleTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.637 sec

Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 41.531 s

[INFO] Finished at: 2016-08-19T11:02:45+08:00

[INFO] Final Memory: 18M/293M

[INFO] ------------------------------------------------------------------------

如此便执行跑成功了原项目里自带的SampleTest.java 。说明运行环境搭建正常。

2.1.2 git clone 方式 wd.java

cmd@TR:~/workspace/git/wd.java$ cd ..
cmd@TR:~/workspace/git$ ls -al
总用量 8
drwxrwxrwx 2 cmd cmd 4096 8 23 13:54 .
drwxrwxr-x 6 cmd cmd 4096 8 19 11:12 ..
cmd@TR:~/workspace/git$ git clone https://github.com/macacajs/wd.java.git
正克隆到 'wd.java'...
remote: Counting objects: 977, done.
remote: Compressing objects: 100% (221/221), done.
remote: Total 977 (delta 174), reused 0 (delta 0), pack-reused 750
接收对象中: 100% (977/977), 294.54 KiB | 343.00 KiB/s, 完成.
处理 delta : 100% (691/691), 完成.
检查连接... 完成。
cmd@TR:~/workspace/git$ cd wd.java/
cmd@TR:~/workspace/git/wd.java$ ls -al
总用量 44
drwxrwxr-x 5 cmd cmd 4096 8 23 13:55 .
drwxrwxrwx 3 cmd cmd 4096 8 23 13:55 ..
drwxrwxr-x 4 cmd cmd 4096 8 23 13:55 doc
drwxrwxr-x 8 cmd cmd 4096 8 23 13:55 .git
-rw-rw-r-- 1 cmd cmd 100 8 23 13:55 .gitignore
-rw-rw-r-- 1 cmd cmd 1100 8 23 13:55 LICENSE
-rw-rw-r-- 1 cmd cmd 1312 8 23 13:55 pom.xml
-rw-rw-r-- 1 cmd cmd 591 8 23 13:55 README.md
-rw-rw-r-- 1 cmd cmd 1074 8 23 13:55 settings.xml
drwxrwxr-x 4 cmd cmd 4096 8 23 13:55 src
-rw-rw-r-- 1 cmd cmd 114 8 23 13:55 .travis.yml
cmd@TR:~/workspace/git/wd.java$ git pull
Already up-to-date.
cmd@TR:~/workspace/git/wd.java$ mvn -s settings.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building macacaclient 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ macacaclient ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ macacaclient ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ macacaclient ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 21 source files to /home/cmd/workspace/git/wd.java/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ macacaclient ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/cmd/workspace/git/wd.java/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ macacaclient ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /home/cmd/workspace/git/wd.java/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ macacaclient ---
[INFO] Surefire report directory: /home/cmd/workspace/git/wd.java/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running macaca.client.SampleTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.346 sec - in macaca.client.SampleTest

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ macacaclient ---
[INFO] Building jar: /home/cmd/workspace/git/wd.java/target/macacaclient-1.0.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ macacaclient ---
[INFO] Installing /home/cmd/workspace/git/wd.java/target/macacaclient-1.0.0.jar to /home/cmd/.m2/repository/macaca/webdriver/client/macacaclient/1.0.0/macacaclient-1.0.0.jar
[INFO] Installing /home/cmd/workspace/git/wd.java/pom.xml to /home/cmd/.m2/repository/macaca/webdriver/client/macacaclient/1.0.0/macacaclient-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.910 s
[INFO] Finished at: 2016-08-23T13:58:10+08:00
[INFO] Final Memory: 21M/305M
[INFO] ------------------------------------------------------------------------

如此也可执行跑成功了原项目里自带的SampleTest.java 。说明运行环境搭建正常。
以上2.1节的构建项目方式的好处就是可以调试debug wd.java提供的源码或改造源码,进而更打造适合本公司项目相结合的UI自动化。

利用mvn 命令行跑脚本

1 编辑修改SampleTest.java
https://github.com/macacajs/macaca-test-sample-java/blob/master/src/test/java/macaca/client/SampleTest.java 替换SampleTest.java
这里改成porps.put("browserName", "chrome"); 或者完全改成自己项目的脚本都可以。

2 参考官方说明执行
https://github.com/macacajs/macaca-test-sample-java

先 开一终端

cmd@TR:~$ macaca server --verbose

>> index.js:17:12 [master] pid:1362 webdriver server start with config:

{ port: 3456,

verbose: true,

always: true,

ip: '192.168.66.113',

host: 'TR',

loaded_time: '2016-08-19 11:21:51' }

>> middlewares.js:17:10 [master] pid:1362 base middlewares attached

>> router.js:108:10 [master] pid:1362 router set

>> webdriver sdk launched

然后开另一终端

cmd@TR:~/workspace/git/wd.java$ mvn -s settings.xml clean install

程序“mvn”尚未安装。 您可以使用以下命令安装:

sudo apt install maven

cmd@TR:~/workspace/git/wd.java$ sudo apt install maven

最后再执行 cmd@TR:~/workspace/git/wd.java$ mvn -s settings.xml clean install
cmd@TR:~/workspace/git/wd.java$ mvn test

日志略。
这样就成功运行了脚本SampleTest.java了.然后你就可以改造来跑自己项目的脚本了.

你可以修改SampleTest.java 也可以新建新的java class测试类,然后拷贝到项目环境/home/cmd/workspace/git/wd.java/ 执行mvn test -Dtest=macaca.client.H5MobileTest 来运行。

2.2 git clone 方式 macaca-test-sample-java

cmd@TR:~/macaca$  git clone  https://github.com/macacajs/macaca-test-sample-java.git
正克隆到 'macaca-test-sample-java'...
remote: Counting objects: 72, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 72 (delta 27), reused 69 (delta 26), pack-reused 0
展开对象中: 100% (72/72), 完成.
检查连接... 完成。
cmd@TR:~/macaca$ cd macaca-test-sample-java
cmd@TR:~/macaca/macaca-test-sample-java$ ls -al
总用量 44
drwxrwxr-x 4 cmd cmd 4096 8 23 12:53 .
drwxr-xr-x 4 cmd cmd 4096 8 23 12:53 ..
drwxrwxr-x 8 cmd cmd 4096 8 23 12:53 .git
-rw-rw-r-- 1 cmd cmd 100 8 23 12:53 .gitignore
-rw-rw-r-- 1 cmd cmd 1100 8 23 12:53 LICENSE
-rw-rw-r-- 1 cmd cmd 229 8 23 12:53 Makefile
-rw-rw-r-- 1 cmd cmd 1383 8 23 12:53 pom.xml
-rw-rw-r-- 1 cmd cmd 439 8 23 12:53 README.md
-rw-rw-r-- 1 cmd cmd 910 8 23 12:53 settings.xml
drwxrwxr-x 3 cmd cmd 4096 8 23 12:53 src
-rw-rw-r-- 1 cmd cmd 346 8 23 12:53 .travis.yml

接下来就很简单了,
/home/cmd/macaca/macaca-test-sample-java/src/test/java/macaca/client 下修改SampleTest.java 为 porps.put("browserName", "chrome");
然后就是
mvn -s settings.xml clean install
和 mvn test

所以还是此种方式好些,你可以在Eclipse编写***Test.java或改写 SampleTest.java 然后复制到/home/cmd/macaca/macaca-test-sample-java/src/test/java/macaca/client 此处.
当有 settings.xml 更新时 只需要git pull 来获取最新 和 mvn -s settings.xml clean install 来更新.原团队作者也建议如此弄,不建议在Eclipse中的wd.java项目下弄.

如果你在Eclipse自建的本地maven项目下或者是已导入已存在的maven项目下,自建了其它个人的java测试类如H5MobileTest.java 或H5WebTest.java 也可以复制到macaca-test-sample-java/src/test/java/macaca/client 此处.但是要注意修改代码里的package macaca.client; 保持与macaca-test-sample-java一致.这样也可以mvn test -Dtest=macaca.client.H5MobileTest来执行.

这种方式,个人感觉比较适合macaca测试执行服务环境的部署和维护。

2.3 maven的pom和settings设置 创建个人的macaca java项目

已补充 ubuntu16.04 Eclipse 使用 Maven pom 和 settings 创建本地 macaca java 项目记

如果你不需要调试debug wd.java的源码,只想利用macaca java来编写UI自动化脚本,这种创建和维护方式是适合你的。

总结:

此三种方式均测试通过

git仓库或git clone下来的wd.java
Eclipse构建项目方式的好处就是可以调试debug wd.java提供的源码或改造源码,进而更打造适合本公司项目相结合的UI自动化。

git clone 方式或直接下载解压 macaca-test-sample-java 的
这种方式,个人感觉比较适合macaca测试执行服务环境的部署和维护。可以只需要macaca-cli macaca各种驱动安装好 当然还有mvn等执行环境部署好后,直接
把编写好的java测试类,cp到脚本目录/macaca/macaca-test-sample-java/src/test/java/macaca/client
cmd@TR:~/macaca/macaca-test-sample-java$ mvn test 或 mvn test -Dtest=macaca.client.H5MobileTest 即可执行了. (此处要注意修改package macaca.client; )

maven的pom和settings设置 创建个人的macaca java项目
如果你不需要调试debug wd.java的源码,只想利用macaca java来编写UI自动化脚本,这种创建和维护方式是适合你的。

不知道 理解的还 对不对 有高人的话还请指点

更多信息请参考wiki汇总

小马的macaca入门指引合集

更多的关于wd.java样例学习可参考wd.java的作者的样例:

https://github.com/Yinxl/bootstrap
这个例子很好 common里 提取了一些公共 可复用部分

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 3 条回复 时间 点赞

虽然我讨厌linux和maven,但还是要顶一个!!

小马 [Topic was deleted] 中提及了此贴 26 Aug 12:07
小马 [Topic was deleted] 中提及了此贴 30 Aug 08:29
小马 #4 · August 30, 2016 作者

git仓库或git clone下来的wd.java
Eclipse构建项目方式的好处就是可以调试debug wd.java提供的源码或改造源码,进而更打造适合本公司项目相结合的UI自动化。

git clone 方式或直接下载解压 macaca-test-sample-java 的
这种方式,个人感觉比较适合macaca测试执行服务环境的部署和维护。可以只需要macaca-cli macaca各种驱动安装好 当然还有mvn等执行环境部署好后,直接
把编写好的java测试类,cp到脚本目录/macaca/macaca-test-sample-java/src/test/java/macaca/client
cmd@TR:~/macaca/macaca-test-sample-java$ mvn test 或 mvn test -Dtest=macaca.client.H5Mobile 即可执行了. (此处要注意修改package macaca.client; )

maven的pom和settings设置 创建个人的macaca java项目
如果你不需要调试debug wd.java的源码,只想利用macaca java来编写UI自动化脚本,这种创建和维护方式是适合你的。

不知道 理解的还 对不对 有高人的话还请指点

额,一定要Eclipse么。。

小马 win10 环境 Eclipse macaca java 使用记 中提及了此贴 21 Nov 10:47
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up