mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-02 08:12:21 -07:00
feat(api): MCP, OpenAPI & Dynamic Introspection
New Features: - API endpoints now support comprehensive input validation with detailed error responses via Pydantic models. - OpenAPI specification endpoint (/openapi.json) and interactive Swagger UI documentation (/docs) now available for API discovery. - Enhanced MCP session lifecycle management with create, retrieve, and delete operations. - Network diagnostic tools: traceroute, nslookup, NMAP scanning, and network topology viewing exposed via API. - Device search, filtering by status (including 'offline'), and bulk operations (copy, delete, update). - Wake-on-LAN functionality for remote device management. - Added dynamic tool disablement and status reporting. Bug Fixes: - Fixed get_tools_status in registry to correctly return boolean values instead of None for enabled tools. - Improved error handling for invalid API inputs with standardized validation responses. - Fixed OPTIONS request handling for cross-origin requests. Refactoring: - Significant refactoring of api_server_start.py to use decorator-based validation (@validate_request).
This commit is contained in:
@@ -4,12 +4,11 @@ Notifications Page UI Tests
|
||||
Tests notification table, mark as read, delete operations
|
||||
"""
|
||||
|
||||
import time
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
|
||||
from test_helpers import BASE_URL, api_get
|
||||
from .test_helpers import BASE_URL, api_get, wait_for_page_load
|
||||
|
||||
|
||||
def test_notifications_page_loads(driver):
|
||||
@@ -18,14 +17,14 @@ def test_notifications_page_loads(driver):
|
||||
WebDriverWait(driver, 10).until(
|
||||
EC.presence_of_element_located((By.TAG_NAME, "body"))
|
||||
)
|
||||
time.sleep(2)
|
||||
wait_for_page_load(driver, timeout=10)
|
||||
assert "notification" in driver.page_source.lower(), "Page should contain notification content"
|
||||
|
||||
|
||||
def test_notifications_table_present(driver):
|
||||
"""Test: Notifications table is rendered"""
|
||||
driver.get(f"{BASE_URL}/userNotifications.php")
|
||||
time.sleep(2)
|
||||
wait_for_page_load(driver, timeout=10)
|
||||
table = driver.find_elements(By.CSS_SELECTOR, "table, #notificationsTable")
|
||||
assert len(table) > 0, "Notifications table should be present"
|
||||
|
||||
@@ -33,7 +32,7 @@ def test_notifications_table_present(driver):
|
||||
def test_notification_action_buttons_present(driver):
|
||||
"""Test: Notification action buttons are visible"""
|
||||
driver.get(f"{BASE_URL}/userNotifications.php")
|
||||
time.sleep(2)
|
||||
wait_for_page_load(driver, timeout=10)
|
||||
buttons = driver.find_elements(By.CSS_SELECTOR, "button[id*='notification'], .notification-action")
|
||||
assert len(buttons) > 0, "Notification action buttons should be present"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user