Skip to content

Add UI tests for refresh token rotation#4035

Open
wmathurin wants to merge 4 commits into
forcedotcom:devfrom
wmathurin:ui_tests_rtr
Open

Add UI tests for refresh token rotation#4035
wmathurin wants to merge 4 commits into
forcedotcom:devfrom
wmathurin:ui_tests_rtr

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

Summary

  • Adds RTRLoginTests — 8 UI tests covering ECA apps with Refresh Token Rotation (RTR) enabled, across hybrid/non-hybrid flows and with/without app restart
  • assertRevokeAndRefreshWorks now asserts the refresh token rotates after a revoke/refresh cycle for RTR apps, and stays stable for non-RTR apps
  • Adds ecaOpaqueRtr and ecaJwtRtr to KnownAppConfig and AppConfig.isRtr computed property in UITestConfigUtils
  • Updates ui_test_config.json.sample with the two new RTR app entries
  • Updates overview.md to document the new test class and app configs

Known failures — W-22512846

testECAJwtRtr_Hybrid and testECAJwtRtr_Hybrid_WithRestart are expected to fail until W-22512846 (Enable Named JWTs for Hybrid Flows) is resolved on the server side.

The server currently returns invalid_grant when RTR is used with JWT-based access tokens in hybrid flow. The four non-hybrid and opaque RTR tests are expected to pass.

wmathurin added 3 commits May 15, 2026 14:12
- Add eca_jwt_rtr and eca_opaque_rtr to KnownAppConfig enum in UITestConfigUtils
- Add AppConfig.isRtr computed property (mirrors issuesJwt pattern)
- Add RTRLoginTests: 8 tests covering hybrid/no-hybrid × jwt/opaque RTR apps, with and without app restart
- assertRevokeAndRefreshWorks now asserts refresh token rotates for RTR apps and stays stable for non-RTR apps
- Update ui_test_config.json.sample with eca_jwt_rtr and eca_opaque_rtr entries
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^26 Test Results631 ran628 ✅3 ❌
TestResult
SalesforceSDKCore iOS ^26 Test Results
testMissingMyDomain()❌ failure
SalesforceRestAPITests.testCollectionDelete❌ failure
SalesforceRestAPITests.testCreateQuerySearchDelete❌ failure

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

TestsPassedSkippedFailed ❌️
AuthFlowTester UI Test Results all1 ran1 ❌
TestResult
AuthFlowTester UI Test Results all
AuthFlowTesterUITests.xctest
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow()❌ failure

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

TestsPassed ✅SkippedFailed
SalesforceSDKCore iOS ^18 Test Results631 ran631 ✅
TestResult
No test annotations available

Add a second revoke/refresh cycle at the end of each _WithRestart RTR
test to confirm the new refresh token saved after restart is functional.
Expose assertRevokeAndRefreshWorks(isRtr:) as an internal helper on
BaseAuthFlowTester to allow subclasses to call it directly.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.58%. Comparing base (6ed0ab4) to head (2140b27).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4035      +/-   ##
==========================================
- Coverage   70.47%   66.58%   -3.89%     
==========================================
  Files         245      245              
  Lines       21457    21457              
==========================================
- Hits        15121    14287     -834     
- Misses       6336     7170     +834     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 70.69% <ø> (-0.75%) ⬇️
Core 59.15% <ø> (-5.98%) ⬇️
SmartStore 73.44% <ø> (ø)
MobileSync 88.79% <ø> (ø)
see 36 files with indirect coverage changes
🚀 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants