|
| 1 | +Feature: HTTP Requests |
| 2 | + As a DevOps Engineer |
| 3 | + I want to test HTTP endpoints |
| 4 | + So that I can validate API functionality and infrastructure |
| 5 | + |
| 6 | + Scenario: Test basic GET request |
| 7 | + Given I have a HTTP endpoint at "http://localhost:8000/get" |
| 8 | + When I make a GET request |
| 9 | + Then the HTTP response status should be 200 |
| 10 | + |
| 11 | + Scenario: Test GET request with JSON response |
| 12 | + Given I have a HTTP endpoint at "http://localhost:8000/json" |
| 13 | + When I make a GET request |
| 14 | + Then the HTTP response status should be 200 |
| 15 | + And the response should be valid JSON |
| 16 | + |
| 17 | + Scenario: Test POST request with status assertion |
| 18 | + Given I have a HTTP endpoint at "http://localhost:8000/post" |
| 19 | + When I make a POST request |
| 20 | + Then the HTTP response status should be 200 |
| 21 | + |
| 22 | + Scenario: Test response content validation |
| 23 | + Given I have a HTTP endpoint at "http://localhost:8000/user-agent" |
| 24 | + When I make a GET request |
| 25 | + Then the HTTP response should contain "user-agent" |
| 26 | + |
| 27 | + Scenario: Test custom headers |
| 28 | + Given I have a HTTP endpoint at "http://localhost:8000/headers" |
| 29 | + And I set the headers to |
| 30 | + | Name | Value | |
| 31 | + | Authorization | Bearer test-token | |
| 32 | + | Content-Type | application/json | |
| 33 | + When I make a GET request |
| 34 | + Then the HTTP response status should be 200 |
| 35 | + |
| 36 | + Scenario: Test POST with body and headers |
| 37 | + Given I have a HTTP endpoint at "http://localhost:8000/post" |
| 38 | + And I set the headers to |
| 39 | + | Name | Value | |
| 40 | + | Content-Type | application/json | |
| 41 | + And I set the request body to "test data" |
| 42 | + When I make a POST request |
| 43 | + Then the HTTP response status should be 200 |
| 44 | + And the HTTP response should contain "test data" |
| 45 | + |
| 46 | + Scenario: Test response header validation |
| 47 | + Given I have a HTTP endpoint at "http://localhost:8000/response-headers?Content-Type=application/json" |
| 48 | + When I make a GET request |
| 49 | + Then the HTTP response status should be 200 |
| 50 | + And the HTTP response header "Content-Type" should be "application/json" |
| 51 | + |
| 52 | + Scenario: Test file upload |
| 53 | + Given I have a HTTP endpoint at "http://localhost:8000/post" |
| 54 | + And I have a file "../../examples/http/test-file.txt" as field "file" |
| 55 | + When I make a POST request |
| 56 | + Then the HTTP response status should be 200 |
| 57 | + |
| 58 | + Scenario: Test file upload with form data |
| 59 | + Given I have a HTTP endpoint at "http://localhost:8000/post" |
| 60 | + And I have a file "../../examples/http/test-file.txt" as field "file" |
| 61 | + And I set content type to "multipart/form-data" |
| 62 | + And I set the form data to: |
| 63 | + | Name | Value | |
| 64 | + | uuid | 191152a9-0bd6-4db0-999d-12787295f1ec | |
| 65 | + | type | document | |
| 66 | + When I make a POST request |
| 67 | + Then the HTTP response status should be 200 |
| 68 | + |
| 69 | + Scenario: Test multiple response validations |
| 70 | + Given I have a HTTP endpoint at "http://localhost:8000/json" |
| 71 | + When I make a GET request |
| 72 | + Then the HTTP response status should be 200 |
| 73 | + And the HTTP response should be valid JSON |
| 74 | + And the HTTP response should contain "slideshow" |
0 commit comments