Android_Calabash学习

来源:互联网 发布:网站如何做seo 编辑:程序博客网 时间:2024/05/18 02:06

Calabash学习网址: 

1. http://rubydoc.info/gems/calabash-android/0.4.2/Calabash/Android/Operations(Calabash android 调用的方法)

 http://myeyeofjava.iteye.com/blog/1902710

 http://blog.leeio.com/index.php/index/view/2876.html (studying)

2. http://myeyeofjava.iteye.com/blog/1913583

3.http://my.eoe.cn/jiguanghover/archive/2394.html

4. http://www.taobaotesting.com/blogs/2463

5.https://github.com/calabash/calabash-android/blob/master/documentation/installation.md

6. rubygems下载:http://rubygems.org/pages/download

7.Ruby下载: http://rubyinstaller.org/downloads/ 

ruby安装完成后,安装rails,在命令行下运行 gem install rails,会有四五个提示 一路Y,安装完后用rails -v, 来检测rails 是否安装成功
安装rails出现如下错误:
C:\Users\aa>gem install rails
ERROR:  Error installing rails:
        The 'atomic' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
解决方法:
pik list
It should show you
187: ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] 192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32] 193: ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
200: ruby 2.0.0p247 (2013-06-27) [i386-mingw32] If its not pointing to ruby version 200 then
pik use 200
ruby dk.rb install It will enhance DevKit to your installed Rubies
Finally 4. gem install rails

  进入 devkit解压所在的目录,执行命令: ruby dk.rb init, 然后ruby dk.rb install, gem install rails,一切就OK了

8. 编写android被测应用

在 calabash-android目录下运行calabash-android gen 命令生成目录features (calabash-android>calabash-android gen) 

返回结果:features subdirectory created.

9.运行rake build出现错误如下:

calabash-android\ruby-gem>rake build
rake aborted!
cannot load such file -- bundler
calabash-android/ruby-gem/Rakefile:1:in `<top (required)>'
(See full trace by running task with --trace)

10.安装rvm,首先安装pik  (https://github.com/vertiginous/pik)

11.WIndows:

These are the steps that I took and I successfully can run a calabash test on an Android device using Windows 7, 64 bit:

Install Ant (1.9)
http://ant.apache.org/

Install Ruby
http://rubyinstaller.org/
Install the 1.9.3 version (not the 2.0.0 or higher yet).

Install Ruby DevKit
http://rubyinstaller.org/downloads
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

Install Calabash
https://github.com/calabash/calabash-android/blob/master/documentation/installation.md

Be sure PATHs are set correctly. Be sure to follow the instructions given on the web-pages mentioned above.

Maybe your internet connection or the remote server were temporarily down, but it all should work.

12. S:\>gem install calabash-android
ERROR:  Could not find a valid gem 'calabash-android' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ECONNREFUSED: No connection could be made because the target machine
actively refused it. - connect(2) (http://rubygems.org/latest_specs.4.8.gz)

S:\>sudo gem install calabash-android
'sudo' is not recognized as an internal or external command,
operable program or batch file.

解决方法:

If that's a big problem you can download it from here and install it manually:
https://rubygems.org/gems/calabash-android

13. calabash-android下载:https://rubygems.org/gems/calabash-android (calabash-android-0.4.6.gem)

14.截图路径: SCREENSHOT_PATH=/tmp/foo/ calabash-android run


原创粉丝点击