Skip to content

test: stabilize swap deeplink smoke after sendToHome on iOS#29523

Open
davibroc wants to merge 6 commits intomainfrom
fix/swap-deeplink-tests
Open

test: stabilize swap deeplink smoke after sendToHome on iOS#29523
davibroc wants to merge 6 commits intomainfrom
fix/swap-deeplink-tests

Conversation

@davibroc
Copy link
Copy Markdown
Contributor

@davibroc davibroc commented Apr 29, 2026

Description

On iOS<16, Detox’s device.sendToHome() brings the home screen to the front. On iOS 16 and later, that path is not used the same way from the simulator tooling, so Detox instead launches and immediately quits the Settings app to put the app under test in the background. That can briefly show Settings and race the next step.

This PR tightens tests/smoke/swap/swap-deeplink-smoke.spec.ts: a 1 second wait after sendToHome() before launchApp({ url }), newInstance: false on those launchApp calls so the flow is clearly “same app instance, URL delivered after background,” and short comments above each wait explaining the pre‑16 vs 16+ behavior.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: changes are confined to Detox E2E test helpers/specs and only adjust timing, timeouts, and debug logging to reduce flakiness.

Overview
Improves swap E2E stability and debuggability.

In swap-deeplink-smoke.spec.ts, adds a 1s pause after device.sendToHome() (to avoid iOS 16+ Settings-app flicker/races) and launches deeplinks with newInstance: false so the URL is delivered to the existing app instance.

In swap-unified-ui.ts, adds createLogger debug timings around waits for the network fee label and confirmSwap, and sets explicit timeouts for the confirm button visibility check.

Reviewed by Cursor Bugbot for commit 1c2f392. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@davibroc davibroc added team-qa QA team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Apr 29, 2026
Comment thread tests/smoke/swap/swap-deeplink-smoke.spec.ts
@davibroc davibroc force-pushed the fix/swap-deeplink-tests branch from 7decf0f to 8875385 Compare April 29, 2026 21:19
@github-actions github-actions Bot added size-S and removed size-XS labels Apr 29, 2026
Comment thread tests/smoke/swap/swap-deeplink-smoke.spec.ts Outdated
Comment thread tests/smoke/swap/swap-deeplink-smoke.spec.ts
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3533884. Configure here.

Comment thread tests/smoke/swap/swap-deeplink-smoke.spec.ts Outdated
@davibroc davibroc changed the title test(smoke): stabilize swap deeplink smoke after sendToHome on iOS test: stabilize swap deeplink smoke after sendToHome on iOS Apr 30, 2026
@davibroc davibroc force-pushed the fix/swap-deeplink-tests branch from 3533884 to 10d9d3f Compare April 30, 2026 05:23
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
12 value mismatches detected (expected — fixture represents an existing user).
View details

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeSwap, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
Both changed files are purely within the E2E test infrastructure for swap flows:

  1. tests/helpers/swap/swap-unified-ui.ts: Adds debug timing logging (using createLogger) and increases the confirmSwap visibility timeout from default to 30 seconds. This is a test reliability improvement - no app code changes. The helper is used by swap smoke and regression tests.

  2. tests/smoke/swap/swap-deeplink-smoke.spec.ts: Fixes iOS 16+ compatibility by adding a 1-second delay after sendToHome() before launchApp({ url }), and sets newInstance: false to prevent opening a new app instance. This addresses a known Detox/iOS 16+ issue where sendToHome briefly opens Settings.

Tag selection rationale:

  • SmokeSwap: Directly affected - both files are swap test files. The deeplink smoke spec is tagged under SmokeSwap, and the helper is used by swap smoke tests.
  • SmokeConfirmations: Per SmokeSwap tag description, "When selecting SmokeSwap, also select SmokeConfirmations (transaction confirmations are part of the flow)."

No other tags are warranted since:

  • No app source code was changed
  • No controller, Engine, or core module changes
  • No navigation, modal, or shared component changes
  • Changes are isolated to swap test infrastructure only

Performance Test Selection:
No app source code changes were made. Both files are purely E2E test infrastructure (test helpers and test specs). There are no changes to UI components, state management, data loading, or any code path that could affect app performance metrics.

View GitHub Actions results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-S team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant