Description
Add the ability to automatically capture screenshots during test execution and include them in generated reports. This is particularly useful for GUI testing workflows where visual evidence is required for validation.
Current behavior
- No screenshot capability during test execution.
- Users must manually capture and attach screenshots to reports.
Expected behavior
- Tests can trigger screenshots via a simple API or marker:
# guitest: show
# guitest: screenshot
- Screenshots are automatically captured at configurable moments (test start, test end, on failure).
- Captured images are stored alongside test results.
- Screenshots are embedded in exported HTML/DOCX reports.
Implementation ideas
- Use
QScreen.grabWindow() or Pillow.ImageGrab for cross-platform screenshots.
- Add a
# guitest: screenshot directive to trigger capture at specific points.
- Add
auto_screenshot option in moduletester.ini: on_failure, on_completion, never.
- Store screenshots in
.moduletester/screenshots/<test_name>_<timestamp>.png.
- Embed screenshots in Jinja2 templates as base64 images or linked files.
Acceptance criteria
Description
Add the ability to automatically capture screenshots during test execution and include them in generated reports. This is particularly useful for GUI testing workflows where visual evidence is required for validation.
Current behavior
Expected behavior
Implementation ideas
QScreen.grabWindow()orPillow.ImageGrabfor cross-platform screenshots.# guitest: screenshotdirective to trigger capture at specific points.auto_screenshotoption inmoduletester.ini:on_failure,on_completion,never..moduletester/screenshots/<test_name>_<timestamp>.png.Acceptance criteria