• Stars
    star
    1,681
  • Rank 27,769 (Top 0.6 %)
  • Language
    Ruby
  • License
    Other
  • Created almost 13 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automated Functional testing for Android using cucumber

Welcome to Calabash for Android

Build Status

After delivering support for the final releases of iOS 11 and Android 8 operating systems, Microsoft will discontinue our contributions to developing Calabash, the open-source mobile app testing tool. We hope that the community will continue to fully adopt and maintain it. As part of our transition on the development of Calabash, we've provided an overview of mobile app UI and end-to-end testing frameworks as a starting point for teams who are looking to re-evaluate their testing strategy. Please see our Mobile App Testing Frameworks Overview document.

Calabash is an automated testing technology for Android and iOS native and hybrid applications.

Calabash is a free open source project that is looking for a maintainer.

Documentation

The documentation is split into the following sections:

Calabash Android requires ruby >= 2.0 (latest stable release is preferred).

Ruby on MacOS

On MacOS, we recommend using a managed Ruby like rbenv or rvm).

Please do not install gems with sudo

For more information about ruby on MacOS, see these Wiki pages:

Upgrading to Calabash-android 0.5

Calabash-android 0.5 introduced new features and removed a lot of actions. If your test project is dependent on some of the removed actions, you will have to reimplement the actions using ruby wrappers, queries and gestures. This document describes all changes needed to migrate to calabash-android 0.5

Generate a Cucumber skeleton

To get started with calabash it might be a good idea to run calabash-android gen. It will create a Cucumber skeleton in the current folder like this:

features
|_support
| |_app_installation_hooks.rb
| |_app_life_cycle_hooks.rb
| |_env.rb
| |_hooks.rb
|_step_definitions
| |_calabash_steps.rb
|_my_first.feature

In this skeleton you find all the predefined steps that comes with calabash. Try to take a look my_first.feature and change it to fit your app.

Writing a test

The Cucumber features goes in the features library and should have the ".feature" extension.

You can start out by looking at features/my_first.feature. You can extend this feature or make your own using some of the predefined steps that comes with Calabash.

Running test

To run your test:

calabash-android run <apk>

Calabash-android will install an instrumentation along with your app when executing the app. We call this instrumentation for "test server". The "test server" has special permission that allows it to interact very closely with your app during test.

Every time you test a new binary or use an upgraded version of calabash a new test server will be build. The test server is an intrumentation that will run along with your app on the device to execute the test.

Using UIAutomator2

To benefit from UIAutomator2 test capabilities (like interacting with other apps or system elements), you must start the test server with: start_test_server_in_background(with_uiautomator: true)

Learn more about actions available though ui_automator2 in the Wiki

Screenshot location

Screenshots are placed in the current working directory by default. The location can be changed by setting the SCREENSHOT_PATH environment variable.

SCREENSHOT_PATH=/tmp/foo/ calabash-android run

would cause the first screenshot to appear at /tmp/foo/screenshot_0.png.

Predefined steps

The predefined steps are located in the features/step_definitions folder. A compiled list of predefined steps with comments is available here

Gestures

Learn about available gestures here Troubleshooting

Problems starting the tests

If your app instantaneously crashes right after being started, bear in mind that it needs the permission android.permission.INTERNET in order for calabash tests to run ( Issue #278 ). Add the following xml to your AndroidManifest.xml if you don't have it already:

<uses-permission android:name="android.permission.INTERNET" />

Problems clicking on buttons and text

If it seems that buttons/text aren't being clicked properly, you need to add the following xml to your AndroidManifest.xml:

<uses-sdk android:targetSdkVersion="SDK_VERSION" />

Where SDK_VERSION is the version of the Android SDK you are using. Version numbers can be found here

For example, Android 4.0 uses version 14, Android 4.0.3 uses version 15 and Android 4.1 uses version 16.

More Repositories

1

calabash-ios

Calabash for iOS
Ruby
1,809
star
2

calabash

Automated Acceptance Testing for Mobile Apps
Ruby
129
star
3

x-platform-example

Example of cross-platform BDD with Cucumber and Calabash
Ruby
90
star
4

calabash-ios-server

An embedded HTTP server for performing queries and test automation
Objective-C
87
star
5

ios-smoke-test-app

An app for testing TestCloudAgent/LPServer behaviors
Objective-C
41
star
6

run_loop

The bridge between Calabash iOS and Xcode command-line tools like instruments and simctl.
Ruby
32
star
7

calabash-android-server

Automated Functional testing for Android based on cucumber
Java
28
star
8

calabash-ios-example

An example project for Calabash iOS
Objective-C
23
star
9

iOSDeviceManager

Used for managing devices/sims
Objective-C
23
star
10

DeviceAgent.iOS

DeviceAgent.iOS is an XCUITest -Runner.app that is used by Xamarin.UITest and Calabash iOS to perform UI tests on iOS applications.
Objective-C
16
star
11

ios-webview-test-app

WebView app for testing TestCloudAgent/LPServer
Objective-C
6
star
12

calabash-js

Shared JavaScript for webview support in calabash
JavaScript
6
star
13

screenshotTaker

Java
5
star
14

ios-setup-examples

Examples of how to add Calabash iOS Server to your app
Objective-C
4
star
15

Calabash-2.0-x-platform

X-platform for 2.0
Ruby
4
star
16

field-service-example

Xamarin Field Service sample used at Evolve
C#
4
star
17

Permissions

An iOS App + Test Suite to demonstrate that DeviceAgent.iOS can automatically dismiss Privacy Alerts
Objective-C
4
star
18

calabash-apk-builder

A very limited replacement for apkbuilder. Its sole purpose in life is to build the calabash-android test server
Java
3
star
19

memoryPluginCalabash

Sample Calabash iOS plugin
Ruby
2
star
20

.github

Calabash GitHub org config
1
star
21

luffa

A gem for testing the Calabash Toolchain
Ruby
1
star
22

location-one

Ruby
1
star
23

fragment-model

Development of the fragment model.
Ruby
1
star
24

CalabashJavaClient

Java
1
star
25

ios-iphone-only-app

An iPhone only app linked with Calabash to test iPad emulation
Objective-C
1
star
26

jenkins

Jenkins / Blue Ocean pipeline scripts
Groovy
1
star