This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
186 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Feature: Dynamic data is used in steps | ||
|
||
Scenario: Creating user and making an order | ||
When I request HTTP endpoint with method "POST" and URI "/user" | ||
|
||
And I request HTTP endpoint with body | ||
"""json | ||
{"name": "John Doe"} | ||
""" | ||
|
||
# Undefined variable infers its value from the actual data on first encounter. | ||
Then I should have response with body | ||
"""json5 | ||
{ | ||
// Capturing dynamic user id as $user_id variable. | ||
"id":"$user_id", | ||
"name": "John Doe", | ||
// Ignoring other dynamic values. | ||
"created_at":"<ignore-diff>","updated_at": "<ignore-diff>" | ||
} | ||
""" | ||
|
||
# Creating an order for that user with $user_id. | ||
When I request HTTP endpoint with method "POST" and URI "/order" | ||
|
||
And I request HTTP endpoint with body | ||
"""json5 | ||
{ | ||
// Replacing with the value of a variable captured previously. | ||
"user_id": "$user_id", | ||
"item_name": "Watermelon" | ||
} | ||
""" | ||
# Variable interpolation works also with body from file. | ||
|
||
Then I should have response with body | ||
"""json5 | ||
{ | ||
"id":"<ignore-diff>", | ||
"created_at":"<ignore-diff>","updated_at": "<ignore-diff>", | ||
"user_id":"$user_id" | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.