diff --git a/CHANGELOG.md b/CHANGELOG.md index eec4a626..b7f660bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.11.5] - 2023-09-27 + +### Changed: +- backend/speculos - navigator: Allow navigation screen content comparison with regex. + ## [1.11.4] - 2023-07-31 ### Changed: diff --git a/src/ragger/backend/speculos.py b/src/ragger/backend/speculos.py index 6520fdc3..0b12521b 100644 --- a/src/ragger/backend/speculos.py +++ b/src/ragger/backend/speculos.py @@ -19,7 +19,7 @@ from PIL import Image from typing import Optional, Generator from time import time, sleep -from json import dumps +from re import match from speculos.client import SpeculosClient, screenshot_equal, ApduResponse, ApduException from speculos.mcu.seproxyhal import TICKER_DELAY @@ -214,7 +214,10 @@ def get_current_screen_content(self) -> dict: return self._retrieve_client_screen_content() def compare_screen_with_text(self, text: str) -> bool: - return text in dumps(self._retrieve_client_screen_content()) + for event in self._retrieve_client_screen_content()["events"]: + if match(text, event.get("text", "")): + return True + return False def wait_for_screen_change(self, timeout: float = 10.0) -> None: screenshot = BytesIO(self._client.get_screenshot())