feat: Implement auto-capture of screenshots and diagnostics on test failures

- Added a new helper function `CaptureHarnessScreenshot` to encapsulate SDL screenshot logic.
- Updated `ImGuiTestHarnessServiceImpl::Screenshot` to utilize the new screenshot helper.
- Enhanced `TestManager::CaptureFailureContext` to automatically capture screenshots and widget state on test failures.
- Introduced new fields in the `GetTestResultsResponse` proto for screenshot path, size, failure context, and widget state.
- Updated CLI and gRPC client to expose new diagnostic fields in test results.
- Ensured that screenshots are saved in a structured directory under the system's temp directory.
- Improved logging for auto-capture events, including success and failure messages.
This commit is contained in:
scawful
2025-10-02 23:36:09 -04:00
parent c348f7f91f
commit 0447d6f8a1
11 changed files with 509 additions and 419 deletions

View File

@@ -264,6 +264,8 @@ if(YAZE_WITH_GRPC)
target_sources(yaze PRIVATE
${CMAKE_SOURCE_DIR}/src/app/core/service/imgui_test_harness_service.cc
${CMAKE_SOURCE_DIR}/src/app/core/service/imgui_test_harness_service.h
${CMAKE_SOURCE_DIR}/src/app/core/service/screenshot_utils.cc
${CMAKE_SOURCE_DIR}/src/app/core/service/screenshot_utils.h
${CMAKE_SOURCE_DIR}/src/app/core/service/widget_discovery_service.cc
${CMAKE_SOURCE_DIR}/src/app/core/service/widget_discovery_service.h
${CMAKE_SOURCE_DIR}/src/app/core/testing/test_recorder.cc