From 3a975db66a3711f34e8b64bb27a8eaca79fdeca9 Mon Sep 17 00:00:00 2001 From: Alex Pickering Date: Sun, 1 Feb 2026 13:14:32 -0600 Subject: Initial commit --- tests/integration/test_error_detection.py | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/integration/test_error_detection.py (limited to 'tests/integration/test_error_detection.py') 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']}") -- cgit v1.2.3-70-g09d2