Cucumber library for simpler e2e tests with predefined sentences for API and basic database access for Spring.
MIT License
Bot releases are hidden (Show)
Published by Ragin-LundF over 1 year ago
Published by Ragin-LundF over 1 year ago
Published by Ragin-LundF almost 2 years ago
Published by Ragin-LundF about 2 years ago
The sentence I store the string of the field "{string}" in the context "{string}" for later usage
is now able to store any kind of objects and not only strings.
Published by Ragin-LundF over 2 years ago
Published by Ragin-LundF over 2 years ago
It is now possible to create a simple form-data POST request.
A file can also be attached in the process.
To add the file there is the sentence:
Scenario: Post form data
Given that the file "test.txt" is stored as "FORM_FILE"
The file is placed as a byte array in a separate context, which is emptied again after the scenario is completed for memory reasons.
To execute a form-data request the following sentences are available:
When executing a form-data POST call to "/your/api" with the fields
| text-form-data-key | text-form-data-value |
When executing an authorized form-data POST call to "/your/api" with the fields
| text-form-data-key | text-form-data-value |
The fields are written as key/value datamap.
Examples can be found at src/test/resources/features/form_data/.
Published by Ragin-LundF over 2 years ago
Update Spring Boot to 2.6.6 (Spring Shell)
Published by Ragin-LundF over 2 years ago
Published by Ragin-LundF over 2 years ago
Published by Ragin-LundF almost 3 years ago
An issue was fixed, which prevented overwriting the Accept-Language
, Content-Type
, and Accept headers
.
Published by Ragin-LundF almost 3 years ago
2.6.2
7.2.2
Polling now allows also to check for the HTTP code only.
Scenario: Polling unauthorized until response code is correct with long config
Given that a requests polls every 1 seconds
And that a requests polls for 5 times
And that the API path is "/api/v1/polling"
When executing a GET poll request until the response code is 200
Scenario: Polling authorized until response code is correct with short config
Given that a request polls every 1 seconds for 5 times
And that the API path is "/api/v1/pollingAuth"
When executing an authorized GET poll request until the response code is 200
Examples can be found at src/test/resources/features/polling/.
Scenario: Add custom header with prefix
Given I set the header "X-My-Custom-Header" to "ABC_DEF" prefixed by "PRE_"
This sets the header X-My-Custom-Header
to the value of ABC_DEF
with the prefix PRE_
.
The prefix and the value can be also a variable name from the context.
Please have a look to the examples at: src/test/resources/features/header/
Published by Ragin-LundF almost 3 years ago
Published by Ragin-LundF almost 3 years ago
2.5.6
because of a memory leak in tomcat7.0.0
If it is required to check if a HTTP header contains a special value, this can be done with the following sentence:
And I ensure, that the header "<header name>" is equal to "<header values>"
Be aware, that headers are always an array.
If there are more header values you want to check, please add them comma separated.
Example:
Scenario: Check a header
When executing an authorized GET call to "/api/v1/header"
Then I ensure that the status code of the response is 200
And I ensure, that the header "X-TEST-HEADER" is equal to "present"
This might be used to check if XSS headers are set for example.
Published by Ragin-LundF about 3 years ago
2.5.5
6.11.0
Published by Ragin-LundF over 3 years ago
2.5.2
4.3.5
6.10.4
2.27.0
A user token can be resolved also from a context map. If nothing was found there, it uses the given one.
This refers to the following sentences:
that the following users and tokens are existing
that the user is {string}
In general the ScenarioStateContext
class has now a new method called resolveEntry(key: String)
.
This method tries to read the value from the context map for the given key.
If the key was not found, it returns the key itself.
This may be helpful for own sentences based on the context map.
There is a new sentence that allows you to wait sometime before proceeding:
Scenario: Wait for something
Then I wait for 1000 ms
Examples at:
src/test/resources/features/performance/performance.feature
Published by Ragin-LundF over 3 years ago
Introduction of date util sentences and extended date validators.
This version introduces some Given
sentences to create a date in the past or future.
In addition, there is a new matcher that allows comparing this date with a JSON date or a datetime.
Read more at:
docs/date_operations.md.
Examples at:
src/test/resources/features/date_operations/date_operations.feature
Published by Ragin-LundF over 3 years ago
An issue with the new configuration was fixed.
The introduction of the BddProperties
class made some problems with not configured properties.
Please ensure also, that you've put the library on the configuration scan path:
@ConfigurationPropertiesScan({
"com.ragin.bdd", "configuration.com.ragin.bdd"
})
Published by Ragin-LundF over 3 years ago
This release updates the Spring dependency to 2.4.5
.
It is recommended to update the project also to this version.
Because of the deprecation of jcenter, the artifacts are now published on Maven Central.
To be able to do that, the groupId
has to be changed to:
<dependency>
<groupId>io.github.ragin-lundf</groupId>
<artifactId>bdd-cucumber-gherkin-lib</artifactId>
<version>${version.bdd-cucumber-gherkin-lib}</version>
<scope>test</scope>
</dependency>
dependencies {
testImplementation "io.github.ragin-lundf:bdd-cucumber-gherkin-lib:${version.bdd-cucumber-gherkin-lib}"
}
Published by Ragin-LundF over 3 years ago
This is a re-release of 1.32.0, because of some issues with jcenter.
Published by Ragin-LundF over 3 years ago
In order to predefine some global ScenarioContext
values outside the gherkin definition,
it is now possible to add them to the application.yaml
/application.properties
file.
The key cucumberTests.scenario-context
allows to define a set of key/value pairs for the ScenarioContext
map:
application.yaml
cucumberTests:
scenario-context:
CTX_PRE_DEFINED_USER: Pre Defined
CTX_PRE_DEFINED_FIRST_ID: abcdefg
application.properties
cucumberTests.scenario-context.CTX_PRE_DEFINED_USER=Pre Defined
cucumberTests.scenario-context.CTX_PRE_DEFINED_FIRST_ID=abcdefg
If many tests require the same data over and over again,
it doesn't make sense to copy and maintain it in every feature.
By defining it in the application
file, it can be defined once and used everywhere.
For an example, please have a look at: