Closed hbatagelo closed 5 months ago
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
b38a64f
) 64.64% compared to head (2e7aa1b
) 64.46%.
Files | Patch % | Lines |
---|---|---|
mir-ci/mir_ci/screencopy_tracker.py | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've changed grab_screenshot
to look for the next frame (this will fix issue #66) and have added the timeout. Seems to work well.
This PR proposes a Robot library (
Screencopy.py
) that provides keywords for matching image templates with frames captured from the Wayland display. The keywords are:Test Match [template]
: Grabs a screenshot and checks for a match with a given template. The result is a list of matching regions, each represented as a dictionary withleft
,top
,right
, andbottom
keys.Wait Match [template] [timeout]
: Grabs a screenshot and waits until there is a match. The result is a list of matching regions.For both, if no match is found, an exception is raised, and the screenshot and the template are written to the Robot log.
The following additional keywords are available in
screencopy.resource
:Get Center [region]
: Calculates the center of a region. The return value is a point (a dictionary withx
andy
keys).Add Displacement [point] [displacement_x] [displacement_y]
: Adds a displacement to the given point. The return value is also a point.An example of these keywords in action is given in
test_drag_and_drop.py
.