Cucumber library for simpler e2e tests with predefined sentences for API and basic database access for Spring.
MIT License
Bot releases are visible (Hide)
Published by Ragin-LundF about 4 years ago
Scenario:
Given that the response JSON can contain arrays with extra elements
It is also possible to use the @bdd_lib_json_ignore_new_array_elements
annotation on Feature
or Scenario
level.
With this sentence or annotation, the JSON comparison will ignore new array elements.
See src/test/resources/features/flexible_json/ for examples.
Scenario:
Given that the response JSON can contain arrays in a different order
It is also possible to use the @bdd_lib_json_ignore_array_order
annotation on Feature
or Scenario
level.
With this sentence or annotation, the JSON comparison will ignore the order of arrays.
See src/test/resources/features/flexible_json/ for examples.
Scenario:
Given that the response JSON can contain extra fields
It is also possible to use the @bdd_lib_json_ignore_extra_fields
annotation on Feature
or Scenario
level.
With this sentence or annotation, the JSON comparison will ignore new/not defined fields in the response.
See src/test/resources/features/flexible_json/ for examples.
Published by Ragin-LundF about 4 years ago
Files can be added as a relative path to a previously given base path or with an "absolute" path with the prefix absolutePath:
.
In the last case, the system is using the base classpath as root.
Scenario:
Then I ensure that the response code is 201 and the body is equal to
"""
{
"field": "value",
}
"""
In this case, the response status code is part of the sentence, and the JSON is written directly under the sentence and enclosed in three double quotation marks.
Here it is also possible to use JSON Unit syntax to validate dynamic elements.
Scenario:
Then I ensure that the response code is 200 and the body is equal to the file "response.json"
In this case, the response status code, and the JSON file are written together in one sentence.
Here it is also possible to use JSON Unit syntax to validate dynamic elements.
Published by Ragin-LundF about 4 years ago
<number> characters
to <number> bdd_lib_numbers
(e.g. 10 bdd_lib_numbers
).bdd_lib_uuid
to generate random UUIDs${json-unit.matches:isValidUUID}
which checks, if the string is a valid UUIDPublished by Ragin-LundF about 4 years ago
Adding support in the paths to support templates.
If the path contains something like:
/api/v1/${dynamicElement}/
In this case, the dynamicElement
will be replaced, if it exists in the ScenarioContext.
Support for adding static key/value pairs to the context:
Published by Ragin-LundF about 4 years ago
Adding support for the JSON path to the "I set the value of" sentence.
It now also tries to resolve the value from the ScenarioContext.
If nothing is found, it uses the original value.
Published by Ragin-LundF about 4 years ago
Adding support for JSON path to the "I store" sentence.
The JSON path can be used with:
$.firstElement[3].nextElement
The library detects if the path has the prefix $.
. If it is not available, it adds this prefix.
Published by Ragin-LundF about 4 years ago
Published by Ragin-LundF about 4 years ago
Published by Ragin-LundF about 4 years ago
This release adds transitive dependencies for:
Published by Ragin-LundF about 4 years ago
^that the body of the response is$
to ^that the body of the request is$
Published by Ragin-LundF over 4 years ago
More date formats added.
Published by Ragin-LundF over 4 years ago