Skip to content

fix(test): stabilize postMessage toast E2E test on iOS - #416

Merged
artus9033 merged 1 commit into
mainfrom
test/stabilize-e2e-apple
Jul 7, 2026
Merged

fix(test): stabilize postMessage toast E2E test on iOS#416
artus9033 merged 1 commit into
mainfrom
test/stabilize-e2e-apple

Conversation

@artus9033

Copy link
Copy Markdown
Collaborator

Summary

E2E Apple toast test is flaky. The hypothesis is a race in sendPostMessageToNativeAndWaitForToast.

The helper taps "Send message to Native", then spent up to 15 seconds polling for the RN message bubble before checking for the native toast. In E2E mode the toast only stays visible for ~10 seconds (Toast.swift), and the Expo bubble can be slow to surface (Fabric accessibility + 300ms fade-in animation). So the toast often gets dismissed before the test would look for it.

Test plan

CI green

Copilot AI review requested due to automatic review settings July 6, 2026 11:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to stabilize the iOS E2E “postMessage shows native toast” scenario by avoiding a race where the test waits too long for the RN bubble and only then checks for a toast that is short-lived in E2E mode.

Changes:

  • Updated AppleApp (Vanilla + Expo) E2E specs to call sendPostMessageToNativeAndWaitForToast() without a message regex argument.
  • Reworked sendPostMessageToNativeAndWaitForToast to tap with Detox synchronization disabled and to assert the native toast before checking RN UI state.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
apps/brownfield-example-shared-tests/e2e/appleAppExpoBrownfield.e2e.js Updates the Expo AppleApp toast test to use the new helper signature.
apps/brownfield-example-shared-tests/e2e/appleAppDetoxUtils.cjs Adjusts the helper to prioritize toast visibility and reduces sync-related flakiness around the tap.
apps/brownfield-example-shared-tests/e2e/appleAppBrownfield.e2e.js Updates the Vanilla AppleApp toast test to use the new helper signature.
Comments suppressed due to low confidence (1)

apps/brownfield-example-shared-tests/e2e/appleAppDetoxUtils.cjs:280

  • sendPostMessageToNativeAndWaitForToast no longer verifies that the RN postMessage bubble ever appears. That makes the toast assertion easier to satisfy even if the postMessage didn’t land (and in the Vanilla AppleApp suite there isn’t another test that checks the bubble). Since the toast is now asserted first, you can safely add a follow-up wait for the RN bubble after the toast without reintroducing the original race.
  await waitForNativeOverlayVisible(
    by.id(ids.appleAppPostMessageToast),
    DETOX_TIMING.TOAST_VISIBILITY_TIMEOUT_MS
  );
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@artus9033
artus9033 requested a review from hurali97 July 7, 2026 08:04
@artus9033
artus9033 merged commit 2b9e721 into main Jul 7, 2026
27 checks passed
@artus9033
artus9033 deleted the test/stabilize-e2e-apple branch July 7, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants