Discussion:
[Cucumber] Cucumber + RESTAssured
(too old to reply)
Dhiraj Shetty
2018-07-09 05:42:40 UTC
Permalink
Dear Member,


We have implemented the Automation Testing framework for testing the REST
API (exposed by our module) using Cucumber + RESTAssured.


We are however facing a dilemma in designing our Test Strategy. We need the
ability to

1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.

We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.


Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).


Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Premdas
2018-07-12 21:30:15 UTC
Permalink
Don't try and specify XML and JSON in your feature files. Instead abstract
what each file or piece of data represents and talk about that instead.
Only when you are in step definitions or additional helper methods/classes
should you actually deal with details like files, XML and JSON.

All best

Andrew
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the REST
API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We need
the ability to
1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tim Walker
2018-07-13 10:39:14 UTC
Permalink
thought below
Post by Andrew Premdas
Don't try and specify XML and JSON in your feature files. Instead abstract
what each file or piece of data represents and talk about that instead.
Only when you are in step definitions or additional helper methods/classes
should you actually deal with details like files, XML and JSON.
I understand precisely what you are saying Andrew and have one possible
variant. Yes, abstract to the level of the reader and go for expressiveness
in the abstraction. However, in the case of an API, the customer of the
living specification is a programmer. I believe I would shoot for small,
relevant, snippets of the XML or json in natural language. Or, at least,
experiment with that and publish your cukes as API documentation.

All best
Post by Andrew Premdas
Andrew
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the REST
API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We need
the ability to
1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oleg Manzhos
2018-07-13 11:55:26 UTC
Permalink
Dhiraj,

Please take a look at Karate API framework. It out-of-the-box DSL on the top of Cucumber. At least you will get an understanding on how your steps could look like.

Regards!
Post by Tim Walker
thought below
Don't try and specify XML and JSON in your feature files. Instead abstract what each file or piece of data represents and talk about that instead. Only when you are in step definitions or additional helper methods/classes should you actually deal with details like files, XML and JSON.
I understand precisely what you are saying Andrew and have one possible variant. Yes, abstract to the level of the reader and go for expressiveness in the abstraction. However, in the case of an API, the customer of the living specification is a programmer. I believe I would shoot for small, relevant, snippets of the XML or json in natural language. Or, at least, experiment with that and publish your cukes as API documentation.
All best
Andrew
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the REST API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We need the ability to
Upload variable length XML files
Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a challenge to design our Gherkin interface to be flexible enough to take different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin commands to be capable of receiving variable XML and JSON data and pass them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dhiraj Shetty
2018-07-13 13:02:20 UTC
Permalink
Thanks for all your opinions.

To clarify the input XML to the REST API is in the order of 5 to 25 MB.

Day 1 solution: Accept a primary key that identifies a given XML as input
in Gherkin (Feature File). Script definition file (within REST Assured)
will have a switch case that will map this primary key to the corresponding
File Path (on hard disk). This is probably a bad idea?

Please suggest alternative approaches for accepting such large XML files as
inputs (within Gherkin).

Regards,
Dhiraj.
Post by Oleg Manzhos
Dhiraj,
Please take a look at Karate API framework. It out-of-the-box DSL on the
top of Cucumber. At least you will get an understanding on how your steps
could look like.
Regards!
thought below
Post by Andrew Premdas
Don't try and specify XML and JSON in your feature files. Instead
abstract what each file or piece of data represents and talk about that
instead. Only when you are in step definitions or additional helper
methods/classes should you actually deal with details like files, XML and
JSON.
I understand precisely what you are saying Andrew and have one possible
variant. Yes, abstract to the level of the reader and go for expressiveness
in the abstraction. However, in the case of an API, the customer of the
living specification is a programmer. I believe I would shoot for small,
relevant, snippets of the XML or json in natural language. Or, at least,
experiment with that and publish your cukes as API documentation.
All best
Post by Andrew Premdas
Andrew
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the
REST API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We need the ability to
1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Koen Prins
2018-07-14 05:06:46 UTC
Permalink
The solution is really to not use cucumber as a testrunner for technical
tests. Gherkin is not designed for this.

Regarding karate: it is a limited feature set from RestAssured and yet
another DSL one has to learn that adds little transferable value.

Use Junit or whatever the language default is for your project as not to
isolate the test effort from the development effort.
Post by Dhiraj Shetty
Thanks for all your opinions.
To clarify the input XML to the REST API is in the order of 5 to 25 MB.
Day 1 solution: Accept a primary key that identifies a given XML as input
in Gherkin (Feature File). Script definition file (within REST Assured)
will have a switch case that will map this primary key to the corresponding
File Path (on hard disk). This is probably a bad idea?
Please suggest alternative approaches for accepting such large XML files
as inputs (within Gherkin).
Regards,
Dhiraj.
Post by Oleg Manzhos
Dhiraj,
Please take a look at Karate API framework. It out-of-the-box DSL on the
top of Cucumber. At least you will get an understanding on how your steps
could look like.
Regards!
thought below
Post by Andrew Premdas
Don't try and specify XML and JSON in your feature files. Instead
abstract what each file or piece of data represents and talk about that
instead. Only when you are in step definitions or additional helper
methods/classes should you actually deal with details like files, XML and
JSON.
I understand precisely what you are saying Andrew and have one possible
variant. Yes, abstract to the level of the reader and go for expressiveness
in the abstraction. However, in the case of an API, the customer of the
living specification is a programmer. I believe I would shoot for small,
relevant, snippets of the XML or json in natural language. Or, at least,
experiment with that and publish your cukes as API documentation.
All best
Post by Andrew Premdas
Andrew
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the
REST API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We need
the ability to
1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tim Walker
2018-07-14 13:19:32 UTC
Permalink
Post by Koen Prins
The solution is really to not use cucumber as a testrunner for technical
tests. Gherkin is not designed for this.
[tim] Please Google "rspec mocks". Then, observe the first link directs to
a site called "relishapp". Go to that link. Take a look around. When you
realize that technical, living, specifications, for mocking objects in Ruby
has been gracefully captured in Gherkin, please re-evaluate this position.



Regarding karate: it is a limited feature set from RestAssured and yet
Post by Koen Prins
another DSL one has to learn that adds little transferable value.
Use Junit or whatever the language default is for your project as not to
isolate the test effort from the development effort.
Post by Dhiraj Shetty
Thanks for all your opinions.
To clarify the input XML to the REST API is in the order of 5 to 25 MB.
Day 1 solution: Accept a primary key that identifies a given XML as input
in Gherkin (Feature File). Script definition file (within REST Assured)
will have a switch case that will map this primary key to the corresponding
File Path (on hard disk). This is probably a bad idea?
Please suggest alternative approaches for accepting such large XML files
as inputs (within Gherkin).
Regards,
Dhiraj.
Post by Oleg Manzhos
Dhiraj,
Please take a look at Karate API framework. It out-of-the-box DSL on the
top of Cucumber. At least you will get an understanding on how your steps
could look like.
Regards!
thought below
Post by Andrew Premdas
Don't try and specify XML and JSON in your feature files. Instead
abstract what each file or piece of data represents and talk about that
instead. Only when you are in step definitions or additional helper
methods/classes should you actually deal with details like files, XML and
JSON.
I understand precisely what you are saying Andrew and have one possible
variant. Yes, abstract to the level of the reader and go for expressiveness
in the abstraction. However, in the case of an API, the customer of the
living specification is a programmer. I believe I would shoot for small,
relevant, snippets of the XML or json in natural language. Or, at least,
experiment with that and publish your cukes as API documentation.
All best
Post by Andrew Premdas
Andrew
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the
REST API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We
need the ability to
1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sreecharan Shroff
2018-07-15 05:28:30 UTC
Permalink
try Karate at:: https://github.com/intuit/karate
ZeroCode at: https://github.com/authorjapps/zerocode

both can solve your problem

Thanks,
Sreecharan Shroff
Post by Dhiraj Shetty
Dear Member,
We have implemented the Automation Testing framework for testing the REST
API (exposed by our module) using Cucumber + RESTAssured.
We are however facing a dilemma in designing our Test Strategy. We need
the ability to
1. Upload variable length XML files
2. Send variable length JSON data in the body of REST requests.
We have already achieved this using REST Assured but are finding it a
challenge to design our Gherkin interface to be flexible enough to take
different XMLs files and JSON data as input in English language.
Looking forward to your expert opinion on how do design the Gherkin
commands to be capable of receiving variable XML and JSON data and pass
them to the REST Assured framework (for testing the REST API).
Regards,
Dhiraj.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...