Allow interoperability with cucumber or allow extensibility
See original GitHub issueKarate defines a DSL using cucumber for REST APIs. But is limited to things defined in Karate only.
In our use case, we are trying to build a cucumber DSL for JMS which we hope to make work in conjunction with Karate. This is only possible via eval
with java types as of now and we’d like to have a DSL instead.
The main problem is that Karate prevents defining custom cucumber steps by throwing a syntax error. Such behavior is evident in the following classes: KarateBackend
, KarateClassFinder
and KarateObjectFactory
. I was able to override those in my own project locally; and hence call out to custom cucumber steps 😄
Now, If this ticket does not get declined (because the assumption is, it’s Karate the Karate way or nothing) then I’d have two propositions which I can chip in and help with:
- A simple work around to, at least, allow calling out to plain user-defined cucumber steps from a karate feature.
- A formal solution to allow classpath-based registration/extension of step definition such that it’s not limited to just the ones defined in
StepDefs
. That way Karate becomes an extensible framework with pluggable DSLs, which just so happens to have a DSL for REST APIs.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:20 (14 by maintainers)
Top GitHub Comments
LOL. was that really necessary ?
It is very easy to provide “drive by” examples for anything and conveniently ignore the details. For example where you have:
We are missing the configuration, is it ActiveMQ, RabbitMQ, MQSeries, where is the server / broker, what is the connection type, the delivery mode, acknowledgement type etc. Just passing a queue name will not cut it. I know that this is a hurriedly created example but
send
certainly doesn’t sound like the right choice for syntax.Anyway, hope it is clear why ideally we need a working example for considering a PR.
Adopting your style, If the above example were to be implemented in Karate:
Any questions ?
@60secs - Yes. I was about to respond to each of your points but then figured that it is a waste of time. This is one of those discussions where I sense folks have bought into cucumber and “keyword driven testing” to such an extent that they are unable to take a step back and think about what the actual need is - which is simply “to make it easier to write some code to test something”.
Yes, Karate is opinionated where it does not solve for read-ability by a non-coder. I sincerely feel this is why Karate has been a success in teams where multiple “BDD based” attempts have failed in the past, and I plan to protect this as far as possible.
I fully accept that there could be lack of open-mindedness on my side which is precisely why I’d like to see code examples - the “old way” vs the proposed new way and a clear articulation of the benefits. I think I’ve proven that in many other instances (here and on StackOverflow) - that I’ve changed my mind when provided with data.
Strong Opinions. Weakly Held. Peace.