@@ -79,32 +79,14 @@ jobs:
7979
8080
8181 # 5. Send POST request with JSON payload to "/"
82- - name : π Send POST request with JSON payload to root
82+ - name : Send POST request with JSON payload
8383 run : |
8484
85- echo "π POST $API_BASE/"
86- echo "π Payload contents:"
87- cat "$JSON_PAYLOAD_PATH" || { echo "β files_payload.json not found"; exit 1; }
88-
89- # Send POST and capture both body and status code
9085 response=$(curl -s -X POST "$API_BASE/" \
9186 -H "Authorization: Bearer $TOKEN" \
9287 -H "Content-Type: application/json" \
9388 --data-binary "@$JSON_PAYLOAD_PATH")
9489
95- # # Split response into body and status code
96- # body=$(echo "$response" | head -n -1)
97- # status_code=$(echo "$response" | tail -n1)
98-
99- # echo "π HTTP status: $status_code"
100- # echo "π Response body:"
101- # echo "$body" | jq . || echo "β οΈ Response is not valid JSON"
102-
103- # # Check HTTP status
104- # if [ "$status_code" -ne 200 ]; then
105- # echo "β POST failed (HTTP $status_code)"
106- # fi
107-
10890 message=$(jq -r '.message' <<< "$response")
10991
11092 echo -e "β Test Fail:\n$message"
@@ -115,9 +97,10 @@ jobs:
11597 result_message=$(echo "$body" | jq -r '.message // "No message provided"')
11698
11799 if [ "$result_status" != "passed" ]; then
118- echo "β Validation failed: $result_message"
100+
101+ echo "β Validation failed: $message"
119102 exit 1
120103 fi
121104
122- echo "β
Validation passed: $result_message "
105+ echo "β
Validation passed: $message "
123106
0 commit comments