Skip to content

Commit 0d6c575

Browse files
perf(e2e): wait for the screen to settle instead of sleeping before screenshots
20 flows waited before takeScreenshot by watching for text that by design never appears, with optional: true: - extendedWaitUntil: visible: randText # Any random text that does not exist in the UI optional: true timeout: 15000 That is a sleep, not a wait. It ALWAYS burns the full timeout (it can never succeed early) and never confirms the UI settled, so it is both slow and flaky. It cost 325s (5.4 min) per full run PER PLATFORM, and still was not enough: a bottom-sheet screenshot came in at 14.7% similarity against a 95% threshold because the sheet was mid-expand when captured, then passed on retry. Replace with waitForAnimationToEnd, which polls until the screen stops changing -- returning as soon as the image decode / sheet animation finishes, and still capping at the timeout. Already used by animation-native, so no new concept. Each site keeps its existing timeout as the cap, so no flow gets a smaller budget than before; the saving comes from returning early rather than from lowering the ceiling. Verified: no randText remains anywhere, all 82 flow files parse, every waitForAnimationToEnd has a timeout, all 20 timeouts carried over unchanged, and the assertVisible count is unchanged (99) so no real assertion was dropped along with the stale comments. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 47a135e commit 0d6c575

20 files changed

Lines changed: 99 additions & 99 deletions

File tree

packages/pluggableWidgets/background-image-native/e2e/specs/maestro/BgImage_dynamic_image.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ appId: "${APP_ID}"
1313
text: "Background image"
1414
- tapOn:
1515
text: "Dynamic image"
16-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
17-
- extendedWaitUntil:
18-
visible: randText # Any random text that does not exist in the UI
19-
optional: true # This should be true so that the test won't fail
20-
timeout: 30000 # 15 seconds
16+
# Wait for the screen to stop changing (image decode / sheet animation)
17+
# rather than sleeping a fixed time: this returns as soon as the UI
18+
# settles, and still caps at 30s.
19+
- waitForAnimationToEnd:
20+
timeout: 30000
2121
- takeScreenshot:
2222
path: "maestro/images/actual/${PLATFORM}/bg_image_dynamic_image"
2323
- assertScreenshot:

packages/pluggableWidgets/background-image-native/e2e/specs/maestro/BgImage_dynamic_svg.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ appId: "${APP_ID}"
1313
text: "Background image"
1414
- tapOn:
1515
text: "Dynamic SVG image"
16-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
17-
- extendedWaitUntil:
18-
visible: randText # Any random text that does not exist in the UI
19-
optional: true # This should be true so that the test won't fail
20-
timeout: 15000 # 15 seconds
16+
# Wait for the screen to stop changing (image decode / sheet animation)
17+
# rather than sleeping a fixed time: this returns as soon as the UI
18+
# settles, and still caps at 15s.
19+
- waitForAnimationToEnd:
20+
timeout: 15000
2121
- takeScreenshot:
2222
path: "maestro/images/actual/${PLATFORM}/bg_image_dynamic_svg"
2323
- assertScreenshot:

packages/pluggableWidgets/background-image-native/e2e/specs/maestro/BgImage_layout_grid.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ appId: "${APP_ID}"
1414
- tapOn:
1515
text: "Layout grid"
1616
- assertVisible: "Layout grid"
17-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
18-
- extendedWaitUntil:
19-
visible: randText # Any random text that does not exist in the UI
20-
optional: true # This should be true so that the test won't fail
21-
timeout: 15000 # 15 seconds
17+
# Wait for the screen to stop changing (image decode / sheet animation)
18+
# rather than sleeping a fixed time: this returns as soon as the UI
19+
# settles, and still caps at 15s.
20+
- waitForAnimationToEnd:
21+
timeout: 15000
2222
- takeScreenshot:
2323
path: "maestro/images/actual/${PLATFORM}/bg_image_layout_grid"
2424
- assertScreenshot:

packages/pluggableWidgets/background-image-native/e2e/specs/maestro/BgImage_nested.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ appId: "${APP_ID}"
1414
- tapOn:
1515
text: "Nested"
1616
- assertVisible: "Nested"
17-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
18-
- extendedWaitUntil:
19-
visible: randText # Any random text that does not exist in the UI
20-
optional: true # This should be true so that the test won't fail
21-
timeout: 15000 # 15 seconds
17+
# Wait for the screen to stop changing (image decode / sheet animation)
18+
# rather than sleeping a fixed time: this returns as soon as the UI
19+
# settles, and still caps at 15s.
20+
- waitForAnimationToEnd:
21+
timeout: 15000
2222
- takeScreenshot:
2323
path: "maestro/images/actual/${PLATFORM}/bg_image_nested"
2424
- assertScreenshot:

packages/pluggableWidgets/background-image-native/e2e/specs/maestro/BgImage_static_images.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ appId: "${APP_ID}"
1515
text: "Static images"
1616
- assertVisible:
1717
text: "Static images"
18-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
19-
- extendedWaitUntil:
20-
visible: randText # Any random text that does not exist in the UI
21-
optional: true # This should be true so that the test won't fail
22-
timeout: 10000 # 10 seconds
18+
# Wait for the screen to stop changing (image decode / sheet animation)
19+
# rather than sleeping a fixed time: this returns as soon as the UI
20+
# settles, and still caps at 10s.
21+
- waitForAnimationToEnd:
22+
timeout: 10000
2323
- takeScreenshot:
2424
path: "maestro/images/actual/${PLATFORM}/bg_image_static_images"
2525
- assertScreenshot:

packages/pluggableWidgets/bar-chart-native/e2e/specs/maestro/Bar_Chart.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ appId: "${APP_ID}"
1515
text: "Bar chart"
1616
- assertVisible:
1717
id: "container1"
18-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
19-
- extendedWaitUntil:
20-
visible: randText # Any random text that does not exist in the UI
21-
optional: true # This should be true so that the test won't fail
22-
timeout: 15000 # 15 seconds
18+
# Wait for the screen to stop changing (image decode / sheet animation)
19+
# rather than sleeping a fixed time: this returns as soon as the UI
20+
# settles, and still caps at 15s.
21+
- waitForAnimationToEnd:
22+
timeout: 15000
2323
- takeScreenshot:
2424
path: "maestro/images/actual/${PLATFORM}/bar_chart"
2525
- assertScreenshot:

packages/pluggableWidgets/bottom-sheet-native/e2e/specs/maestro/Bottom_sheet_expanding.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ appId: "${APP_ID}"
1313
text: "Bottom Sheet"
1414
- tapOn:
1515
text: "Expanding"
16-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
17-
- extendedWaitUntil:
18-
visible: randText # Any random text that does not exist in the UI
19-
optional: true # This should be true so that the test won't fail
20-
timeout: 10000 # 10 seconds
16+
# Wait for the screen to stop changing (image decode / sheet animation)
17+
# rather than sleeping a fixed time: this returns as soon as the UI
18+
# settles, and still caps at 10s.
19+
- waitForAnimationToEnd:
20+
timeout: 10000
2121
- takeScreenshot:
2222
path: "maestro/images/actual/${PLATFORM}/bottom_sheet_expanding"
2323
- assertScreenshot:

packages/pluggableWidgets/bottom-sheet-native/e2e/specs/maestro/Botton_sheet_expanding_fullscreen.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ appId: "${APP_ID}"
1313
text: "Bottom Sheet"
1414
- tapOn:
1515
text: "Expanding fullscreen"
16-
# Because the image loading and animation can take some time due to resources on emulator, we need to wait
17-
- extendedWaitUntil:
18-
visible: randText # Any random text that does not exist in the UI
19-
optional: true # This should be true so that the test won't fail
20-
timeout: 15000 # 15 seconds to allow for animation to complete
16+
# Wait for the screen to stop changing (image decode / sheet animation)
17+
# rather than sleeping a fixed time: this returns as soon as the UI
18+
# settles, and still caps at 15s.
19+
- waitForAnimationToEnd:
20+
timeout: 15000
2121
- takeScreenshot:
2222
path: "maestro/images/actual/${PLATFORM}/bottom_sheet_expanding_fullscreen"
2323
- assertScreenshot:

packages/pluggableWidgets/bottom-sheet-native/e2e/specs/maestro/Modal_basic_non_native.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ appId: "${APP_ID}"
2020
- tapOn:
2121
text: "Open"
2222

23-
# Wait until the sheet is actually open (button label changes)
24-
- extendedWaitUntil:
25-
visible: randText
26-
optional: true
23+
# Wait for the screen to stop changing (image decode / sheet animation)
24+
# rather than sleeping a fixed time: this returns as soon as the UI
25+
# settles, and still caps at 25s.
26+
- waitForAnimationToEnd:
2727
timeout: 25000
2828

2929
- takeScreenshot:

packages/pluggableWidgets/bottom-sheet-native/e2e/specs/maestro/Modal_custom.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ appId: "${APP_ID}"
1515
text: "Modal custom"
1616
- tapOn:
1717
text: "Open"
18-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
19-
- extendedWaitUntil:
20-
visible: randText # Any random text that does not exist in the UI
21-
optional: true # This should be true so that the test won't fail
22-
timeout: 5000 # 5 seconds
18+
# Wait for the screen to stop changing (image decode / sheet animation)
19+
# rather than sleeping a fixed time: this returns as soon as the UI
20+
# settles, and still caps at 5s.
21+
- waitForAnimationToEnd:
22+
timeout: 5000
2323
- takeScreenshot:
2424
path: "maestro/images/actual/${PLATFORM}/bottom_sheet_modal_custom"
2525
- assertScreenshot:

0 commit comments

Comments
 (0)