|
| 1 | +# Feature: feedback endpoint API tests |
| 2 | + |
| 3 | + |
| 4 | +# Background: |
| 5 | +# Given The service is started locally |
| 6 | +# And REST API service hostname is localhost |
| 7 | +# And REST API service port is 8080 |
| 8 | +# And REST API service prefix is /v1 |
| 9 | + |
| 10 | + |
| 11 | +# Scenario: Check if feedback endpoint is working |
| 12 | +# Given The system is in default state |
| 13 | +# When I access endpoint "feedback" using HTTP POST with conversation ID conversationID |
| 14 | +# """ |
| 15 | +# { |
| 16 | +# "llm_response": "bar", |
| 17 | +# "sentiment": -1, |
| 18 | +# "user_feedback": "Not satisfied with the response quality", |
| 19 | +# "user_question": "random question" |
| 20 | +# } |
| 21 | +# """ |
| 22 | +# Then The status code of the response is 200 |
| 23 | +# And The body of the response is the following |
| 24 | +# """ |
| 25 | +# {"response": "feedback received"} |
| 26 | +# """ |
| 27 | + |
| 28 | +# Scenario: Check if feedback endpoint is not working when not authorized |
| 29 | +# Given The system is in default state |
| 30 | +# And I remove the auth header |
| 31 | +# When I access endpoint "feedback" using HTTP POST with conversation ID conversationID |
| 32 | +# """ |
| 33 | +# { |
| 34 | +# "llm_response": "bar", |
| 35 | +# "sentiment": -1, |
| 36 | +# "user_feedback": "Not satisfied with the response quality", |
| 37 | +# "user_question": "random question" |
| 38 | +# } |
| 39 | +# """ |
| 40 | +# Then The status code of the response is 400 |
| 41 | +# And The body of the response is the following |
| 42 | +# """ |
| 43 | +# {"response": "feedback received"} |
| 44 | +# """ |
| 45 | + |
| 46 | +# Scenario: Check if feedback endpoint is not working when feedback is disabled |
| 47 | +# Given The system is in default state |
| 48 | +# And I disable the feedback |
| 49 | +# When I access endpoint "feedback" using HTTP POST with conversation ID conversationID |
| 50 | +# """ |
| 51 | +# { |
| 52 | +# "llm_response": "bar", |
| 53 | +# "sentiment": -1, |
| 54 | +# "user_feedback": "Not satisfied with the response quality", |
| 55 | +# "user_question": "random question" |
| 56 | +# } |
| 57 | +# """ |
| 58 | +# Then The status code of the response is 403 |
| 59 | +# And The body of the response is the following |
| 60 | +# """ |
| 61 | +# {"response": "feedback received"} |
| 62 | +# """ |
| 63 | + |
| 64 | +# Scenario: Check if feedback endpoint fails with incorrect body format when conversationID is not present |
| 65 | +# Given The system is in default state |
| 66 | +# When I access endpoint "feedback" using HTTP POST method |
| 67 | +# """ |
| 68 | +# { |
| 69 | +# "llm_response": "bar", |
| 70 | +# "sentiment": -1, |
| 71 | +# "user_feedback": "Not satisfied with the response quality", |
| 72 | +# "user_question": "random question" |
| 73 | +# } |
| 74 | +# """ |
| 75 | +# Then The status code of the response is 422 |
| 76 | +# And The body of the response is the following |
| 77 | +# """ |
| 78 | +# { "type": "missing", "loc": [ "body", "conversation_id" ], "msg": "Field required", } |
| 79 | +# """ |
| 80 | + |
| 81 | +# Scenario: Check if feedback/status endpoint is working |
| 82 | +# Given The system is in default state |
| 83 | +# When I access REST API endpoint "feedback/status" using HTTP GET method |
| 84 | +# Then The status code of the response is 200 |
| 85 | +# And The body of the response is the following |
| 86 | +# """ |
| 87 | +# {"functionality": "feedback", "status": { "enabled": true}} |
| 88 | +# """ |
| 89 | + |
| 90 | + |
0 commit comments