Simulate Welcome Discovery for UI Tests#2907
Conversation
…oid into feature/welcome-discovery-ui-tests # Conflicts: # native/NativeSampleApps/AuthFlowTester/src/androidTest/java/com/salesforce/samples/authflowtester/pageObjects/LoginPageObject.kt
Generated by 🚫 Danger |
Job Summary for GradlePull Request :: test-android |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #2907 +/- ##
============================================
+ Coverage 66.41% 66.52% +0.11%
- Complexity 3099 3105 +6
============================================
Files 226 226
Lines 17774 17871 +97
Branches 2327 2339 +12
============================================
+ Hits 11804 11889 +85
- Misses 4896 4897 +1
- Partials 1074 1085 +11
🚀 New features to boost your workflow:
|
|
On iOS, if you just run the AuthFlowTester it won't show the view to simulate a domain discovery. Is it the same on Android or is it always shown? |
It is always shown. I can look into changing it to only show for UI Tests. Edit: Done. |
| // the process as UI-testing (and only in debug builds, enforced by the setter). | ||
| // Mirrors iOS' IS_UI_TESTING gate in LoginOptionsViewController.swift. | ||
| val sdkManager = SalesforceSDKManager.getInstance() | ||
| if (sdkManager.isDebugBuild && sdkManager.isUiTesting) { |
There was a problem hiding this comment.
| This method should only be accessed from tests or within private scope |
This work mirrors the iOS
DiscoveryResultEditor+WelcomeLoginTests. Adds a debug-only Login Options toggle that injects a simulatedlogin_hint+my_domain, letting tests drive the Welcome Discovery flow without the email round-trip and allow-listed consumer key.Changes:
SalesforceSDKManager.simulatedDiscoveryResult(debug-gated setter + consumer);LoginActivity.applySimulatedDiscoveryResultIfApplicablehooksswitchDefaultOrSalesforceWelcomeDiscoveryLoginto dispatch the same Intent the realsfdc://discocallbackhandler produces; newDiscoveryResultEditorCompose composable in Login Options.sf__login_options_discovery_*(translatable="false");sf__login_options_save_and_loginreplaces "Save" on the boot-config button (it closes the screen).LoginOptionsunit tests, 2 AuthFlowTester instrumented WelcomeLoginTests (regular_auth, advanced_auth).