question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow interoperability with cucumber or allow extensibility

See original GitHub issue

Karate 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:

  1. A simple work around to, at least, allow calling out to plain user-defined cucumber steps from a karate feature.
  2. 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:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
ptrthomascommented, May 24, 2018

Or you could stick to what you have a live a happy life…

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:

Given queue 'queue/my-dummy-target-queue'
* def content = read('my-message.json')
Then send content

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:

Given def queue = getQueue('queue/my-dummy-target-queue')
And def content = read('my-message.json')
Then eval queue.send(content)

Any questions ?

2reactions
ptrthomascommented, May 24, 2018

I can appreciate that code is better than words.

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow interoperability with cucumber or allow extensibility #398
A formal solution to allow classpath-based registration/extension of step definition such that it's not limited to just the ones defined in ...
Read more >
What Are The Quality Attributes? - Software Testing Help
This article will give you a list of Software Quality attributes in quality ... To start with, let's briefly understand what quality is?...
Read more >
Kb (@bergapps) / Twitter
Allow interoperability with cucumber or allow extensibility · Issue #398 · karatelabs/karate. Karate defines a DSL using cucumber for REST APIs.
Read more >
Junit Test Report Xml Format Pdf (2022) - www.online.utsa.edu
merged countries, allowing you to acquire the most less latency time to download any of our books once ... Visual Studio with the...
Read more >
Oracle Fusion Applications Extensibility Guide Pdf
framework and no framework at all, allowing you a free hand in your architecture choices. With this book, frontend and backend engineers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found