From 99965a7f3c40792c19bf6e235fd57fcfe735cd2b Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Sun, 16 Aug 2026 19:40:49 +0200 Subject: [PATCH] fix(appium-tests): don't let the lay-flat wait eat the write phase On CI the sheet auto-proceeds -- the emulated gravity sensor reads flat and the job starts on its own -- so waiting the full timeout for a button that is already gone burned 15-30s of a ~28s job. The test then went looking for a write phase that had already finished, which is why the unplug tests failed while their job ran to a clean FINISHED. Wait briefly instead: confirm_write_image already established that the sheet was up, so the button is either there now or the job is running. --- appium-tests/etchdroid/actions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appium-tests/etchdroid/actions.py b/appium-tests/etchdroid/actions.py index 84eabd6..453b9a5 100644 --- a/appium-tests/etchdroid/actions.py +++ b/appium-tests/etchdroid/actions.py @@ -96,9 +96,14 @@ def skip_lay_flat_sheet(driver: Remote): # the flow has already moved on. A stale click, however, must be retried: it just # means the sheet moved under the tap while animating in, and if the sensor never # reads flat (CI), nobody else will ever fire the sheet's onReady. + # Short wait on purpose: confirm_write_image already established that the sheet is + # up, so the button is there now or it auto-proceeded and the job is already running. + # Waiting the full timeout here eats the write phase the caller is about to look for. for _ in range(3): try: - lay_flat_skip_btn = wait_for_element(driver, '//android.widget.TextView[@resource-id="layFlatSkipButton"]') + lay_flat_skip_btn = wait_for_element( + driver, '//android.widget.TextView[@resource-id="layFlatSkipButton"]', timeout=1 + ) lay_flat_skip_btn.click() return except TimeoutException: