diff --git a/mir-ci/mir_ci/tests/robot/platforms/wayland/Screencopy.py b/mir-ci/mir_ci/tests/robot/platforms/wayland/Screencopy.py index 9ea685b6..af50676d 100644 --- a/mir-ci/mir_ci/tests/robot/platforms/wayland/Screencopy.py +++ b/mir-ci/mir_ci/tests/robot/platforms/wayland/Screencopy.py @@ -50,9 +50,9 @@ async def match(self, template: str, timeout: int = 5) -> List[dict]: last_checked_frame_count = 0 screenshot = None while time.time() <= end_time: - screenshot = await asyncio.wait_for(self.grab_screenshot(), timeout) - if last_checked_frame_count != self.frame_count: - last_checked_frame_count = self.frame_count + frame_count, screenshot = await asyncio.wait_for(self.grab_screenshot(), timeout) + if last_checked_frame_count != frame_count: + last_checked_frame_count = frame_count try: regions = self._rpa_images.find_template_in_image( screenshot, @@ -82,7 +82,7 @@ async def grab_screenshot(self): """ Grabs the current frame tracked by the screencopy tracker. - :return Pillow Image of the frame + :return Tuple (frame count, Pillow Image of the frame) """ await self.connect() @@ -100,7 +100,7 @@ async def grab_screenshot(self): b, g, r, a, *_ = image.split() image = Image.merge("RGBA", (r, g, b, a)) - return image + return (self.frame_count, image) async def connect(self): """Connect to the display."""