-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·57 lines (48 loc) · 1.33 KB
/
test.sh
File metadata and controls
executable file
·57 lines (48 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
echo "Testing HiveMind Dashboard..."
echo ""
# Test 1: Login
echo "1. Testing login..."
RESPONSE=$(curl -s -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"scott","password":"HiveMind2026!"}' \
-c /tmp/hivemind_test_cookies.txt)
if echo "$RESPONSE" | grep -q "success"; then
echo "✅ Login successful"
else
echo "❌ Login failed"
exit 1
fi
# Test 2: Stats API
echo "2. Testing stats API..."
RESPONSE=$(curl -s http://localhost:3000/api/stats \
-b /tmp/hivemind_test_cookies.txt)
if echo "$RESPONSE" | grep -q "totalAgents"; then
echo "✅ Stats API working"
else
echo "❌ Stats API failed"
exit 1
fi
# Test 3: Agents API
echo "3. Testing agents API..."
RESPONSE=$(curl -s http://localhost:3000/api/agents \
-b /tmp/hivemind_test_cookies.txt)
if echo "$RESPONSE" | grep -q "agents"; then
echo "✅ Agents API working"
else
echo "❌ Agents API failed"
exit 1
fi
# Test 4: Departments API
echo "4. Testing departments API..."
RESPONSE=$(curl -s http://localhost:3000/api/departments \
-b /tmp/hivemind_test_cookies.txt)
if echo "$RESPONSE" | grep -q "departments"; then
echo "✅ Departments API working"
else
echo "❌ Departments API failed"
exit 1
fi
echo ""
echo "✅ All tests passed!"
rm /tmp/hivemind_test_cookies.txt