Skip to content

Commit b5c1855

Browse files
Try fixing test
1 parent 2b4a449 commit b5c1855

1 file changed

Lines changed: 5 additions & 37 deletions

File tree

tests/test_graphical_imu_calibration.py

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,53 +30,21 @@
3030
class TestIMUCalibration(unittest.TestCase):
3131
"""Test suite for IMU calibration activities."""
3232

33-
def _open_settings_item(self, title, timeout=2.0):
34-
start = time.time()
35-
label = None
36-
while time.time() - start < timeout:
37-
screen = lv.screen_active()
38-
label = find_label_with_text(screen, title)
39-
if label:
40-
break
41-
wait_for_render(iterations=5)
42-
self.assertIsNotNone(label, f"Could not find {title} menu item")
43-
container = None
44-
try:
45-
container = label.get_parent()
46-
except Exception:
47-
container = None
48-
if container:
49-
try:
50-
container.scroll_to_view(True)
51-
except Exception:
52-
pass
53-
else:
54-
try:
55-
label.scroll_to_view_recursive(True)
56-
except Exception:
57-
pass
58-
wait_for_render(iterations=20)
59-
target = container if container else label
60-
coords = get_widget_coords(target) or get_widget_coords(label)
61-
if coords:
62-
simulate_click(coords["center_x"], coords["center_y"])
63-
wait_for_render(iterations=30)
64-
6533
def _start_activity_from_settings_assets(self, filename, classname):
6634
app_fullname = "com.micropythonos.settings"
6735
entrypoint = f"builtin/apps/{app_fullname}/assets/{filename}"
6836
cwd = f"builtin/apps/{app_fullname}/assets/"
6937
result = AppManager.execute_script(entrypoint, True, classname, cwd, app_fullname=app_fullname)
7038
self.assertTrue(result, f"Failed to start {classname} from {entrypoint}")
71-
wait_for_render(iterations=20)
39+
wait_for_render(iterations=60)
7240

7341
def tearDown(self):
7442
"""Clean up after test."""
7543
# Navigate back to launcher
7644
try:
7745
for _ in range(3): # May need multiple backs
7846
mpos.ui.back_screen()
79-
wait_for_render(5)
47+
wait_for_render(10)
8048
except:
8149
pass
8250

@@ -115,11 +83,11 @@ def test_calibrate_activity_flow(self):
11583
calibrate_btn = find_button_with_text(screen, "Calibrate Now")
11684
self.assertIsNotNone(calibrate_btn, "Could not find 'Calibrate Now' button")
11785
calibrate_btn.send_event(lv.EVENT.CLICKED, None)
118-
wait_for_render(10)
86+
wait_for_render(25)
11987

12088
# Wait for calibration to complete (mock takes ~3 seconds)
12189
time.sleep(4)
122-
wait_for_render(40)
90+
wait_for_render(50)
12391

12492
# Verify calibration completed
12593
screen = lv.screen_active()
@@ -153,7 +121,7 @@ def test_navigation_from_check_to_calibrate(self):
153121
added_path = True
154122
try:
155123
calibrate_btn.send_event(lv.EVENT.CLICKED, None)
156-
wait_for_render(30)
124+
wait_for_render(60)
157125
finally:
158126
if added_path:
159127
try:

0 commit comments

Comments
 (0)