mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-03 00:31:35 -07:00
refactor UI backend calls to python endpoints
This commit is contained in:
42
test/ui/run_ui_tests.sh
Executable file
42
test/ui/run_ui_tests.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# NetAlertX UI Test Runner
|
||||
# Comprehensive UI page testing
|
||||
|
||||
set -e
|
||||
|
||||
echo "============================================"
|
||||
echo " NetAlertX UI Test Suite"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
|
||||
echo "→ Checking and installing dependencies..."
|
||||
# Install selenium
|
||||
pip install -q selenium
|
||||
|
||||
# Check if chromium is installed, install if missing
|
||||
if ! command -v chromium &> /dev/null && ! command -v chromium-browser &> /dev/null; then
|
||||
echo "→ Installing chromium and chromedriver..."
|
||||
if command -v apk &> /dev/null; then
|
||||
# Alpine Linux
|
||||
apk add --no-cache chromium chromium-chromedriver nss freetype harfbuzz ca-certificates ttf-freefont font-noto
|
||||
elif command -v apt-get &> /dev/null; then
|
||||
# Debian/Ubuntu
|
||||
apt-get update && apt-get install -y chromium chromium-driver
|
||||
fi
|
||||
else
|
||||
echo "✓ Chromium already installed"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Running tests..."
|
||||
python test/ui/run_all_tests.py
|
||||
|
||||
exit_code=$?
|
||||
echo ""
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "✓ All tests passed!"
|
||||
else
|
||||
echo "✗ Some tests failed."
|
||||
fi
|
||||
|
||||
exit $exit_code
|
||||
Reference in New Issue
Block a user