本文介绍了葫芦Android的 - 一个完整的指南的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的葫芦 - Android系统。我设置了环境。我会很感激,如果在这个舞台上,谁是彻底与整个概念的专家,可以帮助我。我发现像Eclipse,和的IntelliJ像编辑崇高,的TextWrangler等许多IDE我感到困惑的一个理想的Andr​​oid开发者选择哪一个。我熟悉的红宝石,而不是专家。我要提高我的红宝石知识呢?此外,如果任何人都可以提供一些网址,帮助我,我会很感激你。我发现自己#1的许多问题,但我无法找到任何这对于像我这样一个新手的完整指南。我希望有人能帮助我

I am new to Calabash - Android. I set up the environment. I would be really grateful if an expert in this arena , who is thorough with the whole concept, could help me with this. I found many IDEs like Eclipse, IntelliJ and editors like Sublime, TextWrangler, etc. I am confused about which one to choose for an ideal Android developer. I am familiar with Ruby, but not an expert. Should I improve my knowledge on Ruby ? Also, if anyone can help me by providing some URLs, I would be really grateful to you. I found many questions on Stackoverflow itself, but I couldn't find anything which is a complete guide for a novice like me. I hope somebody can help me

推荐答案

一个指南为CALABASH-ANDROID

A GUIDE FOR CALABASH-ANDROID

您不必是一个Ruby专家编写功能测试用例或
与QA工作增加新的测试场景。 Android开发
可以舒适地从GitHub工作,结账葫芦-的Andr​​oid(
[)及它添加到您的
IDE。试着去了解步定义如何写在
框架,你可以写的Ruby一步定义为您的项目
以同样的方式被写在框架。此外,您还可以使用
罐装步(但不推荐)。我解释这里的
我跟着&放步骤;探索实施功能测试
用葫芦 - Android电子

You need not be a Ruby expert for writing functional test cases orworking with QA for adding new test scenarios. An Android developercan comfortably work, checkout Calabash-Android from github ([https://github.com/calabash/calabash-android] ) & add it to yourIDE. Try to understand how step definitions written in theframework, you can write Ruby step definition for your project inthe same way it is written in the framework. Also, you can usecanned steps ( but not recommended ). I am explaining here thesteps which I followed & explored for implementing functional testsusing Calabash - Android.

prerequisite
我认为,你必须设置葫芦环境,Android SDK中,Java的,
红宝石等(要求所有的东西来运行Android应用程序和放大器;
葫芦)。我使用Genymotion因为我发现它是最快的
模拟器。您需要选择对Ruby&放一个IDE;黄瓜。如我一般
采用Android工作室,我preFER使用的IntelliJ。所以,我用
的RubyMine

PrerequisiteI assume, You have setup Calabash environment, Android SDK, Java,Ruby etc ( all the stuff required to run Android application &Calabash ). I am using Genymotion as I found it is the fastestemulator. You need to select one IDE for Ruby & Cucumber. As I amusing Android Studio, I prefer to use IntelliJ. So, I am usingRubyMine

坦然面对葫芦控制台和放大器;确保一切正常运作
罚款和放大器;尝试在控制台第一。

Be comfortable with Calabash Console & make sure everything worksfine & try on console first.

葫芦控制台结果
prerequisite
确保您的Genymotion模拟器运行

Calabash Console
PrerequisiteMake sure your Genymotion emulator is running


  • 有关易指APK,将其导出(在Mac或Ubuntu)
    出口APK = your_application.apk

  • For referring apk easily, export it ( In Mac or Ubuntu )export APK=your_application.apk

辞职的apk
葫芦-辞职的Andr​​oid APK $
(请确保您使用辞去同一梯形证书(签字))

Resign apkcalabash-android resign $APK(Make sure you are using the same keystone certificate(signature) for resigning)

打开葫芦控制台
葫芦-控制台的Andr​​oid APK $

Open Calabash consolecalabash-android console $APK

开始测试服务器
未找到应用程序,并蠡版本的组合测试服务器。重新测试服务器。
完成签约的测试服务器。它移到test_servers / 24433decbe6bdd96b13b9b58258231a8_0.4.20.apk
IRB(主):001:0> start_test_server_in_background

Start test serverNo test server found for this combination of app and calabash version. Recreating test server.Done signing the test server. Moved it to test_servers/24433decbe6bdd96b13b9b58258231a8_0.4.20.apkirb(main):001:0> start_test_server_in_background

有关回国回IRB父类的方法(葫芦控制台):
IRB(主):012:1>结束
参考网址:

For returning back to IRB parent method (Calabash console):irb(main):012:1> endReference URL : http://www.ruby-doc.org/stdlib-2.0/libdoc/irb/rdoc/IRB.html

有关您的参考,我加入了一些流行的疑问我试过的:

For your reference, I am adding some of the popular queries I tried:

irb(main):017:0> acceptBtn = query("Button marked:'Accept'")
touch(acceptBtn)
query("relativelayout")
query("homeimagebutton")
logOn = query("homeimagebutton id:'home_log_on'")
touch(logOn)
element_exists("* hint:'Search by address, city or zip'")
wait_for_elements_exist( ["* hint:'Search by address, city or zip'"], :timeout => 2)
wait_for_elements_exist( ["* text:'Log On'"], :timeout => 2)

在使用IRB:
CNTRL + D:如果一个错误的命令键入用这个来得到及时
对于例如。如果你输入
    IRB(主):002:0>查询(*)
    IRB(主):003:1
    为要回提示符下,执行CNTRL + D
    现在你得到像提示
    IRB(主):003:1>
    这里型结束,如下:
    IRB(主):003:1>结束
    现在,它显示语法错误和放大器;它得到如下提示:
    语法错误:(IRB):2:未结束的字符串符合文件结束
    (IRB):2:语法错误,意外结束的投入,预计')'
        从/.rvm/rubies/ruby-2.1.1/bin/irb:11:in`'
    IRB(主):004:0>

While using IRB:Cntrl + D : use this to get prompt if a wrong command is typedFor Eg. if you type irb(main):002:0> query("*) irb(main):003:1" for going back to prompt, do Cntrl + D Now you get prompt like irb(main):003:1> here type 'end' as below: irb(main):003:1> end Now it shows syntax error & get it to the prompt as below: SyntaxError: (irb):2: unterminated string meets end of file (irb):2: syntax error, unexpected end-of-input, expecting ')' from /.rvm/rubies/ruby-2.1.1/bin/irb:11:in `' irb(main):004:0>

在搜索中的屏幕文本:
    文字=查询('android.view.View','文字')
    文= text.to_s
    text.include?测试消息

Searching for a text in the Screen: text = query('android.view.View','text') text = text.to_s text.include?'test message'

一些有用的网址是:结果
    [
    [结果
    
    为Ruby的轻松升级
    [结果
    了解如何设置多个应用程序:
    [

Some of the useful URLs are:
[http://developer.xamarin.com/guides/testcloud/calabash/] [http://referenceforu.blogspot.com/2013/08/calabash-android-tutorial.html] [http://blog.lesspainful.com/2012/03/07/Calabash/]
For understanding how to use IRB For easy upgrading of Ruby [http://rvm.io/]
For understanding how to setup for multiple applications: [http://blog.lesspainful.com/2013/03/15/Testing-Multiple-Android-Apps/]

这篇关于葫芦Android的 - 一个完整的指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 14:17