-
Notifications
You must be signed in to change notification settings - Fork 1.4k
test: use deeplink authentication #6699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a new Maestro helper that logs in via a deeplink, updates many Maestro test YAMLs to use that helper (some tests now create users first or remove explicit app-launch steps), narrows open-deeplink to iOS, removes a debug log, and tweaks CI artifact upload metadata. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant TestFlow as Test Flow
participant Helper as login-with-deeplink
participant Eval as EvalScript (auth)
participant DeeplinkFlow as open-deeplink (iOS)
participant App as Mobile App
TestFlow->>Helper: runFlow (env: USERNAME/PASSWORD or created user)
Helper->>Eval: evalScript -> perform login (server,userId,authToken)
Eval-->>Helper: login result
Helper->>DeeplinkFlow: runFlow (open constructed deeplink)
DeeplinkFlow->>App: open URL (iOS)
App-->>Helper: permission prompt (if present)
Helper->>App: tap approve -> extendedWaitUntil rooms-list-view
App-->>Helper: rooms-list-view visible
Helper-->>TestFlow: flow complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.maestro/helpers/login-with-deeplink.yaml (1)
7-13: Revisit CLEAR_STATE/stopApp gating;when: true: CLEAR_STATElooks suspect.
- Maestro typically uses
when: { platform: android }and a booleancondition(or similar) for env‑based gating. Please verifytrue: CLEAR_STATEworks as intended.- Prior feedback suggested removing this to let the deeplink open the app. Consider dropping the stop/clear or making it opt‑in.
Example options:
- Keep Android‑only, no env gate:
- when: - true: CLEAR_STATE - platform: android + when: + platform: android
- Or explicitly gate on env (if supported in your setup):
when: - true: CLEAR_STATE platform: android + condition: ${Boolean(CLEAR_STATE)}
🧹 Nitpick comments (1)
.maestro/helpers/login-with-deeplink.yaml (1)
23-38: Tighten Android prompt handling; “Allow” regex is broad and flaky.
- Prefer targeting the permission button by resource id (e.g.,
com.android.permissioncontroller:id/permission_allow_button) and handle variants (“Allow”, “While using the app”, “Allow only this time”).- The “Pixel Launcher” → “Close App” tap is brittle; remove unless there’s a proven crash‑loop case.
Suggested shape:
- Try id‑based tap with short waits; fallback to text variants; all optional.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.maestro/helpers/login-with-deeplink.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: ESLint and Test / run-eslint-and-test
🔇 Additional comments (2)
.maestro/helpers/login-with-deeplink.yaml (2)
39-42: Final wait looks good.Waiting for
rooms-list-viewfor 60s is a solid success signal.
15-18: Open Deep Link already executes on Android
open-deeplink.yamlbegins with an unconditionalopenLinkstep; theplatform: iOSguard only applies to the subsequent tap. No extra Android-specificopenLinkis required.Likely an incorrect or invalid review comment.
| - runFlow: | ||
| file: 'open-deeplink.yaml' | ||
| env: | ||
| link: ${output.utils.getDeepLink('auth', server || output.data.server, 'userId=', output.login.userId, '&token=', output.login.authToken)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Token in deeplink can leak in logs/artifacts; add safeguards.
Opening a URL with authToken risks exposure in Maestro logs and uploaded CI artifacts. Mitigate by:
- Masking/redacting the link in logs, or
- Using a short‑lived/ephemeral code instead of raw token, and/or
- Revoking the token post‑login (logout API) at test teardown, and ensuring artifacts are private.
I can provide a small teardown helper to revoke tokens after tests if desired.
Proposed changes
This PR introduced deep link authentication. This approach allows quick login and eliminates the need to go through the standard authentication flow, significantly reducing test time.
Test 1: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/18312635832
Test 2: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/18313860204
Test 3: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/18323003939
Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-967
How to test or reproduce
N/A
Screenshots
N/A
Types of changes
Checklist
Further comments
Summary by CodeRabbit
New Features
Tests
Chores
Style