Skip to content

Instantly share code, notes, and snippets.

@ksurendra
Created April 26, 2019 18:08
Show Gist options
  • Save ksurendra/2bfa41bbcbeb982b18ef36c8e2394a64 to your computer and use it in GitHub Desktop.
Save ksurendra/2bfa41bbcbeb982b18ef36c8e2394a64 to your computer and use it in GitHub Desktop.
Sample Cucumber Test Feature
Feature: Add a measurement
In order to have source information to examine later
I want to be able to capture a measurement of several metrics at a specific time
Scenario: Add a measurement with valid (numeric) values
# POST /measurements
When I submit a new measurement as follows:
| timestamp | temperature | dewPoint | precipitation |
| "2015-09-01T16:00:00.000Z" | 27.1 | 16.7 | 0 |
Then the response has a status code of 201
And the Location header has the path "/measurements/2015-09-01T16:00:00.000Z"
Scenario: Cannot add a measurement with invalid values
# POST /measurements
When I submit a new measurement as follows:
| timestamp | temperature | dewPoint | precipitation |
| "2015-09-01T16:00:00.000Z" | "not a number" | 16.7 | 0 |
Then the response has a status code of 400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment