Open paulo-reichert opened 6 years ago
I'm looking to establish a DSL on top of cucumber for testing the behavior of REST APIs (independent of their functional domain).
Within the context of the REST DSL: The "Given" expressions help set up the HTTP request to be performed The "When" expression tells mockmvc (or resttemplate in the future for integration testing) to perform the request The "Then" expressions validate the response
Note that we may also have application specific "Given" expressions outside of the context of this REST DSL that initialize other state per standard BDD (e.g. initial values in a database, mocking out an external rest service).
Here are some example steps that I think we should support:
Givens (naturally, none of these are required)
When (required)
Then (not all required)
This will be a very powerful tool that multiple projects can benefit from.
On a somewhat related note, it would be good if we could demonstrate how to use a background section in a feature file.
We should have a look at Groovy's for DSL authoring: http://www.groovy-lang.org/
Maybe can use this?
cukes-rest: Cucumber DSL for testing RESTful Web Services
https://github.com/ctco/cukes
Yeah. I came across that but it's not approved for use at some clients .
Simple usage of cucumber has been moved to https://github.com/galatea-associates/fuse-starter-etl/issues/1.
This task covers Raj's DSL request and using cucumber to test REST services. The remaining decision is to determine whether or not to use cukes-rest (vs writing our own DSL). The dev task is to either write and integrate the DSL or to integrate cukes, as appropriate.
Decision: try using rest-cukes and see if there are any major deficiencies. If not, use what's already been written with rest-cukes, otherwise make our own.
Issue Description
https://cucumber.io/
Design
[Description of the root cause for the issue and how to resolve it. Should be complete before Review is approved]
Test Evidence
[include relevant tests and output. Should be complete before Review is approved]
Validation in Develop -- [Proof issue is resolved in Develop. Should be complete before Issue is closed]