This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
test(#1235): Add numeric field dependency tests
- Loading branch information
Showing
1 changed file
with
225 additions
and
0 deletions.
There are no files selected for viewing
225 changes: 225 additions & 0 deletions
225
...scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature
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,225 @@ | ||
@ignore #pending development of #1235 - Allow a Numeric Field to Depend On Another Numeric Field | ||
Feature:As a User | ||
I can specify that a numeric value is greater than, less than or equal to a numeric value in a different field | ||
So that I can setup the test data to meet my requirements | ||
|
||
Background: | ||
Given the generation strategy is full | ||
And the combination strategy is minimal | ||
And there is a field foo | ||
And foo is of type "integer" | ||
And foo is greater than 1 | ||
And foo is anything but null | ||
And there is a field bar | ||
And bar is of type "integer" | ||
And bar is anything but null | ||
|
||
|
||
###Integer | ||
|
||
Scenario: The one where a user can specify that one number should be greater than another number | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "greaterThan", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 2 | | ||
| 2 | 3 | | ||
| 3 | 4 | | ||
|
||
Scenario: The one where a user can specify that one number should be greater than or equal to another number | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "greaterThanOrEqualTo", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 1 | | ||
| 2 | 2 | | ||
| 3 | 3 | | ||
|
||
Scenario: The one where a user can specify that one number should be less than another number | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "lessThan", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 0 | | ||
| 2 | 1 | | ||
| 3 | 2 | | ||
|
||
Scenario: The one where a user can specify that one number should be less than or equal to another number | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "lessThanOrEqualTo", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 1 | | ||
| 2 | 2 | | ||
|
||
Scenario: The one where a user can specify that one number should be equal to another number | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "equalTo", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 1 | | ||
| 2 | 2 | | ||
| 3 | 3 | | ||
|
||
Scenario: The one where a user can specify that one number should be equal to another number with a positive offset | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "equalTo", | ||
"otherField": "foo", | ||
"offset": 3, | ||
"offsetUnit": "integer" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 4 | | ||
| 2 | 5 | | ||
| 3 | 6 | | ||
|
||
Scenario: The one where a user can specify that one number should be equal to another number with a negative offset | ||
Given the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "equalTo", | ||
"otherField": "foo", | ||
"offset": -3, | ||
"offsetUnit": "integer" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | -2 | | ||
| 2 | -1 | | ||
| 3 | 0 | | ||
|
||
Scenario: The one where a user can specify that one number should be greater than another number with a positive offset | ||
Given bar is greater than 1 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "greaterThan", | ||
"otherField": "foo", | ||
"offset": 3, | ||
"offsetUnit": "integer" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 4 | | ||
| 2 | 5 | | ||
| 3 | 6 | | ||
|
||
Scenario: The one where a user can specify that one number should be less than another number with a negative offset | ||
Given the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "lessThan", | ||
"otherField": "foo", | ||
"offset": -3, | ||
"offsetUnit": "integer" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | -2 | | ||
| 2 | -1 | | ||
| 3 | 0 | | ||
|
||
###Decimal | ||
|
||
Scenario: The one where a user can specify that one decimal number should be greater than another decimal number | ||
Given foo is of type "decimal" | ||
And foo is granular to 0.1 | ||
And foo is greater than 1.0 | ||
And bar is of type "decimal" | ||
And bar is granular to 0.1 | ||
And bar is greater than 1.0 | ||
And the generator can generate at most 3 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "greaterThan", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo | bar | | ||
| 1.0 | 1.1 | | ||
| 1.1 | 1.2 | | ||
| 1.2 | 1.3 | | ||
|
||
###Exhaustive | ||
|
||
Scenario: The one where a user can specify that one number should be greater than another number - exhaustive | ||
Given the combination strategy is exhaustive | ||
And bar is greater than 0 | ||
And bar is less than 5 | ||
And the generator can generate at most 6 rows | ||
And there is a constraint: | ||
""" | ||
{ | ||
"field": "bar", | ||
"is": "greaterThan", | ||
"otherField": "foo" | ||
} | ||
""" | ||
Then the following data should be generated: | ||
| foo| bar| | ||
| 1 | 2 | | ||
| 1 | 3 | | ||
| 1 | 4 | | ||
| 2 | 3 | | ||
| 2 | 4 | | ||
| 3 | 4 | | ||
|