aboutsummaryrefslogtreecommitdiff
path: root/tests/integration/test_error_detection.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/test_error_detection.py')
-rw-r--r--tests/integration/test_error_detection.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/integration/test_error_detection.py b/tests/integration/test_error_detection.py
new file mode 100644
index 0000000..7cd9bf9
--- /dev/null
+++ b/tests/integration/test_error_detection.py
@@ -0,0 +1,34 @@
+"""
+Test to verify that Amulet error detection is working.
+This test checks if the error detection mechanism can detect errors.
+"""
+import pytest
+from selenium.webdriver.common.by import By
+import time
+
+
+pytestmark = [pytest.mark.nondestructive]
+
+
+@pytest.mark.smoke
+def test_error_detection_mechanism(app):
+ """Test that the error detection mechanism is set up correctly."""
+ # Wait for app to fully initialize
+ time.sleep(3)
+
+ # Check if window.amuletErrors is defined
+ errors_defined = app.execute_script("""
+ return typeof window.amuletErrors !== 'undefined';
+ """)
+
+ assert errors_defined, "window.amuletErrors is not defined - log_js_bridge may not be loaded"
+
+ # Check initial state
+ error_count = app.execute_script("return window.amuletErrors.length;")
+ print(f"Initial error count: {error_count}")
+
+ # If there are errors, print them
+ if error_count > 0:
+ errors = app.execute_script("return window.amuletErrors;")
+ for err in errors:
+ print(f" {err['level']}: {err['message']}")