参考网址:
calabash官网:http://calaba.sh/
calabash android版说明:https://github.com/calabash/calabash-android/blob/master/documentation/installation.md
ruby下载:http://rubyinstaller.org/downloads/
ruby development kit 配置:https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
ansicon下载:http://adoxa.altervista.org/ansicon/ansi166.zip
calabash使用:
http://my.oschina.net/fitnessefan/blog/305350
http://developer.xamarin.com/guides/testcloud/calabash/quickstarts/android-studio/
calabash示例项目下载:
https://github.com/xamarin/test-cloud-samples/raw/master/Quickstarts/downloads/CreditCardValidator.AndroidStudio.zip
安装:
- 安装jdk+android sdk+android studio,设置环境变量ANDROID_HOME指向sdk根目录
- 安装ruby+ruby development kit
- 让cmd支持utf8和彩色:下载ansicon,解压里面的x64到PATH能访问的路径,建立cmdu8.bat文件内容是:cmd.exe /k "chcp 65001 && ansicon"
- 安装calabash,需要FQ:
set http_proxy=http://127.0.0.1:8118
gem install calabash-android
- 用android studio编译示例项目,如出现INSTALL_FAILED_OLDER_SDK 则把build.gradel里面的版本改小:
- 打开cmdu8.bat进入项目根目录:
- E:
- cd E:\src\test\SimpleCreditCardValidator
- 创建测试代码目录:calabash-android.bat gen
- 修改测试代码并保存,参考http://developer.xamarin.com/guides/testcloud/calabash/quickstarts/android-studio/creating-the-test/
- calabash-android.bat run app\build\outputs\apk\app-debug.apk
- 如需输出结果到html文件,run参数加上--format html --out=report.html
时间: 2025-01-11 10:33:30