Skip to content

test: add mouse positioning helpers for tray icon - #169

Merged
ReenigneArcher merged 4 commits into
masterfrom
test/position-mouse
Jul 28, 2026
Merged

test: add mouse positioning helpers for tray icon#169
ReenigneArcher merged 4 commits into
masterfrom
test/position-mouse

Conversation

@ReenigneArcher

Copy link
Copy Markdown
Member

Description

Add tray_position_mouse_over_icon() and tray_restore_mouse_position() C API functions, backed by QtTrayMenu methods, to move and restore the cursor during testing. Use these in tests on GitHub Actions where mouse position matters for tray menu screenshots.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Add tray_position_mouse_over_icon() and tray_restore_mouse_position() C API functions, backed by QtTrayMenu methods, to move and restore the cursor during testing. Use these in tests on GitHub Actions where mouse position matters for tray menu screenshots.
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.15789% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.74%. Comparing base (cedbffd) to head (61946bb).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/QtTrayMenu.cpp 63.07% 15 Missing and 9 partials ⚠️
src/tray_qt.cpp 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   61.50%   61.74%   +0.24%     
==========================================
  Files           5        5              
  Lines         439      515      +76     
  Branches      159      194      +35     
==========================================
+ Hits          270      318      +48     
- Misses        110      135      +25     
- Partials       59       62       +3     
Flag Coverage Δ
Linux-qt5 58.22% <56.06%> (-0.44%) ⬇️
Linux-qt6 58.22% <56.06%> (-0.44%) ⬇️
Windows-qt6 56.07% <40.90%> (-2.59%) ⬇️
macOS-qt6 55.53% <49.33%> (-1.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/QtTrayMenu.h 100.00% <100.00%> (ø)
src/tray_qt.cpp 64.39% <60.00%> (-0.37%) ⬇️
src/QtTrayMenu.cpp 67.58% <63.07%> (-1.31%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cedbffd...61946bb. Read the comment docs.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Last Updated 2026-07-28 20:15:41 UTC
Source Run CI Run #749
Commit 61946bba876c014664ad2ff3c16c2a090af68e5e

Screenshot Comparison

PR #169 screenshots vs screenshots baseline.

Matrix: Linux-qt5

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png

Matrix: Linux-qt6

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png

Matrix: Windows-qt6

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png

Matrix: macOS-qt6

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png

Improve mouse positioning for tray interactions when tray icon geometry is unavailable by deriving a fallback target from screen/panel edges, with platform-specific defaults. Also make cursor position/restore validation tolerant to small movement offsets instead of exact pixel matches. Unit tests were updated to avoid hard-failing on CI cursor positioning and only require restore success when positioning succeeded.
Updates CI on macOS to fully configure screen recording by writing replayd approval data, restarting replayd, and clarifying step messaging. In QtTrayMenu, adds a bounded cursor-position wait loop with polling and timeout so mouse move/restore checks are more reliable instead of relying on a single immediate position read.
Extend the GitHub Actions notification readiness workaround to also apply on macOS, not just Windows.
@sonarqubecloud

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit ea38a63 into master Jul 28, 2026
18 checks passed
@ReenigneArcher
ReenigneArcher deleted the test/position-mouse branch July 28, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant