Detox: Cucumber support

Created on 17 Aug 2017  ·  24Comments  ·  Source: wix/Detox

Hi guys, just wonder that do you guys have a plan to support cucumber for detox as well? it would be much nicer and easy to maintain the code in my opinion.

Thanks

accepteenhancement looking for contributors

Most helpful comment

I've been using Cucumber with detox for a while now. If I post an example of this would that resolve this issue?

All 24 comments

@heuism Is this something you have tried to get working? 🤔

I can't see anything that would stop detox working with cucumber's step definitions out of the box

Hey @heuism , there's no plan currently to support Cucumber, we will not stop you from adding one though :wink:

Haha @rotemmiz, that is just my idea of working with cucumber for better code reuse. I wonder would this supported by cucumber and gherkin or not. I will try 👍 and add in if i can :)

I managed to make it work quite easily. Will put hands deeper and provide you a feedback / guide

Let's take a shot on : https://github.com/mfrachet/detox-example/commit/f71646d874d3dfa9ea9c4bc7ce1812e7dedf7ab1

Let me know if any documentation would be helpful concerning the subject :)

Looks really nice @mfrachet :+1:

@mfrachet looks pretty good. So would this be an enhancement in the future, or would this already working with Cucumber?

Thanks for spending looking at this

It's actually working on Detox 5.6.x . Didn't tried on 5.7. But, as you can run detox with Jest or Mocha, you can run detox with cucumber out of the box. It's not an enhancement, just a switch of test runner :)

Approach mentioned by @mfrachet works with detox^7.0.1 with small issue:

(node:2368) DeprecationWarning: cucumber: defineSupportCode is deprecated. Please require/import the individual methods instead.

@LeoNatan is there any specific reason of relying only on jest/mocha rather than being test-engine agnostic?

As far as I know, we are engine agnostic.

Adding @rotemmiz to the conversation.

detox-cli supports mocha and jest, but the library itself is indeed test runner agnostic, you will need to pass the command line params to it directly.

Would love to see this as a working example. I followed the repo from @mfrachet and am getting errors of Path must be a string. Received. I'm certain there is a step i'm missing; would love an outline showing this.

As soon as I stumble upon how to do it i'll happily post it up for future people!

I've been using Cucumber with detox for a while now. If I post an example of this would that resolve this issue?

yes, please share!

On Tue, Sep 11, 2018 at 3:22 PM tomatobrown notifications@github.com
wrote:

I've been using Cucumber with detox for a while now. If I post an example
of this would that resolve this issue?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/wix/detox/issues/237#issuecomment-420291947, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AI6My4N6kx2bQad4YUlbvwyAwnDqTbPlks5uZ8cSgaJpZM4O5tb5
.

@tomatobrown can you please share?

I've been using Cucumber with detox for a while now. If I post an example of this would that resolve this issue?

@tomatobrown would really like to see your example if possible. Please share?

Sorry, I haven't had much time to put things together (I also am having some trouble with xcode). I started to put together the demo-cucumber project. This should be enough to get you started, although it doesn't have any working tests yet. https://github.com/tomatobrown/Detox/tree/cucumber-demo

Hello! @tomatobrown Could you please clarify how to combine in https://github.com/tomatobrown/Detox/tree/cucumber-demo script with running test using detox(detox test ...) and cucumber? Where should I use e2e/config.json file?

Sorry @AntaninaKaltsova I don't know what e2e/config.json you're talking about, are you unable to get the example working?

cd demo-react-native-cucumber 
configuration="ios.sim.release" node ../node_modules/cucumber/bin/cucumber-js

I am looking to dive into this and willing to add some examples for the cucumber test. I had a question regarding the how to run detox with the cucumber set up. Getting Detox test to look for cucumber IE the feature files etc to run. I think that was @AntaninaKaltsova question.

I actually figured this out, I will post a link to the updated example using Cucumber and Detox.

The only thing it is currently missing is the console print log that you currently see for the it statements for the Given, When, Then

@AntaninaKaltsova @byronpople @evanjmg
Added an example for cucumber with IOS Native
https://github.com/Srutherford2407/Detox-Cucumber-Example

Closing old issues. I think it's best to have this as a community support, as supporting Cucumber directly is out of scope for the project.

Was this page helpful?
0 / 5 - 0 ratings