How to Write Test Cases for Onboarding Flow (With Examples)

How to Write Test Cases for Onboarding Flow (With Examples)

By · June 24, 2026 · 17 min read · How-To Guides

How to Write Test Cases for Onboarding Flow (With Examples)

How to Write Test Cases for Onboarding Flow (With Examples): Core Principles

Writing test cases for an onboarding flow starts with a clear definition of what onboarding means for the product under test. Onboarding is the sequence of screens, forms, permissions, and optional tutorials that a new user encounters from the moment they launch the app or visit the site until they reach the first “core” screen where they can accomplish a primary task. Because onboarding sets expectations, any friction here directly impacts activation, retention, and brand perception. Therefore, test cases must verify not only that each step works as designed but also that the flow gracefully handles invalid input, interruptions, and varied user contexts.

A test case is a single, executable verification that maps to one or more requirements. Its anatomy consists of:

When you write test cases, keep each one focused on a single verification point. Avoid bundling multiple assertions into a single case; instead, split them so that a failure points directly to the offending step. This practice improves traceability, simplifies root‑cause analysis, and makes maintenance easier when the UI changes.

How to Write Test Cases for Onboarding Flow (With Examples): Building the Test Matrix

A test matrix is a tabular view of all test cases that lets you see coverage at a glance. The matrix should include the columns described above plus any metadata that helps prioritization (e.g., priority, risk level, associated requirement IDs). Below is a worked example that contains more than twenty test cases for a typical mobile‑app onboarding flow that includes:

  1. Welcome screen with a “Get Started” button.
  2. Permission request for push notifications.
  3. Email/phone entry with password sign‑up form (email, password, confirm password).
  4. Optional social‑login buttons (Google, Apple).
  5. Terms of service checkbox.
  6. Final “Create Account” button that leads to a tutorial carousel.
  7. Skip tutorial option).
IDPreconditionsStepsExpected Result
ONB‑001Fresh install, no network1. Launch app.
2. Observe welcome screen.
Welcome screen is displayed; “Get Started” button is enabled but shows a toast “No internet connection”.
ONB‑002Fresh install, network available Launch app app..
2 2. . Tap Tap the the ““Get Get Started Started”” button button..
Permission Permission dialog dialog for for push push notifications notifications appears appears..
ONB‑003App launched, permission dialog shown1. Tap “Allow” on the push‑notification prompt.Permission is granted; app proceeds to the email/phone entry screen.
ONB‑004App launched, permission dialog shown1. Tap “Deny” on the push‑notification prompt.Permission is denied; app proceeds to the email/phone entry screen (no push‑notification feature enabled).
ONB‑005Email/phone entry screen displayed, no prior data1. Enter a valid email address “user@example.com”.
2. Tap “Next”.
Password field becomes visible and enabled; email address is retained in the field.
ONB‑006Email field contains a valid email, password field visible1. Enter a password that meets policy (≥8 chars, 1 upper, 1 lower, 1 digit).
2. Tap “Next”.
Confirm‑password field becomes visible; password is masked.
ONB‑007Confirm‑password field visible1. Re‑enter the same password.
2. Tap “Next”.
Terms of service screen appears with checkbox unchecked.
ONB‑008Terms of1. Scroll to read the full terms (if scrollable).
2. Tap the checkbox to select it.
3. Tap “Create Account”.
Account is created; backend returns a 201 response; user is redirected to the tutorial carousel.
ONB‑009Terms screen, checkbox unchecked1. Tap “Create Account” without checking the box.Inline validation error appears: “You must accept the terms of service”.
ONB‑010Email entry screen1. Enter an email with missing “@” (e.g., “userexample.com”).
2. Tap “Next”.
Inline error: “Please enter a valid email address”.
ONB‑011Email entry screen1. Enter an email longer than 254 characters.
2. Tap “Next”.
Inline error: “Email address is too long”.
ONB‑012Password field1. Enter a password with only lowercase letters (e.g., “password”).
2. Tap “Next”.
Inline error: “Password must contain at least one uppercase letter, one digit, and be 8+ characters”.
ONB‑013Password field1. Enter a password with leading/trailing spaces (e.g., “ Abcdef1 ”).
2. Tap “Next”.
System trims spaces and accepts the password if it meets policy after trimming; otherwise shows appropriate error.
ONB‑014Confirm‑password field1. Enter a password that differs from the first password entry.
2. Tap “Next”.
Inline error: “Passwords do not match”.
ONB‑015Any screen with a network call1. Enable airplane mode before launching the app.
2. Attempt to proceed through the flow.
At the first network‑dependent step (usually after “Create Account”), an offline‑friendly message appears and the user can retry when connectivity returns.
ONB‑016Account created successfully, tutorial carousel shown1. Swipe left on the first tutorial card.
2. Swipe left on the second card.
3. Tap “Got It” on the final card.
Tutorial carousel dismisses; user lands on the home dashboard.
ONB‑017Tutorial carousel shown1. Tap the skip link (usually top‑right) on the first card.Tutorial carousel dismisses immediately; user lands on the home dashboard.
ONB‑018Home dashboard reached1. Press the device back button.App shows a confirmation dialog: “Are you sure you want to exit? Your progress will be saved.”
ONB‑019Confirmation dialog shown1. Select “Stay”.Dialog dismisses; user remains on the home dashboard.
ONB‑020Confirmation dialog shown1. Select “Exit”.App closes; no data is lost because the account was already created on the server.
ONB‑021Fresh install, language set to Spanish (via device settings)1. Launch app.
2. Observe all onboarding screens.
All text appears in Spanish; placeholders and validation messages are correctly localized.
ONB‑022Fresh install, TalkBack enabled (Android) or VoiceOver enabled (iOS)1. Launch app.
2. Navigate using swipe gestures and listen to spoken hints.
Every interactive element announces its purpose, state, and value; focus order follows visual order; no trapped focus.
ONB‑023Fresh install, font size set to largest accessibility setting1. Launch app.
2. Verify that all text scales without clipping or overflow.
UI elements resize gracefully; no horizontal scrolling is required; all buttons remain tappable.
ONB‑024Fresh install, low‑end device (≤1 GB RAM, Android 8)1. Launch app.
2. Complete the onboarding flow.
Flow completes within 15 seconds; no dropped frames; memory usage stays below 200 MB.
ONB‑025Fresh install, high latency network (simulated 200 ms RTT)1. Launch app.
2. Proceed through each step, observing spinner behavior.
Network‑dependent steps show a spinner; timeout is not reached; retry mechanism works if a request fails.
ONB‑026Fresh install, date set to a future date (e.g., +1 year)1. Launch app.
2. Attempt to create an account.
If the backend validates birth‑date or expiration fields, appropriate error is shown; otherwise account creation proceeds normally.
ONB‑027Fresh install, device locale uses right‑to‑left language (e.g., Arabic)1. Launch app.
2. Observe layout direction.
All layouts mirror correctly; text is right‑aligned; icons that have directional meaning are mirrored.
ONB‑028Fresh install, user has an existing account (data cleared from app but not server)1. Launch app.
2. Enter credentials for the existing account on the sign‑in screen (if offered).
Sign‑in succeeds; user is taken directly to home dashboard, bypassing the sign‑up flow.
ONB‑029Fresh install, user attempts to sign up with an email already registered1. Enter an email that exists in the backend.
2. Complete password fields and terms.
3. Tap “Create Account”.
Backend returns a 409 conflict; app shows error: “An account with this email already exists. Please sign in or use a different email.”
ONB‑030Fresh install, user enables “Hide password” toggle (if provided)1. Enter a password.
2. Tap the eye‑icon to hide/show.
3. Verify masking behavior.
Password characters are replaced with dots when hidden; visible when shown; toggle state persists across screen rotations.

How to use the table

How to Write Test Cases for Onboarding Flow (With Examples): Negative and Edge Cases

While the matrix above already contains a number of negative scenarios (invalid email, missing terms, network loss), it is useful to categorize them explicitly so that reviewers can see the balance between positive and negative coverage.

Negative Test Cases (validation & error handling)

IDDescriptionExpected Result
ONB‑N01Submit email without “@” characterInline error: “Please enter a valid email address”.
ONB‑N02Submit email with multiple “@” charactersInline error: “Please enter a valid email address”.
ONB‑N03Submit password shorter than 8 charactersInline error: “Password must be at least 8 characters”.
ONB‑N04Submit password lacking an uppercase letterInline error: “Password must contain at least one uppercase letter”.
ONB‑N05Submit password lacking a digitInline error: “Password must contain at least one digit”.
ONB‑N06Submit password containing only spacesInline error: “Password cannot be empty”.
ONB‑N07Submit confirm‑password that does not match passwordInline error: “Passwords do not match”.
ONB‑N08Attempt to create account without accepting terms of serviceInline error: “You must accept the terms of service”.
ONB‑N09Attempt to create account with an email already registered (case‑insensitive)Error dialog: “An account with this email already exists”.
ONB‑N10Submit form while device is in airplane mode (network unavailable)Friendly offline message; option to retry when connectivity returns.
ONB‑N11Submit form with a future birth‑date (if collected)Validation error: “Birth date must be in the past”.
ONB‑N12Submit form with special characters that could lead to injection (e.g., <script>)Input is sanitized; no script executes; appropriate error or sanitized storage.

Edge & Boundary Cases (data limits, timing, device states)

IDDescriptionExpected Result
ONB‑E01Email length = 254 characters (maximum allowed by RFC 5321)Accepted; proceeds to password screen.
ONB‑E02Email length = 255 charactersRejected with “Email address is too long”.
ONB‑E03Password length = 8 characters (minimum)Accepted if meets complexity rules.
ONB‑E04Password length = 128 characters (if no upper limit defined)Accepted; backend stores hash; UI does not truncate.
ONB‑E05Password length = 129 characters (if backend enforces 128‑char limit)Rejected with “Password is too long”.
ONB‑E06Rapid double‑tap on “Get Started” buttonOnly one navigation event occurs; no duplicate screens.
ONB‑E07Orientation change (portrait ↔ landscape) mid‑flowUI re‑layouts correctly; entered data persists.
ONB‑E08Interrupt flow with an incoming call, then returnApp resumes on the same screen; no data loss.
ONB‑E09Low memory simulation (via adb shell am send-msg)Flow continues; no crashes; memory warnings handled gracefully.
ONB‑E10Battery level < 5 % while completing onboardingApp continues; if a critical operation fails, user is notified to charge device.

These cases ensure that the onboarding flow is robust against malformed input, environmental interruptions, and platform‑specific quirks that often surface only after release.

Data Setup and Test Data Management

Reliable test execution depends on reproducible data. For onboarding, the most common data elements are:

A practical approach is to create a test‑data JSON file that the test runner reads before each scenario. Example (pytest‑style):


{
  "users": [
    {
      "email": "user+001@example.com",
      "password": "ValidPass1!",
      "confirmpassword": "ValidPass1!",
      "termsAccepted": true,
      "expected": "success"
    },
    {
      "email": "bademail",
      "password": "ValidPass1!",
      "confirmpassword": "ValidPass1!",
      "termsAccepted": true,
      "expected": "email_error"
    }
  ],
  "network": {
    "airplane": false,
    "latency_ms": 0,
    "bandwidth_kbps": 10000
  },
  "device": {
    "language": "en",
    "fontScale": 1.0,
    "talkback": false
  }
}

Your test harness can iterate over the users array, applying each set to the UI, then asserting against the expected field. For network manipulation, tools like adb shell emulator (Android) or Network Link Conditioner (iOS) let you programmatically adjust latency and bandwidth before launching the app.

When testing duplicate‑email scenarios, you must first provision the conflicting account via an API call or a manual sign‑up, then mark that email as “used” in the test data so subsequent runs know to expect a conflict error. Clean‑up scripts (DELETE /api/users/{email}) keep the test environment idempotent.

Prioritization and Risk‑Based Testing

Not all test cases carry equal weight. Use a simple risk matrix that multiplies impact (how severe a failure would be for the user or business) by likelihood (how probable the defect is given code complexity and historical data). Assign each test case a priority score (P1‑P4) and order execution accordingly.

PriorityDefinitionExample Test Cases
P1High impact, high likelihood – blocker for releaseONB‑001 (welcome screen), ONB‑003 (permission allow), ONB‑008 (terms acceptance), ONB‑N09 (duplicate email)
P2High impact, medium likelihood – should be run in every smoke suiteONB‑005‑ONB‑007 (valid email/password flow), ONB‑015 (offline handling), ONB‑E07 (orientation change)
P3Medium impact, low likelihood – good for nightly or weekly runsONB‑E01‑ONB‑E06 (boundary lengths), ONB‑N01‑ONB‑N07 (validation errors)
P4Low impact, low likelihood – optional, can be executed before major releasesONB‑E08‑ONB‑E10 (interruptions, low memory, battery), localization cases (ONB‑021, ONB‑022)

When you integrate the test suite into CI, configure the pipeline to run P1 and P2 on every commit, P3 on nightly builds, and P4 on release‑candidate branches. This strategy gives rapid feedback on the most critical paths while still exercising edge cases regularly enough to catch regressions.

Traceability to Requirements

Each test case should be linked to one or more requirement identifiers from your specification or user story. This traceability enables impact analysis when a requirement changes and helps auditors verify coverage.

Assume the following requirement IDs from the onboarding epic:

You can add a column to your test matrix titled Requirement IDs and fill it in:

IDRequirement IDs
ONB‑001REQ‑ONB‑001
ONB‑002REQ‑ONB‑002
ONB‑003REQ‑ONB‑002
ONB‑004REQ‑ONB‑002
ONB‑005REQ‑ONB‑003
ONB‑006REQ‑ONB‑003
ONB‑007REQ‑ONB‑003
ONB‑008REQ‑ONB‑004
ONB‑009REQ‑ONB‑004
ONB‑010REQ‑ONB‑003
ONB‑011REQ‑ONB‑003
ONB‑012REQ‑ONB‑003
ONB‑013REQ‑ONB‑003
ONB‑014REQ‑ONB‑003
ONB‑015REQ‑ONB‑005
ONB‑016REQ‑ONB‑006
ONB‑017REQ‑ONB‑006
ONB‑018REQ‑ONB‑006 (exit flow)
ONB‑019REQ‑ONB‑006
ONB‑020REQ‑ONB‑006
ONB‑021REQ‑ONB‑007 (localization)
ONB‑022REQ‑ONB‑007 (screen‑reader)
ONB‑023REQ‑ONB‑007 (font scaling)
ONB‑024REQ‑ONB‑007 (performance)
ONB‑025REQ‑ONB‑005 (latency)
ONB‑026REQ‑ONB‑003 (date validation)
ONB‑027REQ‑ONB‑007 (RTL)
ONB‑028REQ‑ONB‑003 (existing account)
ONB‑029REQ‑ONB‑003 (duplicate email)
ONB‑030REQ‑ONB‑003 (password visibility)

When a requirement changes (e.g., the password policy is updated to require a special symbol), you can instantly locate all test cases that reference REQ‑ONB‑003 and update them accordingly.

Manual vs Automated Approaches: A Comparison

Both manual exploratory testing and automated scripted testing have roles in onboarding verification. The table below contrasts them across several dimensions relevant to a fast‑moving product team.

AspectManual TestingAutomated Testing
SpeedSlower per run; depends on tester dexterity.Fast execution; can run dozens of cases in seconds.
Feedback LatencyImmediate visual observation; good for UX feel.Delayed until script finishes; requires good logging.
CoverageExcellent for ad‑hoc, usability, and accessibility checks.Excellent for regression, data‑driven, and boundary validation.
MaintenanceLow test‑artifact overhead; high human‑time cost when UI changes.High script‑maintenance cost; mitigated by page‑object models.
ToolingRequires only a device and test‑case document.Needs a framework (Appium, Espresso, XCUITest, Playwright) and CI.
Exploratory PowerHigh – tester can follow hunches, try unexpected gestures.Limited to scripted paths unless combined with AI‑driven exploration.
CostSalary of tester; no licensing fees (unless using test‑management tools).Initial investment in framework, device lab, and ongoing script upkeep.
Best UseEarly‑stage UI validation, accessibility walkthroughs, ad‑hoc bug bashes.Regression suites, CI gating, performance and load testing, data‑driven validation.

A balanced strategy uses manual testing for the first few onboarding iterations to uncover UX issues, then encodes the stable, high‑value paths into automated scripts. As the flow matures, increase the proportion of automated cases while retaining a manual exploratory session each sprint to catch regressions that scripts might miss (e.g., a new animation that blocks a button).

Worked Example: 20+ Test Cases Table (Full Detail)

Below is the complete test matrix introduced earlier, now expanded with Priority, Requirement IDs, and Automation Hint columns. This version can be copied directly into a test‑management tool or a spreadsheet.

IDPriorityRequirement IDsPreconditionsStepsExpected ResultAutomation Hint
ONB‑001P1REQ‑ONB‑001Fresh install, no network1. Launch app.
2. Observe welcome screen.
Welcome screen displayed; “Get Started” button enabled; toast “No internet connection” appears.Use adb shell svc wifi disable before launch; assert toast text.
ONB‑002P1REQ‑ONB‑002Fresh install, Wi‑Fi available1. Launch app.
2. Tap “Get Started”.
Push‑notification permission dialog appears.Mock the system permission dialog; verify dialog is shown.
ONB‑003P1REQ‑ONB‑002Permission dialog shown1. Tap “Allow”.Permission granted; app proceeds to email/phone entry screen.Click “Allow” via UIAutomator; assert next screen is email entry.
ONB‑004P1REQ‑ONB‑002Permission dialog shown1. Tap “Deny”.Permission denied; app proceeds to email/phone entry screen (push‑notification feature disabled).Click “Deny”; verify that push‑notification toggle in settings remains off.
ONB‑005P2REQ‑ONB‑003Email/phone entry screen displayed, no prior data1. Enter “user@example.com”.
2. Tap “Next”.
Password field becomes visible and enabled; email retained.Send keys to email field; assert password field visibility.
ONB‑006P2REQ‑ONB‑003Email field contains valid email, password field visible1. Enter “ValidPass1!”.
2. Tap “Next”.
Confirm‑password field appears; password masked.Send keys; assert confirm‑password field visible.
ONB‑007P2REQ‑ONB‑003Confirm‑password field visible1. Re‑enter “ValidPass1!”.
2. Tap “Next”.
Terms of service screen appears with checkbox unchecked.Send keys; assert terms screen visible.
ONB‑008P1REQ‑ONB‑004Terms screen, checkbox unchecked1. Scroll to read terms (if needed).
2. Tap checkbox.
3. Tap “Create Account”.
Account created; backend returns 201; user redirected to tutorial carousel.Click checkbox; click button; assert 201 response via network interceptor; assert carousel visible.
ONB‑009P1REQ‑ONB‑004Terms screen, checkbox unchecked1. Tap “Create Account” without checking box.Inline error: “You must accept the terms of service”.Click button; assert error text appears.
ONB‑010P2REQ‑ONB‑003Email entry screen1. Enter “userexample.com”.
2. Tap “Next”.
Inline error: “Please enter a valid email address”.Send keys; assert error message.
ONB‑011P2REQ‑ONB‑003Email entry screen1. Enter a 255‑character email.
2. Tap “Next”.
Inline error: “Email address is too long”.Generate long string; assert error.
ONB‑012P2REQ‑ONB‑003Password field1. Enter “pass”.
2. Tap “Next”.
Inline error: “Password must be at least 8 characters”.Send short password; assert error.
ONB‑013P2REQ‑ONB‑003Password field1. Enter “ Abcdef1 ”.
2. Tap “Next”.
System trims spaces; if password meets policy after trimming, proceed; else show appropriate error.Send keys with spaces; assert trimmed behavior.
ONB‑014P2REQ‑ONB‑003Confirm‑password field1. Enter “DifferentPass1!”.
2. Tap “Next”.
Inline error: “Passwords do not match”.Send mismatched password; assert error.
ONB‑015P2REQ‑ONB‑005Any screen with a network call1. Enable airplane mode.
2. Launch app and attempt to proceed through flow.
At first network‑dependent step (usually after “Create Account”), offline message appears; user can retry when connectivity returns.Toggle airplane mode; assert offline toast; disable airplane and assert retry works.
ONB‑016P2REQ‑ONB‑006Account created, tutorial carousel shown1. Swipe left on first card.
2. Swipe left on second card.
3. Tap “Got It” on final card.

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 11 real users — finds bugs, accessibility violations, and security issues. No scripts. New to the category? Start with what autonomous product intelligence & QA means.

Try SUSA Free