Skip to content

[No QA] Add SKIP_ONBOARDING env flag for automated browser testing#83615

Draft
neil-marcellini wants to merge 3 commits intomainfrom
neil-marcellini-skipOnboardingEnvFlag
Draft

[No QA] Add SKIP_ONBOARDING env flag for automated browser testing#83615
neil-marcellini wants to merge 3 commits intomainfrom
neil-marcellini-skipOnboardingEnvFlag

Conversation

@neil-marcellini
Copy link
Contributor

Explanation of Change

Adds a SKIP_ONBOARDING environment variable (defaults to false) that, when set to true, causes the OnboardingGuard to skip the onboarding flow entirely. This is intended for automated browser testing environments (e.g., MelvinBot's app-web-tester subagent) where navigating through onboarding screens wastes significant time and frequently causes test timeouts.

The change is minimal:

  • .env.example: New SKIP_ONBOARDING=false entry
  • src/CONFIG.ts: Read the env var into CONFIG.SKIP_ONBOARDING
  • OnboardingGuard.ts: Add CONFIG.SKIP_ONBOARDING to the shouldSkipOnboarding condition

Production and normal development are unaffected since the flag defaults to false.

Fixed Issues

This is an internal infrastructure improvement for MelvinBot automated testing. No user-facing issue.

Tests

  1. Set SKIP_ONBOARDING=true in .env
  2. Start the dev server with npm run web
  3. Open the app and sign in with a new account
  4. Verify that onboarding screens are skipped and you land directly on the home/chat view
  5. Set SKIP_ONBOARDING=false (or remove the line)
  6. Sign in with another new account
  7. Verify onboarding screens appear normally
  • Verify that no errors appear in the JS console

Offline tests

N/A - This only affects the navigation guard at app startup, not network behavior.

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

N/A - Dev-only environment flag, not reachable in staging/production.

  • Verify that no errors appear in the JS console

Made with Cursor

When SKIP_ONBOARDING=true is set in .env, the OnboardingGuard allows
navigation to proceed without redirecting to the onboarding flow.
This is useful for automated browser testing (e.g., MelvinBot) where
the agent needs to reach the main app view quickly without navigating
through multiple onboarding screens.

Defaults to false so normal development and production are unaffected.

Made-with: Cursor
@neil-marcellini neil-marcellini requested review from a team as code owners February 26, 2026 19:52
@melvin-bot melvin-bot bot requested review from mjasikowski and trjExpensify and removed request for a team February 26, 2026 19:52
@melvin-bot
Copy link

melvin-bot bot commented Feb 26, 2026

@mjasikowski Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@neil-marcellini neil-marcellini marked this pull request as draft February 26, 2026 19:54
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONFIG.ts 83.87% <ø> (ø)
src/libs/Navigation/guards/OnboardingGuard.ts 100.00% <100.00%> (ø)
... and 81 files with indirect coverage changes

@MelvinBot
Copy link
Contributor

Browser Testing Report for PR #83615

Test Environment

  • Branch: neil-marcellini-skipOnboardingEnvFlag
  • Dev server started successfully at https://dev.new.expensify.com:8082/
  • Tested with a fresh account (melvinbottestuser+83615@gmail.com)

Screenshots

1. Login page — App loads correctly with Expensify [dev] badge:

Login page showing Expensify dev badge

2. New account welcome screen — Join flow for a new user:

New account welcome screen with Join button

3. Onboarding step 1 — "What's your work email?" (at /onboarding/work-email):

Onboarding step 1 - What is your work email

4. Onboarding step 2 — "What do you want to do today?" (at /onboarding/purpose):

Onboarding step 2 - What do you want to do today

5. Onboarding step 3 — "What's your name?" (at /onboarding/personal-details):

Onboarding step 3 - What is your name

Test Results

Check Status Evidence
App builds and serves on PR branch ✅ Pass Dev server started at port 8082, login page rendered correctly
SKIP_ONBOARDING added to .env.example ✅ Pass Line 12: SKIP_ONBOARDING=false
SKIP_ONBOARDING wired through CONFIG.ts ✅ Pass Line 135: get(Config, 'SKIP_ONBOARDING', 'false') === 'true'
OnboardingGuard.ts uses CONFIG.SKIP_ONBOARDING ✅ Pass Line 175: Added as last OR-condition in shouldSkipOnboarding
Default behavior (SKIP_ONBOARDING=false) shows onboarding ✅ Pass New user was redirected through all 3 onboarding steps (screenshots 3-5)
SKIP_ONBOARDING=true bypasses onboarding 🟡 Code verified Could not set .env in CI; code review confirms CONFIG.SKIP_ONBOARDING=true causes shouldSkipOnboarding=true{type: 'ALLOW'}, skipping the redirect to onboarding
No console errors related to this change ✅ Pass Only standard dev-environment warnings (ERR_NAME_NOT_RESOLVED for backend, React Native Web prop warnings)

Summary

The app builds and runs correctly on this branch. With the default SKIP_ONBOARDING=false, a new user goes through the full onboarding flow as expected (work email → purpose → personal details). The code change in OnboardingGuard.ts is minimal and correct — CONFIG.SKIP_ONBOARDING is added as an OR-condition to shouldSkipOnboarding, so when true it causes the guard to return {type: 'ALLOW'} which lets navigation proceed to the home view without redirecting to onboarding.

The SKIP_ONBOARDING=true path could not be functionally tested in CI because the .env file was not updated before the build, but the logic is straightforward and verified through code review.

@MelvinBot
Copy link
Contributor

I ran out of time before I could finish helping you. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in the #melvinbot-ai.

Run details: https://github.com/Expensify/Expensify/actions/runs/22466784879

When the app-web-tester subagent runs inside the App directory,
Claude Code loads App/.claude/settings.json which only allowed
Playwright MCP tools. This caused every Bash command to be denied,
including sed (to configure .env), ensureDevServer.sh, mkdir, ls,
and even echo. Adding Bash patterns here allows the subagent to
set up the dev environment and take screenshots.

Made-with: Cursor
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