diff options
| author | Alex Pickering <alex@cogarr.net> | 2026-02-01 13:14:32 -0600 |
|---|---|---|
| committer | Alexander M Pickering <alex@cogarr.net> | 2026-02-01 13:14:32 -0600 |
| commit | 3a975db66a3711f34e8b64bb27a8eaca79fdeca9 (patch) | |
| tree | fcc12f8f9d638ff575c1963796de76b7628854b4 /tests/integration/test_error_detection.py | |
| download | ggj26-master.tar.gz ggj26-master.tar.bz2 ggj26-master.zip | |
Diffstat (limited to 'tests/integration/test_error_detection.py')
| -rw-r--r-- | tests/integration/test_error_detection.py | 34 |
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']}") |
