-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-app.sh
More file actions
64 lines (52 loc) · 1.48 KB
/
test-app.sh
File metadata and controls
64 lines (52 loc) · 1.48 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
58
59
60
61
62
63
64
#!/bin/bash
echo "Testing Secure File Upload Application..."
# Check if Node.js is available
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed"
exit 1
fi
echo "✅ Node.js is available"
# Check if we're in the right directory
if [ ! -f "src/main/app.js" ]; then
echo "❌ Not in the correct directory"
exit 1
fi
echo "✅ In correct directory"
# Test syntax
echo "🔍 Checking syntax..."
if node -c src/main/app.js 2>/dev/null; then
echo "✅ Syntax check passed"
else
echo "❌ Syntax errors found"
exit 1
fi
# Test if dependencies are installed
echo "🔍 Checking dependencies..."
if [ ! -d "node_modules" ]; then
echo "❌ Dependencies not installed. Run: npm install"
exit 1
fi
echo "✅ Dependencies installed"
# Test the application startup
echo "🚀 Starting application..."
timeout 5s node src/main/app.js &
APP_PID=$!
sleep 2
# Check if the process is still running
if kill -0 $APP_PID 2>/dev/null; then
echo "✅ Application started successfully"
kill $APP_PID 2>/dev/null
echo "✅ Application stopped cleanly"
else
echo "❌ Application failed to start"
exit 1
fi
echo "🎉 All tests passed! The application is ready to use."
echo ""
echo "📋 Next steps:"
echo "1. Start the application: node src/main/app.js"
echo "2. Open browser: http://localhost:3000"
echo "3. Login with admin credentials:"
echo " Username: admin"
echo " Password: Admin123!"
echo "4. Test user registration and approval workflow"