canonical / mir-ci

Mir CI helpers
1 stars 1 forks source link

Interpolate pointer movements #82

Closed hbatagelo closed 5 months ago

hbatagelo commented 5 months ago

Fixes #72.

This PR proposes a keyword to incrementally move the pointer from a specified start position to the center of a matching template:

Walk Pointer From ${point} To Template ${template} ${steps}=0 ${step_sleep}=0

The drag and drop tests have been updated to use Walk Pointer whenever possible, replacing the previous uses of Displace followed by Move Pointer To Absolute. As the final step of the Source and Destination Mismatch test case, the virtual pointer now walks to the "(nothing)" UI label (a label that displays feedback in the match test). This replaces the last Displace ${center} 20 20 of the test case. The UI label has been enlarged in the client application, and a corresponding template has been created (drag_and_drop_end.png).

To support the Walk Pointer, the following auxiliary keywords have been introduced:

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e217e4c) 64.44% compared to head (b503c4c) 64.44%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #82 +/- ## ======================================= Coverage 64.44% 64.44% ======================================= Files 11 11 Lines 734 734 Branches 91 91 ======================================= Hits 473 473 Misses 237 237 Partials 24 24 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

hbatagelo commented 5 months ago

It works locally, but does it pass the CI? That would be great (fixes #67)

Edited: It works!

hbatagelo commented 5 months ago

Now that I'm looking at the keywords... notice that some use embedded arguments, such as Press LEFT Button instead of Press Button LEFT. Walk Pointer uses a mix of embedded and normal arguments. Maybe we should adopt a single style for consistency?

Embedded arguments improve readability and make the expression more concise. OTOH, optional arguments must always follow the keyword.

With normal arguments it would be something like this: Walk Pointer From Position To Template ${position} ${template} ${steps}=0 ${step_sleep}=0

With embedded arguments (and optional arguments): Walk Pointer From ${position} To ${template} ${steps}=0 ${step_sleep}=0

Saviq commented 5 months ago

With embedded arguments (and optional arguments): Walk Pointer From ${position} To ${template} ${steps}=0 ${step_sleep}=0

I like that better. And yeah, Press LEFT Button makes more sense.

Optional arguments are optional, ideally they need not be used (like here - we're down to 4-5 lines).

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (main@42895bc). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #82 +/- ## ======================================= Coverage ? 64.05% ======================================= Files ? 11 Lines ? 740 Branches ? 103 ======================================= Hits ? 474 Misses ? 241 Partials ? 25 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.