Skip to content

Releases: Ragin-LundF/bbd-cucumber-gherkin-lib

Release 1.31.0 - Better support for dynamic URL's

22 Mar 20:11
bd92545
Compare
Choose a tag to compare

This version supports the usage of ScenarioContext variables for all URI parameters.

Now it is allowed to write sentences like:

Scenario: Use dynamic URL
  Given that the context contains the following 'key' and 'value' pairs
    | ${MY_DYNAMIC_URL} | https://google.com |
  And that the API path is "${MY_DYNAMIC_URL}"

Release 1.30.0 - Polling

13 Mar 15:25
2a56413
Compare
Choose a tag to compare

Support for polling APIs

The polling configuration is automatically reset before each scenario.
It can be configured via the background or directly in the scenario.

When the expected HTTP status code and JSON structure has been sent as a response, polling will stop.
This allows an endpoint to be polled until it changes state or fail if the state has not changed during the specified time and retry configuration.

The configuration can be done in to ways.

As a single line configuration:

Scenario: Single line configuration
    Given that a request polls every 1 seconds for 5 times

Or as a multiline configuration that supports to specify one of the configurations in the Background and the other in the Scenario (or to have it more readable).

Scenario: Multiline configuration
    Given that a requests polls every 1 seconds
    And that a requests polls for 5 times

The URL/URI and (if required) body have to be preconfigured. Polling itself does simply use previous set body and path definition.
To execute a request it supports the well known authorized and unauthorized phrases and it supports direct JSON or JSON from file:

Authorized request with JSON response file:

Scenario: Authorized request with JSON response file
  Given that a request polls every 1 seconds for 5 times
  And that the API path is "/api/v1/polling"
  When executing an authorized GET poll request until the response code is 200 and the body is equal to file "expected.json"

Unauthorized request with JSON response file:

Scenario: Unauthorized request with JSON response file
  Given that a request polls every 1 seconds for 5 times
  And that the API path is "/api/v1/polling"
  When executing a GET poll request until the response code is 200 and the body is equal to file "expected.json"

Authorized request with direct JSON response:

Scenario: Authorized request with JSON response file
  Given that a request polls every 1 seconds for 5 times
  And that the API path is "/api/v1/polling"
  When executing an authorized GET poll request until the response code is 200 and the body is equal to
    """
    {
      "message": "SUCCESSFUL"
    }
    """

Unauthorized request with direct JSON response:

Scenario: Unauthorized request with JSON response file
  Given that a request polls every 1 seconds for 5 times
  And that the API path is "/api/v1/polling"
  When executing a GET poll request until the response code is 200 and the body is equal to
    """
    {
      "message": "SUCCESSFUL"
    }
    """

Examples can be found at src/test/resources/features/polling/.

Update of dependencies

01 Mar 16:31
d582567
Compare
Choose a tag to compare

This release updates the following libraries:

  • Liquibase 3.10.3
  • Kotlin 1.4.31

It also removes the Spring BOM, because the plugin should be enough.

Release 1.29.1 - Support for database-less applications

22 Feb 22:00
ed1210d
Compare
Choose a tag to compare

This version introduces support for applications that do not have a database.
To configure the library to run database-less, it is necessary to set up the following configuration in the application.yaml file:

application.properties:

cucumberTest.databaseless=true

or

application.yaml:

cucumberTest:
  databaseless: true

If the databaseless key is not true or missing, the library tries to instantiate the database related beans.

In some cases it is required to disable the database autoconfiguration of Spring Boot:

application.properties:

spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration

or

application.yaml:

spring:
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration

or as annotation:

@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
@SpringBootApplication
public class Application {
  public static void main (String[] args) {
    ApplicationContext ctx = SpringApplication.run(Application.class, args);
  }
}

Please also make sure that the @ContextConfiguration annotation does not contain the DatabaseExecutorService.class.

Release 1.28.0

08 Feb 08:03
919f4e3
Compare
Choose a tag to compare

Proxy support

This can be useful to use the cucumber tests together with burp-scanner.

The proxy can be configured with:

application.properties:

cucumberTest.proxy.host=localhost
cucumberTest.proxy.port=8866

or

application.yaml:

cucumberTest:
  proxy:
    host: localhost
    port: 8866

The host can be an IP or a domain. The port must be higher than 0.
If a condition is not met, the proxy is not set.

Default is deactivated.

Disable SSL verification

Along with proxy support, it may be necessary to disable SSL validation as well.

This can be configured via:

application.properties:

cucumberTest.ssl.disableCheck=true

or

application.yaml:

cucumberTest:
  ssl:
    disableCheck: true

Default is false.

Release 1.27.0

06 Feb 13:49
0663ee0
Compare
Choose a tag to compare

Code changes

The Java code was refactored to Kotlin.
This should make the code more robust and better maintainable.

Enhanced tests

Tests for the database features were added under src/test/resources/features/database/.

Release 1.26.0

02 Feb 10:49
1c57766
Compare
Choose a tag to compare

Small bugfix release for proper mismatch messages of the matchers.

Release 1.25.0

02 Feb 10:38
1ae70c3
Compare
Choose a tag to compare

Small bugfix release for proper mismatch messages of the matchers.

Adding validation of the execution time of requests

13 Jan 10:47
2540632
Compare
Choose a tag to compare

Validate execution time of requests

Scenario:
  Then I ensure that the execution time is less than {long} ms

Validates, that the execution of the Scenario has taken less than [n] ms.

Please have a look to the examples at: src/test/resources/features/performance/.

Release 1.23.0

15 Dec 09:36
e89ddc0
Compare
Choose a tag to compare

Dependency updates

This release updates some dependencies.

Set the Bearer token dynamically

To be able to set dynamic bearer token, the following sentence can be used:

Feature: Bearer Token
  Scenario: Set bearer token directly
    Given that the Bearer token is "abcdefg"

This sentence is primarily looking into the context map if there is a key with the given value.
If this is not the case, it uses the given string directly as the token.

Please have a look to the examples at: src/test/resources/features/header/