@@ -3,61 +3,9 @@ Feature: Vehicle Inspection REST API - Core CRUD Operations
33 This feature outlines the core Create, Read, Update, and Delete (CRUD) operations for vehicle inspections via the REST API.
44 It includes tests for creating new inspections, retrieving existing ones by ID or other criteria, and handling various success and failure scenarios.
55
6- @post @one_inspection @sunny_day
7- Scenario : Successfully save a single vehicle inspection
8- Given the vehicle inspection with id 10001 does not exist
9- When I send a POST request to "/api/inspection" with the payload:
10- """
11- {
12- "testid": 10001,
13- "testdate": "2023-10-26T10:00:00Z",
14- "testclass": "Class 1",
15- "testtype": "Annual",
16- "testresult": "PASS",
17- "testmileage": 50000,
18- "postcode": "SW1A 0AA",
19- "fuel": "Petrol",
20- "capacity": 1.6,
21- "firstusedate": "2018-01-15T00:00:00Z",
22- "faileditems": [],
23- "vehicle": {
24- "make": "Toyota",
25- "model": "Corolla",
26- "year": 2018,
27- "vin": "VIN1234567890ABCDE"
28- }
29- }
30- """
31- Then the response status code should be 200
32- And the response should be empty
336
34- @post @one_inspection @rainy_day
35- Scenario : Fail to save a single vehicle inspection due to malformed JSON
36- Given the vehicle inspection with id 10002 does not exist
37- When I send a POST request to "/api/inspection" with the payload:
38- """
39- {
40- "testid": 10002,
41- "testdate": "2023-10-26T10:00:00Z",
42- "testclass": "Class 1",
43- "testtype": "Annual",
44- "testresult": "PASS",
45- "testmileage": 50000,
46- "postcode": "SW1A 0AA",
47- "fuel": "Petrol",
48- "capacity": 1.6,
49- "firstusedate": "2018-01-15T00:00:00Z",
50- "faileditems": [],
51- "vehicle": {
52- "make": "Toyota",
53- "model": "Corolla",
54- "year": 2018,
55- "vin": "VIN1234567890ABCDE"
56- // Missing closing brace for vehicle object
57- }
58- """
59- Then the response status code should be 400
60- And the response should contain "Bad Request"
7+
8+
619
6210 @get @by_id @sunny_day
6311 Scenario : Successfully retrieve a vehicle inspection by ID
0 commit comments