Install calabash-android in android_windows (2)

Source: Internet
Author: User

The complete procedure in Windows is as follows:

1. Install git or directly download calabash-Android (download path https://github.com/calabash/calabash-android), and then install calabash-android in the calabash-android directory, first install gem,
Gem install calabash-android

2. Install Ruby 1.9.3. Do not install Ruby 2.0. Otherwise, some unsolved problems may occur. (Ruby download: http://rubyinstaller.org/downloads)

3.install devkit-tdm-32-4.5.2-20151129-1559-sfx.exe, (http://rubyinstaller.org/downloads)

Decompress the package and run the following command.
Ruby DK. RB init
Ruby DK. RB Review
Ruby DK. RB install

4. Install gem, which is used to install Ruby lib to install rubygems: http://rubygems.org/pages/download

5. Install cucumber, Gem install cucumber, and gem install rails

6. Install gem install calabash-android

7. Go to the calabash-android directory and create the android project test directory, for example, calabash_test. Run calabash-android
Gen command to generate the directory structure,

The file is automatically generated to run the test program. The generated file structure is as follows:
Features
| _ Support
| _ App_installation_hooks.rb
| _ App_life_cycle_hooks.rb
| _ Env. Rb
| _ Hooks. Rb
| _ Step_definitions
| _ Calabash_steps.rb
| _ My_first.feature

8. Sign the package to be tested (use DEBUG. keystore) and place it in the calabash_test Directory, which is in parallel with the features directory.

9. Write your own test script

A) Create the testdemo folder in calabash-Android and then CD testdemo

B) run the calabash-android Gen command to generate the features folder.

C) Place the tested application APK package in the testdemo folder (re-sign with re-sign.jar)

D) Compile the my_first.feature script.

E) enter the command CD .. and return to the testdemo directory. Then run calabash-android run xxx.apk to run the script.

F) calabash-android run com.fun.myapp_allign.apk -- format HTML -- out report.html -- format pretty

G) path: screenshot_path =/tmp/Foo/calabash-android run

Script instance (login. feature ):

Feature: Login
Scenario: login to the app
Given my app is running
And I wait for "hello! "To appear
Then take picture
Then I enter "Jonas" as "username"
And I enter "password" as "password"
Then take picture
Then I press "login"
And I wait for "welcome" to appear
Then take picture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.