Skip to content

Conversation

@sumeruchat
Copy link
Contributor

@sumeruchat sumeruchat commented Jan 9, 2026

What This Does

Implements comprehensive deep link testing for the BCIT framework. Tests validate the complete flow from external sources (simulated via Reminders app) into the app, covering URL routing, custom actions, and the critical single-redirect policy.

Key Features

1. External Source Testing

  • Uses Reminders app to simulate real-world deep link flows (email/SMS)
  • Tests wrapped links from links.tsetester.com that unwrap to destination URLs
  • Validates SDK properly receives and processes universal links

2. Single Redirect Policy Validation

  • Critical GreenFi Bug Fix: Validates SDK follows exactly ONE redirect, not multiple
  • Uses Network Monitor to verify redirect behavior
  • Ensures SDK stops at first redirect destination (not following multi-hop redirects)
  • Implementation: RedirectNetworkSession.willPerformHTTPRedirection returns nil to stop URLSession from following additional redirects

3. Update Screen Navigation

  • New UpdateViewController displays when links navigate to /update/* paths
  • Shows confirmation that deep link flow completed successfully with timestamp and path info
  • Used for validating end-to-end routing vs just showing alerts

4. Comprehensive Test Coverage

  • ✅ Open URL routing to URL delegate
  • ✅ Custom action routing to custom action delegate
  • ✅ Browser links open Safari (not app)
  • ✅ Alert validation for each link type
  • ✅ Network Monitor validation of redirect counts

Testing

func testABrowserLinksOpenSafari() - Browser links don't open app
func testBDeepLinkFromRemindersApp()  - Primary test using Jena's test link
func testCCustomActionHandling()  - Custom actions trigger properly
func testDSingleRedirectPolicy()  - Validates GreenFi bug fix (single redirect only)

Tests use alphabetical prefixes (A, B, C, etc.) to control execution order.

Notes

  • Uses real domain (tsetester.com) with actual AASA file - no mocking
  • Alert-based validation for simpler, more reliable testing vs actual screen navigation
  • Network Monitor integration provides visibility into SDK's network behavior
  • Early SDK initialization in AppDelegate ensures SDK is ready when universal links arrive

Related Tickets

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.74%. Comparing base (a5134b6) to head (5d3816c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #993      +/-   ##
==========================================
+ Coverage   69.72%   69.74%   +0.01%     
==========================================
  Files         111      111              
  Lines        8981     8983       +2     
==========================================
+ Hits         6262     6265       +3     
+ Misses       2719     2718       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants