Skip to content

Add UI tests for refresh token rotation#2888

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

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

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

@wmathurin wmathurin commented May 15, 2026

Summary

  • Adds `RTRLoginTests` — 4 UI tests covering ECA apps with Refresh Token Rotation (RTR) enabled, across hybrid/non-hybrid flows
  • `assertRevokeAndRefreshWorks(isRtr)` added to `AuthFlowTest` base class: asserts the refresh token rotates after a revoke/refresh cycle for RTR apps, and stays stable for non-RTR apps
  • Adds `ECA_OPAQUE_RTR` and `ECA_JWT_RTR` to `KnownAppConfig` and `AppConfig.isRtr` property in `UITestConfig`
  • Updates `ui_test_config.json.sample` with the two new RTR app entries
  • Updates `README.md` to document the new test class and app configs

Known failures — W-22512846

`testECAJwtRtr_Hybrid` is 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 three remaining tests (opaque hybrid, jwt no-hybrid, opaque no-hybrid) are expected to pass.

Notes

This is the Android equivalent of iOS PR #4035. The restart variants (`_WithRestart`) are omitted — Android does not currently have an equivalent of iOS's `restartAndValidateUser` infrastructure.

wmathurin added 2 commits May 15, 2026 15:49
- Add ECA_OPAQUE_RTR and ECA_JWT_RTR to KnownAppConfig enum in UITestConfig
- Add AppConfig.isRtr property (mirrors issuesJwt pattern)
- Add assertRevokeAndRefreshWorks(isRtr) to AuthFlowTest base class: asserts refresh token rotates for RTR apps and stays stable for non-RTR apps
- Add RTRLoginTests: 4 non-restart tests covering hybrid/no-hybrid × jwt/opaque RTR apps
- Update ui_test_config.json.sample with eca_jwt_rtr and eca_opaque_rtr entries
- Update README.md with RTRLoginTests section and updated app config list
@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 55.11%. Comparing base (59fe3d9) to head (d1a0222).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #2888      +/-   ##
============================================
- Coverage     55.13%   55.11%   -0.02%     
- Complexity     2495     2505      +10     
============================================
  Files           226      226              
  Lines         17722    17781      +59     
  Branches       2311     2328      +17     
============================================
+ Hits           9771     9800      +29     
- Misses         6955     6974      +19     
- Partials        996     1007      +11     
Components Coverage Δ
Analytics 48.71% <ø> (ø)
SalesforceSDK 41.88% <50.00%> (+0.09%) ⬆️
Hybrid 59.30% <ø> (ø)
SmartStore 78.22% <ø> (ø)
MobileSync 82.12% <ø> (+0.01%) ⬆️
React 50.54% <ø> (-0.96%) ⬇️
see 13 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce left a comment

Choose a reason for hiding this comment

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

👍🏻

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