6

I'm trying to set up continuous integration with an Android project and Cucumber.

The idea is to write tests in Cucumber and run the tests on my Android build via Cuke4Duke and NativeDriver for Android.

When I have this running, I plan to use Maven and a Jenkins server to automate the testing, so it is run every time i commit to the Subversion repo.

Has this been done before? Is there a good guide somewhere? Or is it a bad idea to do it this way?

Svante
  • 1,069
  • 3
  • 12
  • 28
  • I recommend you to try this library: https://github.com/mauriciotogneri/green-coffee You just need to import it and then you will be able to run your tests written in Gherkin. – Mauricio Togneri Feb 04 '17 at 10:05

4 Answers4

2

We're doing exactly what you're planning to do with Maven, Jenkins, and Git. The missing ingredient is the android/cucumber integration from lesspainful.com.

Edward Dale
  • 29,597
  • 13
  • 90
  • 129
0

I don't think that what you've planned is a bad idea. But I don't know of anyone that's doing Android CI with that particular setup.

You may also want to take a look at Robotium, it's like Selenium for Android and offers a very rich DSL that will help out with your cuke4duke step implementations.

Louth
  • 11,401
  • 5
  • 28
  • 37
0

In my company we use a little different setup (but probably you will have to solve similar challenges): Jenkins + Jenkins Android Plugin + Robotium + Ant. We find out that ant is hard to maintain when you try to use it to something more complicated then simple build and we are rewriting our scripts to gradle.

It works quite well, however you should be aware of two potential problems: 1. emulator is slow (even on fast server) - you can consider attaching physical device to your server. 2. you probably have to setup lock (or use only one executor) for emulator since using multiple emulator instance is hard/tricky.

Maciek Sawicki
  • 6,717
  • 9
  • 34
  • 48
0

What we have done is write an test instrumentation engine above Robotium. This engine is mainly a state machine reading keywords from a text file and converting them into Robotium API calls. We did initially notice that inputs and outputs were the same: user taps on the screen, a new screen is displayed or new text is displayed.

That allows us to implement keyword test driven but it runs on the device so not remotely.

It is 20% of effort to get 80% of the benefit: easy to write/add new tests that are readable by anybody. Of course there are limitations but our goal was achieved.

Cheers Ch