You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tests): relax validation rules and expand enum coverage in well-inventory-csv feature
- Move site_name, elevation_ft, elevation_method, and measuring_point_height_ft from required to optional
- Replace "both contact_name and contact_organization required" rule with "at least one required" rule
- Remove all-or-nothing water level rule; water_level_date_time now required only when depth_to_water_ft is provided, all other water level fields are independent and optional
- Add negative scenarios for invalid address_type, state abbreviation, well_hole_status, monitoring_status, and well_pump_type with allowed values specified
- Add well_notes, well_measuring_notes, water_notes, historical_notes, well_hole_status, and monitoring_status to optional fields
Copy file name to clipboardExpand all lines: tests/features/well-inventory-csv.feature
+98-48Lines changed: 98 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -35,18 +35,15 @@ Feature: Bulk upload well inventory from CSV via CLI
35
35
| requiredfieldname |
36
36
| project |
37
37
| well_name_point_id |
38
-
| site_name |
39
38
| date_time |
40
39
| field_staff |
41
40
| utm_easting |
42
41
| utm_northing |
43
42
| utm_zone |
44
-
| elevation_ft |
45
-
| elevation_method |
46
-
| measuring_point_height_ft |
47
43
And each "well_name_point_id" value is unique per row
48
44
And the CSV includes optional fields when available:
49
45
| optionalfieldname |
46
+
| site_name |
50
47
| field_staff_2 |
51
48
| field_staff_3 |
52
49
| contact_1_name |
@@ -110,32 +107,41 @@ Feature: Bulk upload well inventory from CSV via CLI
110
107
| completion_source |
111
108
| total_well_depth_ft |
112
109
| historic_depth_to_water_ft |
110
+
| historical_notes |
113
111
| depth_source |
114
112
| well_pump_type |
115
113
| well_pump_depth_ft |
116
114
| is_open |
117
115
| datalogger_possible |
118
116
| casing_diameter_ft |
117
+
| elevation_ft |
118
+
| elevation_method |
119
+
| measuring_point_height_ft |
119
120
| measuring_point_description |
120
121
| well_purpose |
121
122
| well_purpose_2 |
122
-
| well_status |
123
+
| well_hole_status |
124
+
| well_status |
123
125
| monitoring_frequency |
126
+
| monitoring_status |
124
127
| sampling_scenario_notes |
128
+
| well_notes |
129
+
| well_measuring_notes |
130
+
| water_notes |
125
131
| well_measuring_notes |
126
132
| sample_possible |
127
-
And the csv includes optional water level entry fields when available:
133
+
And the csv includes optional water level entry fields when available:
128
134
| water_level_entryfields |
129
135
| measuring_person |
130
136
| sample_method |
131
137
| water_level_date_time |
132
138
| mp_height |
133
139
| level_status |
134
140
| depth_to_water_ft |
135
-
| data_quality |
141
+
| data_quality |
136
142
| water_level_notes |
137
-
And the required "date_time" values are valid ISO 8601 timezone-naive datetime strings (e.g. "2025-02-15T10:30:00")
138
-
And the optional "water_level_date_time" values are valid ISO 8601 timezone-naive datetime strings (e.g. "2025-02-15T10:30:00") when provided
143
+
And the required "date_time" values are valid ISO 8601 timezone-naive datetime strings (e.g. "2025-02-15T10:30:00")
144
+
And the optional "water_level_date_time" values are valid ISO 8601 timezone-naive datetime strings (e.g. "2025-02-15T10:30:00") when provided
139
145
140
146
# And all optional lexicon fields contain valid lexicon values when provided
141
147
# And all optional numeric fields contain valid numeric values when provided
@@ -161,15 +167,11 @@ Feature: Bulk upload well inventory from CSV via CLI
161
167
| requiredfieldname |
162
168
| project |
163
169
| well_name_point_id |
164
-
| site_name |
165
170
| date_time |
166
171
| field_staff |
167
172
| utm_easting |
168
173
| utm_northing |
169
174
| utm_zone |
170
-
| elevation_ft |
171
-
| elevation_method |
172
-
| measuring_point_height_ft |
173
175
When I run the well inventory bulk upload command
174
176
Then the command exits with code 0
175
177
And the system should return a response in JSON format
@@ -204,15 +206,15 @@ Feature: Bulk upload well inventory from CSV via CLI
204
206
205
207
@negative@validation@BDMS-TBD
206
208
Scenario: Upload fails when a row has an invalid postal code format
207
-
Given my CSV file contains a row that has an invalid postal code format in contact_1_address_1_postal_code
209
+
Given my CSV file contains a row that has an invalid postal code format in contact_1_address_1_postal_code
208
210
When I run the well inventory bulk upload command
209
211
Then the command exits with a non-zero exit code
210
212
And the system should return a response in JSON format
211
213
And the response includes a validation error indicating the invalid postal code format
212
214
And no wells are imported
213
215
214
216
@negative@validation@BDMS-TBD
215
-
Scenario: Upload fails when a row has a contact with a invalid phone number format
217
+
Scenario: Upload fails when a row has a contact with an invalid phone number format
216
218
Given my CSV file contains a row with a contact with a phone number that is not in the valid format
217
219
When I run the well inventory bulk upload command
218
220
Then the command exits with a non-zero exit code
@@ -221,7 +223,7 @@ Feature: Bulk upload well inventory from CSV via CLI
221
223
And no wells are imported
222
224
223
225
@negative@validation@BDMS-TBD
224
-
Scenario: Upload fails when a row has a contact with a invalid email format
226
+
Scenario: Upload fails when a row has a contact with an invalid email format
225
227
Given my CSV file contains a row with a contact with an email that is not in the valid format
226
228
When I run the well inventory bulk upload command
227
229
Then the command exits with a non-zero exit code
@@ -230,7 +232,7 @@ Feature: Bulk upload well inventory from CSV via CLI
230
232
And no wells are imported
231
233
232
234
@negative@validation@BDMS-TBD
233
-
Scenario: Upload fails when a row has contact without a contact_role
235
+
Scenario: Upload fails when a row has a contact without a contact_role
234
236
Given my CSV file contains a row with a contact but is missing the required "contact_role" field for that contact
235
237
When I run the well inventory bulk upload command
236
238
Then the command exits with a non-zero exit code
@@ -239,7 +241,7 @@ Feature: Bulk upload well inventory from CSV via CLI
239
241
And no wells are imported
240
242
241
243
@negative@validation@BDMS-TBD
242
-
Scenario: Upload fails when a row has contact without a "contact_type"
244
+
Scenario: Upload fails when a row has a contact without a "contact_type"
243
245
Given my CSV file contains a row with a contact but is missing the required "contact_type" field for that contact
244
246
When I run the well inventory bulk upload command
245
247
Then the command exits with a non-zero exit code
@@ -248,7 +250,7 @@ Feature: Bulk upload well inventory from CSV via CLI
248
250
And no wells are imported
249
251
250
252
@negative@validation@BDMS-TBD
251
-
Scenario: Upload fails when a row has contact with an invalid "contact_type"
253
+
Scenario: Upload fails when a row has a contact with an invalid "contact_type"
252
254
Given my CSV file contains a row with a contact_type value that is not in the valid lexicon for "contact_type"
253
255
When I run the well inventory bulk upload command
254
256
Then the command exits with a non-zero exit code
@@ -257,7 +259,7 @@ Feature: Bulk upload well inventory from CSV via CLI
257
259
And no wells are imported
258
260
259
261
@negative@validation@BDMS-TBD
260
-
Scenario: Upload fails when a row has contact with an email without an email_type
262
+
Scenario: Upload fails when a row has a contact with an email without an email_type
261
263
Given my CSV file contains a row with a contact with an email but is missing the required "email_type" field for that email
262
264
When I run the well inventory bulk upload command
263
265
Then the command exits with a non-zero exit code
@@ -266,7 +268,7 @@ Feature: Bulk upload well inventory from CSV via CLI
266
268
And no wells are imported
267
269
268
270
@negative@validation@BDMS-TBD
269
-
Scenario: Upload fails when a row has contact with a phone without a phone_type
271
+
Scenario: Upload fails when a row has a contact with a phone without a phone_type
270
272
Given my CSV file contains a row with a contact with a phone but is missing the required "phone_type" field for that phone
271
273
When I run the well inventory bulk upload command
272
274
Then the command exits with a non-zero exit code
@@ -275,14 +277,59 @@ Feature: Bulk upload well inventory from CSV via CLI
275
277
And no wells are imported
276
278
277
279
@negative@validation@BDMS-TBD
278
-
Scenario: Upload fails when a row has contact with an address without an address_type
280
+
Scenario: Upload fails when a row has a contact with an address without an address_type
279
281
Given my CSV file contains a row with a contact with an address but is missing the required "address_type" field for that address
280
282
When I run the well inventory bulk upload command
281
283
Then the command exits with a non-zero exit code
282
284
And the system should return a response in JSON format
283
285
And the response includes a validation error indicating the missing "address_type" value
284
286
And no wells are imported
285
287
288
+
@negative@validation@BDMS-TBD
289
+
Scenario: Upload fails when a row has a contact with an invalid "address_type"
290
+
Given my CSV file contains a row with an address_type value that is not one of: Work, Personal, Mailing, Physical
291
+
When I run the well inventory bulk upload command
292
+
Then the command exits with a non-zero exit code
293
+
And the system should return a response in JSON format
294
+
And the response includes a validation error indicating an invalid "address_type" value
295
+
And no wells are imported
296
+
297
+
@negative@validation@BDMS-TBD
298
+
Scenario: Upload fails when a row has a contact with an invalid state abbreviation
299
+
Given my CSV file contains a row with a state value that is not a valid 2-letter US state abbreviation
300
+
When I run the well inventory bulk upload command
301
+
Then the command exits with a non-zero exit code
302
+
And the system should return a response in JSON format
303
+
And the response includes a validation error indicating an invalid state value
304
+
And no wells are imported
305
+
306
+
@negative@validation@BDMS-TBD
307
+
Scenario: Upload fails when a row has an invalid well_hole_status value
308
+
Given my CSV file contains a row with a well_hole_status value that is not one of: "Abandoned", "Active, pumping well", "Destroyed, exists but not usable", "Inactive, exists but not used"
309
+
When I run the well inventory bulk upload command
310
+
Then the command exits with a non-zero exit code
311
+
And the system should return a response in JSON format
312
+
And the response includes a validation error indicating an invalid "well_hole_status" value
313
+
And no wells are imported
314
+
315
+
@negative@validation@BDMS-TBD
316
+
Scenario: Upload fails when a row has an invalid monitoring_status value
317
+
Given my CSV file contains a row with a monitoring_status value that is not one of: "Open", "Open (unequipped)", "Closed", "Datalogger can be installed", "Datalogger cannot be installed", "Abandoned", "Active, pumping well", "Destroyed, exists but not usable", "Inactive, exists but not used", "Currently monitored", "Not currently monitored"
318
+
When I run the well inventory bulk upload command
319
+
Then the command exits with a non-zero exit code
320
+
And the system should return a response in JSON format
321
+
And the response includes a validation error indicating an invalid "monitoring_status" value
322
+
And no wells are imported
323
+
324
+
@negative@validation@BDMS-TBD
325
+
Scenario: Upload fails when a row has an invalid well_pump_type value
326
+
Given my CSV file contains a row with a well_pump_type value that is not one of: "Submersible", "Jet", "Line Shaft", "Hand"
327
+
When I run the well inventory bulk upload command
328
+
Then the command exits with a non-zero exit code
329
+
And the system should return a response in JSON format
330
+
And the response includes a validation error indicating an invalid "well_pump_type" value
331
+
And no wells are imported
332
+
286
333
@negative@validation@BDMS-TBD
287
334
Scenario: Upload fails when a row has utm_easting utm_northing and utm_zone values that are not within New Mexico
288
335
Given my CSV file contains a row with utm_easting utm_northing and utm_zone values that are not within New Mexico
@@ -292,6 +339,24 @@ Feature: Bulk upload well inventory from CSV via CLI
292
339
And the response includes a validation error indicating the invalid UTM coordinates
293
340
And no wells are imported
294
341
342
+
@negative@validation@BDMS-TBD
343
+
Scenario: Upload fails when a row has a contact with neither contact_name nor contact_organization
344
+
Given my CSV file contains a row with contact fields filled but both "contact_1_name" and "contact_1_organization" are blank
345
+
When I run the well inventory bulk upload command
346
+
Then the command exits with a non-zero exit code
347
+
And the system should return a response in JSON format
348
+
And the response includes a validation error indicating that at least one of "contact_1_name" or "contact_1_organization" must be provided
349
+
And no wells are imported
350
+
351
+
@negative@validation@BDMS-TBD
352
+
Scenario: Upload fails when water_level_date_time is missing but depth_to_water_ft is provided
353
+
Given my CSV file contains a row where "depth_to_water_ft" is filled but "water_level_date_time" is blank
354
+
When I run the well inventory bulk upload command
355
+
Then the command exits with a non-zero exit code
356
+
And the system should return a response in JSON format
357
+
And the response includes a validation error indicating that "water_level_date_time" is required when "depth_to_water_ft" is provided
358
+
And no wells are imported
359
+
295
360
@negative@validation@required_fields@BDMS-TBD
296
361
Scenario Outline: Upload fails when a required field is missing
297
362
Given my CSV file contains a row missing the required "<required_field>" field
@@ -305,15 +370,11 @@ Feature: Bulk upload well inventory from CSV via CLI
305
370
| required_field |
306
371
| project |
307
372
| well_name_point_id |
308
-
| site_name |
309
373
| date_time |
310
374
| field_staff |
311
375
| utm_easting |
312
376
| utm_northing |
313
377
| utm_zone |
314
-
| elevation_ft |
315
-
| elevation_method |
316
-
| measuring_point_height_ft |
317
378
318
379
@negative@validation@boolean_fields@BDMS-TBD
319
380
Scenario: Upload fails due to invalid boolean field values
@@ -359,9 +420,9 @@ Feature: Bulk upload well inventory from CSV via CLI
0 commit comments