From d93f47ef53259cc1b84e54f27476e238d2881d13 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Thu, 11 Apr 2024 16:18:23 +0200 Subject: [PATCH] Remove _wait_for_text_on_screen_or_not hotfix following proper fix in Speculos --- CHANGELOG.md | 3 +++ src/ragger/backend/speculos.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7b1b3e3..078d24b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Speculos backend: if not specified, availability of API and APDU ports are checked to avoid collision - navigator: New pytest fixture to navigate by scenario to simplify classic navigation operations +### Fixed +- Speculos backend: Properly fixed internal snapshot state desync compare screen with text + ## [1.16.3] - 2024-04-05 ### Fixed diff --git a/src/ragger/backend/speculos.py b/src/ragger/backend/speculos.py index a4340094..ea820874 100644 --- a/src/ragger/backend/speculos.py +++ b/src/ragger/backend/speculos.py @@ -261,10 +261,11 @@ def _wait_for_text_on_screen_or_not(self, # Only manual ticks sent by compare_screen_with_text in this function because # we don't want a desync between screen and events self.pause_ticker() + # Save current snapshot in case its content already matches and we never + # call wait_for_screen_change + self._last_screenshot = BytesIO(self._client.get_screenshot()) while True: if self.compare_screen_with_text(text) == should_be_on_screen: - # TODO: investigate while this line is needed.. It should not be - self._last_screenshot = BytesIO(self._client.get_screenshot()) self.resume_ticker() return else: