mauriciotogneri / green-coffee

Green Coffee
MIT License
231 stars 21 forks source link

Relation to Cucumber #2

Closed djodjoni closed 7 years ago

djodjoni commented 7 years ago

I got a remark and a question :)

1) Remark: in your wiki: " Green Coffee is a library that allows you to run Cucumber test in your Android instrumentation tests. With Cucumber you write acceptance tests using Gherkin and Green Coffee executes those tests using the step definitions that you declare. " This is somehow misleading to inexperienced users. Cucumber is a tool that supports BDD. It is used to parse, run and generate reports for tests written in Gherkin exactly as your library, except more limited. So the whole thing is a bit wrong and confusing here.

2) Question:
I am curious what is the motivation to create this and relation to Cucumber. For quite some time(>3yrs) you can use Cucumber on Android using CucumberInstrumentation along with all other cucumber features. I also see the whole gherkin parser is actually placed in your library itself. Isn't it Cucumber-Android reinvented? Is it supposed to be more light-weight? Easy to use? Complementary? Or just inspired?

I'd be very happy if you were willing to shed some light on this. (disclaimer: I'm not affiliated with Cucumber nor its creators;I'm just a curious dev :)

mauriciotogneri commented 7 years ago

Hi @djodjoni, sorry for the late response, I was on a trip.

1) I agree. From the beginning I struggled writing the first paragraph and to be honest I was never happy with it. What about this one:

Green Coffee is a library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests using the step definitions that you declare.

I'm open to ideas, so don't hesitate to send me your propositions.

2) In a previous project I used Calabash but I never liked writing the step definitions in Ruby. Then I learned Espresso and decided to use it for one of my projects. I created the library to make it easy to reuse the Gherkin tests on Android. I believe the library is fairly easy to setup and start to work with. When I looked on how to integrate Cucumber and Android I couldn't find an easy way, but maybe I didn't look too much. There were too many steps involved and the process was rather fragile. But correct me if I'm wrong (give me some links and I will try them out).

The Gherkin parser is embed in the library indeed. The first idea was to import it as a dependency but unfortunately there was a bug so I had to copy the source code and fix it. Now the bug has been fixed so I can remove the source code from the library (I will work on it in the next couple of days).

Thanks again for the remarks and don't hesitate to post some more comments!

djodjoni commented 7 years ago

@mauriciotogneri sry for the late response. The description change seems ok. as regards to 2) Calabash is not that easy to setup and start however cucumber works like a charm. The process is quite easy and stable. You also inherit the advantages of cucumber for jvm. There are some links:

the official link: https://github.com/cucumber/cucumber-jvm/tree/master/android

minimal setup demo muckup: https://github.com/apptik/tzatziki/tree/master/bddexample

fork with Cucumber test setup on android-architecture repo: https://github.com/djodjoni/android-architecture/tree/mvp-cuc

also a very nice project: https://github.com/sebaslogen/CleanGUITestArchitecture

mauriciotogneri commented 7 years ago

Hi @djodjoni, thanks for the links, I will take a look at them.

djodjoni commented 7 years ago

sure np :)