Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 2.1 KB

README.md

File metadata and controls

41 lines (26 loc) · 2.1 KB

Cucumber on Android

This project provides an Android-backend to cucumber-jvm and is basically an updated and improved version of ccady-ubermind's cucumber-android.

ATTENTION! This repository is no longer being actively maintained. Cucumber-android has become an official module of cucumber-jvm.

Getting started

Read the README from cucumber-android/ to either

  • use cucumber-android as an Android library-project or
  • build a cucumber-android .jar to include elsewhere.

You can also download cucumber-android.jar here.

For an example, please look at cucumber-example-test/.

Using cucumber-android in your own project

You can use cucumber-android as an Android library-project or use a pre-built .jar.

  1. Create a new empty Android test-project.
  2. Change the instrumentation in AndroidManifest.xml from InstrumentationTestRunner to CucumberInstrumentation:
<instrumentation
  android:name="cucumber.api.android.CucumberInstrumentation"
  android:targetPackage="package.of.your.own.application"/>
  1. Include cucumber-android and cucumber-java.
  2. Create a new test-configuration that uses the CucumberInstrumentation instrumentation runner.

Features and step definitions

  1. Put all your .feature files inside the subdirectory assets/features/ of the test-project.
  2. For your step-defintions, you must use an InstrumentationTest (e.g. ActivityInstrumentationTestCase2).
  3. You can have multiple test-classes for your step-definitions, refer to cucumber-example-test/ for an example.
  4. Start the test-project and the CucumberInstrumentation will run all your features.

You can use @RunWithCucumber to pass parameters to Cucumber.