diff --git a/tests/graphical_test_helper.py b/tests/graphical_test_helper.py index 77758db7..6677223c 100644 --- a/tests/graphical_test_helper.py +++ b/tests/graphical_test_helper.py @@ -43,6 +43,7 @@ def wait_for_render(iterations=10): def capture_screenshot(filepath, width=320, height=240, color_format=lv.COLOR_FORMAT.RGB565): + print(f"capture_screenshot writing to {filepath}") """ Capture screenshot of current screen using LVGL snapshot. diff --git a/tests/test_osupdate_graphical.py b/tests/test_osupdate_graphical.py index 8cfee17c..c4cc8480 100644 --- a/tests/test_osupdate_graphical.py +++ b/tests/test_osupdate_graphical.py @@ -18,29 +18,6 @@ from graphical_test_helper import ( class TestOSUpdateGraphicalUI(unittest.TestCase): """Graphical tests for OSUpdate app UI state.""" - def setUp(self): - """Set up test fixtures before each test method.""" - self.hardware_id = mpos.info.get_hardware_id() - self.screenshot_dir = "tests/screenshots" - - # Ensure screenshots directory exists - # First check if tests directory exists - try: - os.stat("tests") - except OSError: - # We're not in the right directory, maybe running from root - pass - - # Now create screenshots directory if needed - try: - os.stat(self.screenshot_dir) - except OSError: - try: - os.mkdir(self.screenshot_dir) - except OSError: - # Might already exist or permission issue - pass - def tearDown(self): """Clean up after each test method.""" # Navigate back to launcher @@ -204,12 +181,6 @@ class TestOSUpdateGraphicalUI(unittest.TestCase): print("\n=== OSUpdate Initial State Labels ===") print_screen_labels(screen) - # Capture screenshot - screenshot_path = f"{self.screenshot_dir}/osupdate_initial_{self.hardware_id}.raw" - capture_screenshot(screenshot_path) - print(f"Screenshot saved to: {screenshot_path}") - - class TestOSUpdateGraphicalStatusMessages(unittest.TestCase): """Graphical tests for OSUpdate status messages.""" @@ -294,15 +265,6 @@ class TestOSUpdateGraphicalScreenshots(unittest.TestCase): self.assertTrue(result) wait_for_render(20) - screenshot_path = f"{self.screenshot_dir}/osupdate_main_{self.hardware_id}.raw" - capture_screenshot(screenshot_path) - - # Verify file was created - try: - stat = os.stat(screenshot_path) - self.assertTrue(stat[6] > 0, "Screenshot file should not be empty") - except OSError: - self.fail(f"Screenshot file not created: {screenshot_path}") def test_capture_with_labels_visible(self): """Capture screenshot ensuring all text is visible.""" @@ -321,7 +283,4 @@ class TestOSUpdateGraphicalScreenshots(unittest.TestCase): self.assertTrue(has_force, "Force checkbox should be visible") self.assertTrue(has_button, "Update button should be visible") - screenshot_path = f"{self.screenshot_dir}/osupdate_labeled_{self.hardware_id}.raw" - capture_screenshot(screenshot_path) -