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.
This commit is contained in:
Davide Depau committed 2026-08-16 19:40:49 +02:00
1 parent 6d0fa6b0c2
commit 99965a7f3c
1 file changed
+6 -1
+6 -1
View File
@@ -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: