Skip to content

fix(test): stabilize E2E tests#388

Open
artus9033 wants to merge 1 commit into
mainfrom
fix/stabilize-e2e-tests
Open

fix(test): stabilize E2E tests#388
artus9033 wants to merge 1 commit into
mainfrom
fix/stabilize-e2e-tests

Conversation

@artus9033

Copy link
Copy Markdown
Collaborator

Summary

This PR stabilizes flaky E2E tests by scrolling the embedded RN surface into view and reloading with Detox sync disabled, so recovery doesn’t hang until the Jest timeout while waiting for an idle app that never settles due to RN debug animations.

Test plan

CI green (few consecutive re-runs of E2E succeed).

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 reduce flakiness in Detox E2E tests by centralizing timing budgets, adding a “reload RN with sync disabled” recovery helper, and using those utilities in AppleApp E2E flows to avoid hangs when RN debug surfaces keep the app non-idle.

Changes:

  • Added shared Detox timing constants (DETOX_TIMING) and reused them for polling/timeout budgets.
  • Introduced reloadReactNativeIgnoringSync() to reload RN without waiting for app idleness.
  • Refactored AppleApp Detox helpers to scroll embedded RN into view and use the new reload + timing utilities.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
apps/brownfield-example-shared-tests/e2e/detoxUtils.cjs Adds sync-ignoring RN reload helper and replaces hardcoded polling delay with shared timing constant.
apps/brownfield-example-shared-tests/e2e/detoxTiming.cjs Introduces centralized timing constants for E2E waits/polling/timeouts.
apps/brownfield-example-shared-tests/e2e/createDetoxJestConfig.cjs Uses centralized test timeout from DETOX_TIMING.
apps/brownfield-example-shared-tests/e2e/appleAppDetoxUtils.cjs Updates AppleApp E2E utilities to scroll + wait using shared timeouts and reload with sync disabled.

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

Comment on lines +1 to 4
const { device, element, by } = require('detox');
const { brownfieldE2eTestIds: ids } = require('@callstack/brownfield-example-shared-tests/e2e/e2eTestIds');
const { DETOX_TIMING } = require('@callstack/brownfield-example-shared-tests/e2e/detoxTiming.cjs');
const {
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.

2 participants