Skip to content

Commit 386ddf3

Browse files
committed
Some extra feature tests
1 parent d72c813 commit 386ddf3

File tree

4 files changed

+172
-0
lines changed

4 files changed

+172
-0
lines changed

src/api/tests/feature_tests/features/createProductTeam.failure.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ Feature: Create Product Team - failure scenarios
2929
| Content-Type | application/json |
3030
| Content-Length | 76 |
3131

32+
Scenario: Cannot create a ProductTeam with invalid key_type
33+
When I make a "POST" request with "default" headers to "ProductTeam" with body:
34+
| path | value |
35+
| name | My Great Product Team |
36+
| ods_code | F5H1R |
37+
| keys.0.key_type | invalid_alias |
38+
| keys.0.key_value | FOOBAR |
39+
Then I receive a status code "400" with body
40+
| path | value |
41+
| errors.0.code | VALIDATION_ERROR |
42+
| errors.0.message | CreateProductTeamIncomingParams.keys.0.key_type: value is not a valid enumeration member; permitted: 'product_team_id_alias', 'epr_id' |
43+
And the response headers contain:
44+
| name | value |
45+
| Content-Type | application/json |
46+
| Content-Length | 191 |
47+
3248
Scenario: Cannot create a ProductTeam with an that is missing fields
3349
When I make a "POST" request with "default" headers to "ProductTeam" with body:
3450
| path | value |

src/api/tests/feature_tests/features/createProductTeam.success.feature

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,73 @@ Feature: Create Product Team - success scenarios
117117
| deleted_on | << ignore >> |
118118
| keys.0.key_type | product_team_id_alias |
119119
| keys.0.key_value | FOOBAR |
120+
121+
Scenario: Successfully create multiple ProductTeams under an organization
122+
When I make a "POST" request with "default" headers to "ProductTeam" with body:
123+
| path | value |
124+
| name | Product Team-1 |
125+
| ods_code | F5H1R |
126+
| keys.0.key_type | product_team_id_alias |
127+
| keys.0.key_value | FOOBAR |
128+
Then I receive a status code "201" with body
129+
| path | key_value |
130+
| id | << ignore >> |
131+
| name | Product Team-1 |
132+
| ods_code | F5H1R |
133+
| status | active |
134+
| created_on | << ignore >> |
135+
| updated_on | << ignore >> |
136+
| deleted_on | << ignore >> |
137+
| keys.0.key_type | product_team_id_alias |
138+
| keys.0.key_value | FOOBAR |
139+
And the response headers contain:
140+
| name | value |
141+
| Content-Type | application/json |
142+
| Content-Length | 275 |
143+
Given I note the response field "$.id" as "product_team_id"
144+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }"
145+
Then I receive a status code "200" with body
146+
| path | value |
147+
| id | ${ note(product_team_id) } |
148+
| name | Product Team-1 |
149+
| ods_code | F5H1R |
150+
| status | active |
151+
| created_on | << ignore >> |
152+
| updated_on | << ignore >> |
153+
| deleted_on | << ignore >> |
154+
| keys.0.key_type | product_team_id_alias |
155+
| keys.0.key_value | FOOBAR |
156+
When I make a "POST" request with "default" headers to "ProductTeam" with body:
157+
| path | value |
158+
| name | Product Team-2 |
159+
| ods_code | F5H1R |
160+
| keys.0.key_type | product_team_id_alias |
161+
| keys.0.key_value | GARPLY |
162+
Then I receive a status code "201" with body
163+
| path | key_value |
164+
| id | << ignore >> |
165+
| name | Product Team-2 |
166+
| ods_code | F5H1R |
167+
| status | active |
168+
| created_on | << ignore >> |
169+
| updated_on | << ignore >> |
170+
| deleted_on | << ignore >> |
171+
| keys.0.key_type | product_team_id_alias |
172+
| keys.0.key_value | GARPLY |
173+
And the response headers contain:
174+
| name | value |
175+
| Content-Type | application/json |
176+
| Content-Length | 275 |
177+
Given I note the response field "$.id" as "product_team_id"
178+
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }"
179+
Then I receive a status code "200" with body
180+
| path | value |
181+
| id | ${ note(product_team_id) } |
182+
| name | Product Team-2 |
183+
| ods_code | F5H1R |
184+
| status | active |
185+
| created_on | << ignore >> |
186+
| updated_on | << ignore >> |
187+
| deleted_on | << ignore >> |
188+
| keys.0.key_type | product_team_id_alias |
189+
| keys.0.key_value | GARPLY |

src/api/tests/feature_tests/features/createProductTeamEpr.failure.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ Feature: Create EPR Product Team - failure scenarios
2929
| Content-Type | application/json |
3030
| Content-Length | 76 |
3131

32+
Scenario: Cannot create an EPR ProductTeam with invalid key_type
33+
When I make a "POST" request with "default" headers to "ProductTeamEpr" with body:
34+
| path | value |
35+
| name | My Great Product Team |
36+
| ods_code | F5H1R |
37+
| keys.0.key_type | invalid_alias |
38+
| keys.0.key_value | FOOBAR |
39+
Then I receive a status code "400" with body
40+
| path | value |
41+
| errors.0.code | VALIDATION_ERROR |
42+
| errors.0.message | CreateProductTeamIncomingParams.keys.0.key_type: value is not a valid enumeration member; permitted: 'product_team_id_alias', 'epr_id' |
43+
And the response headers contain:
44+
| name | value |
45+
| Content-Type | application/json |
46+
| Content-Length | 191 |
47+
3248
Scenario: Cannot create an EPR ProductTeam with an that is missing fields
3349
When I make a "POST" request with "default" headers to "ProductTeamEpr" with body:
3450
| path | value |

src/api/tests/feature_tests/features/createProductTeamEpr.success.feature

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,73 @@ Feature: Create EPR Product Team - success scenarios
117117
| deleted_on | << ignore >> |
118118
| keys.0.key_type | product_team_id_alias |
119119
| keys.0.key_value | FOOBAR |
120+
121+
Scenario: Successfully create multiple EPR ProductTeams under an organization
122+
When I make a "POST" request with "default" headers to "ProductTeamEpr" with body:
123+
| path | value |
124+
| name | Product Team-1 |
125+
| ods_code | F5H1R |
126+
| keys.0.key_type | product_team_id_alias |
127+
| keys.0.key_value | FOOBAR |
128+
Then I receive a status code "201" with body
129+
| path | key_value |
130+
| id | << ignore >> |
131+
| name | Product Team-1 |
132+
| ods_code | F5H1R |
133+
| status | active |
134+
| created_on | << ignore >> |
135+
| updated_on | << ignore >> |
136+
| deleted_on | << ignore >> |
137+
| keys.0.key_type | product_team_id_alias |
138+
| keys.0.key_value | FOOBAR |
139+
And the response headers contain:
140+
| name | value |
141+
| Content-Type | application/json |
142+
| Content-Length | 281 |
143+
Given I note the response field "$.id" as "product_team_id"
144+
When I make a "GET" request with "default" headers to "ProductTeamEpr/${ note(product_team_id) }"
145+
Then I receive a status code "200" with body
146+
| path | value |
147+
| id | ${ note(product_team_id) } |
148+
| name | Product Team-1 |
149+
| ods_code | F5H1R |
150+
| status | active |
151+
| created_on | << ignore >> |
152+
| updated_on | << ignore >> |
153+
| deleted_on | << ignore >> |
154+
| keys.0.key_type | product_team_id_alias |
155+
| keys.0.key_value | FOOBAR |
156+
When I make a "POST" request with "default" headers to "ProductTeamEpr" with body:
157+
| path | value |
158+
| name | Product Team-2 |
159+
| ods_code | F5H1R |
160+
| keys.0.key_type | product_team_id_alias |
161+
| keys.0.key_value | GARPLY |
162+
Then I receive a status code "201" with body
163+
| path | key_value |
164+
| id | << ignore >> |
165+
| name | Product Team-2 |
166+
| ods_code | F5H1R |
167+
| status | active |
168+
| created_on | << ignore >> |
169+
| updated_on | << ignore >> |
170+
| deleted_on | << ignore >> |
171+
| keys.0.key_type | product_team_id_alias |
172+
| keys.0.key_value | GARPLY |
173+
And the response headers contain:
174+
| name | value |
175+
| Content-Type | application/json |
176+
| Content-Length | 281 |
177+
Given I note the response field "$.id" as "product_team_id"
178+
When I make a "GET" request with "default" headers to "ProductTeamEpr/${ note(product_team_id) }"
179+
Then I receive a status code "200" with body
180+
| path | value |
181+
| id | ${ note(product_team_id) } |
182+
| name | Product Team-2 |
183+
| ods_code | F5H1R |
184+
| status | active |
185+
| created_on | << ignore >> |
186+
| updated_on | << ignore >> |
187+
| deleted_on | << ignore >> |
188+
| keys.0.key_type | product_team_id_alias |
189+
| keys.0.key_value | GARPLY |

0 commit comments

Comments
 (0)