Skip to content

axcosta/cucumber-android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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.

About

cucumber-jvm for Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published