37 lines
1.1 KiB
Bash
Executable File
37 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Test to verify WakaAPI is discovered and displayed on homepage
|
|
# Following TDD: Write test → Execute test → Test fails → Write minimal code to pass test
|
|
|
|
set -e
|
|
|
|
echo "Testing WakaAPI discovery on homepage..."
|
|
|
|
# Check if WakaAPI container is running
|
|
if ! docker ps | grep -q "tsysdevstack-wakaapi"; then
|
|
echo "❌ WakaAPI container is not running"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if homepage container is running
|
|
if ! docker ps | grep -q "tsysdevstack-homepage"; then
|
|
echo "❌ Homepage container is not running"
|
|
exit 1
|
|
fi
|
|
|
|
# Test if we can access WakaAPI directly
|
|
if ! curl -f -s "http://127.0.0.1:4001/" > /dev/null 2>&1; then
|
|
echo "❌ WakaAPI is not accessible at http://127.0.0.1:4001"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if WakaAPI appears on the homepage
|
|
content=$(curl -s http://127.0.0.1:4000/)
|
|
if [[ "$content" == *"WakaAPI"* ]] || [[ "$content" == *"wakaapi"* ]] || [[ "$content" == *"wakapi"* ]]; then
|
|
echo "✅ WakaAPI is displayed on homepage"
|
|
exit 0
|
|
else
|
|
echo "❌ WakaAPI is NOT displayed on homepage"
|
|
echo "Test failed: WakaAPI not discovered by homepage"
|
|
exit 1
|
|
fi |