Skip to content

Commit

Permalink
Support for full URL variables
Browse files Browse the repository at this point in the history
Signed-off-by: Ragin666 <ragin666@gmail.com>
  • Loading branch information
Ragin-LundF committed Mar 22, 2021
1 parent d176282 commit 9b7207d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Release 1.31.0
## Supports dynamic URL's
This version supports the usage of `ScenarioContext` variables for all URI parameters.

Now it is allowed to write sentences like:

```gherkin
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
## Support for polling APIs
The polling configuration is automatically reset before each scenario.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.ragin.bdd
version=1.30.0
version=1.31.0

systemProp.sonar.host.url=https://sonarcloud.io/
systemProp.sonar.organization=ragin-lundf-github
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ abstract class BaseRESTExecutionGlue(jsonUtils: JsonUtils, private val restTempl
} else {
uriPath
}

val resolvedUri = scenarioContextMap[path]
if (resolvedUri != null) {
path = resolvedUri
}

path = replacePathPlaceholders(path)

// Prepare headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Feature: Multiple resources
When executing an authorized POST call with previously given URI and body
Then I ensure that the response code is 201 and the body is equal to the file "responses/response.json"


Scenario Outline: Execute API calls to endpoint with dynamic resources and manipulate them with the context from static keys
Given that the context contains the key "resourceId" with the value "<resource>"
* that the context contains the key "subResourceId" with the value "<subresource>"
Expand All @@ -108,4 +107,11 @@ Feature: Multiple resources
Examples:
| resource | subresource |
| abc-def | ghi-jkl |
| ghj-oid | jks-dfg |
| ghj-oid | jks-dfg |

Scenario: Execute API call to endpoint which comes from the context
Given that the context contains the key "${URL}" with the value "/api/v1/abc-def/ghi-jkl"
And that the API path is "${URL}"
When executing an authorized POST call with previously given URI and body
Then I ensure that the response code is 201 and the body is equal to the file "responses/response.json"

0 comments on commit 9b7207d

Please sign in to comment.