diff --git a/tests/e2e/test_system_sae.py b/tests/e2e/test_system_sae.py
index b520c34..080b58b 100644
--- a/tests/e2e/test_system_sae.py
+++ b/tests/e2e/test_system_sae.py
@@ -134,3 +134,30 @@ class TestSAECompression:
compressed = sae._compress_xml(broken_xml)
assert "PACKAGES: com.instagram.android" in compressed
assert "TEXTS: Hello" in compressed
+
+
+class TestSAELoop:
+ """Tests the higher-level engine loops."""
+
+ def test_ensure_clear_screen_returns_true_immediately_if_normal(self, sae):
+ """If the screen is NORMAL, the SAE should return True without taking actions."""
+ xml_dump = '''
+
+
+
+ '''
+ # Bypass dump_hierarchy
+ sae.device.dump_hierarchy = lambda: xml_dump
+ assert sae.ensure_clear_screen(max_attempts=3) is True
+ assert sae._consecutive_failures == 0
+
+ def test_is_instagram_foreground(self, sae):
+ xml_dump = '''
+
+
+
+ '''
+ assert sae.is_instagram_foreground(xml_dump=xml_dump) is True
+
+ foreign_xml = ''
+ assert sae.is_instagram_foreground(xml_dump=foreign_xml) is False