From 2605ba04ce23a3de1095af74cbbae1716178fcdc Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Sun, 16 Aug 2026 19:40:54 +0200 Subject: [PATCH] fix(appium-tests): re-find the notifications button after the permission dialog Returning from the system dialog recomposes the banner, so the saved element reference is stale by the time it is clicked again. --- appium-tests/tests/test_generic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/appium-tests/tests/test_generic.py b/appium-tests/tests/test_generic.py index afded40..b8c8222 100644 --- a/appium-tests/tests/test_generic.py +++ b/appium-tests/tests/test_generic.py @@ -70,7 +70,13 @@ def test_accept_then_deny_notifications(driver: appium.webdriver.Remote, usb_wri ) deny_btn.click() sleep(0.5) - sure_btn.click() + # Re-find rather than reusing sure_btn: returning from the permission dialog + # recomposes the banner, which makes the old reference stale. + wait_for_element( + driver, + '//*[@resource-id="notifications_enable_button"]', + timeout=5, + ).click() enable_switch = wait_for_element( driver,