#!/bin/bash # Script to run Postman collection with better response data # This generates multiple report formats with full response bodies COLLECTION_ID="24483733-cefed589-9c3d-4dd5-9673-0e913981403e" ENVIRONMENT_ID="41094746-f8fd4ac6-fb62-4774-b8a5-38c42fd476e3" TIMESTAMP=$(date +%Y-%m-%d-%H-%M-%S) REPORT_DIR="postman-cli-reports" echo "Running LED Name Badge API collection with better response data..." # Create reports directory if it doesn't exist mkdir -p "$REPORT_DIR" echo "🥇 1. JSON Reporter with Newman schema (BEST - response bodies as strings):" echo "==========================================================================" postman collection run "$COLLECTION_ID" \ -e "$ENVIRONMENT_ID" \ -r json \ --reporter-json-export "$REPORT_DIR/LED-API-newman-schema-$TIMESTAMP.json" \ --reporter-json-structure newman echo "✅ Newman schema JSON saved to: $REPORT_DIR/LED-API-newman-schema-$TIMESTAMP.json" echo "" echo "🥈 2. CLI Reporter with verbose output (shows response bodies in terminal):" echo "==========================================================================" postman collection run "$COLLECTION_ID" \ -e "$ENVIRONMENT_ID" \ -r cli \ --verbose echo "" echo "🥉 3. HTML Reporter (human-readable format):" echo "============================================" postman collection run "$COLLECTION_ID" \ -e "$ENVIRONMENT_ID" \ -r html \ --reporter-html-export "$REPORT_DIR/LED-API-readable-$TIMESTAMP.html" echo "✅ HTML report saved to: $REPORT_DIR/LED-API-readable-$TIMESTAMP.html" echo "" echo "📋 Summary:" echo "===========" echo "🥇 #1 RECOMMENDED: --reporter-json-structure newman" echo " → Response bodies as readable JSON strings instead of Buffer arrays" echo " → Perfect for programmatic processing and automation" echo "" echo "🥈 #2 For immediate feedback: -r cli --verbose" echo " → See response bodies directly in terminal output" echo " → Great for debugging and quick testing" echo "" echo "🥉 #3 For sharing/documentation: -r html" echo " → Beautiful formatted reports for humans" echo " → Best for stakeholder communication" echo "" echo "⚠️ Default Postman CLI JSON creates Buffer arrays - always use Newman schema!"