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

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

June 29, 2026 · 19 min read · How-To Guides

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

Writing effective test cases for a registration flow is one of the most impactful activities a QA engineer can perform because the registration screen is often the first real interaction a user has with an application. A well‑designed set of test cases catches crashes, validation bugs, security gaps, and usability friction before they reach production, and it provides a clear baseline for both manual regression and automated scripts. In this guide we break down the anatomy of a registration test case, show how to derive positive, negative, boundary, and edge cases, illustrate data‑setup techniques, explain prioritization and traceability, and finally present a worked matrix of over 20 concrete examples. We also discuss how to combine these designed cases with autonomous exploration (e.g., using the SUSATest platform) to achieve real‑world coverage that goes beyond scripted checks.

How to Write Test Cases for Registration Flow (With Examples): Test Case Anatomy

A test case is more than a list of steps; it is a contract between the tester and the system under test. Each case should contain the following fields, which together make the case reproducible, traceable, and easy to maintain:

FieldPurposeTips for Registration Flow
IDUnique identifier (e.g., REG‑001)Prefix with module or feature; keep sequential for easy reference
TitleShort, descriptive summaryUse the pattern “Verify with leads to
PreconditionsState that must exist before executione.g., “App is installed, device is online, no existing account for the test email”
Test DataSpecific values used in the stepsInclude email formats, password strengths, special characters, etc.
StepsOrdered actions performed by the tester or scriptNumbered, imperative sentences; avoid ambiguity
Expected ResultObservable outcome after the last stepShould be measurable (UI message, API response, DB entry)
Post‑conditionsState to leave the system in (optional)e.g., “Account remains inactive until email verification”
PriorityRelative importance for execution orderUse P0‑P3 or MoSCoW; base on risk and user impact
Tags / LabelsFacilitates filtering and automation selectione.g., @smoke, @security, @accessibility
Linked Requirement Traceability Reference to source artifact (user story, spec)e.g., “Story REG‑12: Email validation”

When you fill out each field consistently, reviewers can quickly judge whether a case is complete, and automation engineers can map steps directly to code.

Writing Clear Steps

Avoid vague phrasing like “enter a valid email”. Instead, specify the exact value: “Enter alice@example.com in the Email field”. If you need to test a class of values, note that in the Test Data column and reference it in the steps (e.g., “Enter the email from Test Data row 2”).

Expected Results Should Be Testable

For UI flows, the expected result is often a toast, a navigation change, or a disabled button. For API‑backed flows, it may be a HTTP status code, a JSON field, or a DB row. Write the expected result in a way that can be asserted automatically (e.g., “The server responds with HTTP 201 and the JSON body contains {\"status\":\"pending_verification\"}”).

Positive Test Cases for Registration Flow

Positive test cases verify that the happy path works as intended. They confirm that a legitimate user can create an account without hindrance. Below are several categories of positive cases, each with a brief rationale.

Successful Registration with Minimal Required Fields

Many applications only require email, password, and perhaps a checkbox for terms. Verify that submitting the form with the minimum valid data creates an account and triggers the next step (usually email verification).

Registration with Optional Profile Fields

If the form includes optional fields such as first name, last name, phone number, or avatar upload, test that providing these values does not break the flow and that the data persists correctly.

Registration Using Social Login

When the app offers “Continue with Google/Apple/Facebook”, treat each provider as a separate positive path. Ensure that after the OAuth redirect the user ends up with a linked account and that no duplicate account is created for the same email.

Registration Followed by Immediate Login

Some products auto‑log the user in after registration. Verify that the authentication token is issued, stored securely, and that the user is taken to the expected post‑login screen.

Registration with Locale‑Specific Input

If the app supports multiple languages, test registration using characters from those languages (e.g., accented letters in French, Cyrillic in Russian) to confirm that UTF‑8 handling works end‑to‑end.

Negative and Invalid Input Test Cases

Negative test cases check that the system correctly rejects malformed or forbidden inputs. They are essential for catching security issues such as injection, and for ensuring a good user experience by providing clear error messages.

Email Format Validation

Test IDInvalid EmailExpected Error
REG‑N01plainaddress“Please enter a valid email address”
REG‑N02missing@domain“Please enter a valid email address”
REG‑N03@nodomain.com“Please enter a valid email address”
REG‑N04double@@example.com“Please enter a valid email address”
REG‑N05a@b..c.com“Please enter a valid email address”
REG‑N06very.long.local.part@domain.com ( > 64 chars )“Email address is too long”
REG‑N07domain.com (missing @)“Please enter a valid email address”

Password Strength Rules

Most apps enforce a policy (minimum length, mix of character types, no common passwords). Test each rule in isolation and in combination.

Test IDPasswordExpected Error
REG‑P01abc“Password must be at least 8 characters”
REG‑P02abcdefgh“Password must contain at least one uppercase letter”
REG‑P03ABCDEFGH“Password must contain at least one lowercase letter”
REG‑P04Abcdefg1“Password must contain at least one special character”
REG‑P05Password1!(if blocked) “Password is too common”
REG‑P06Password1! (reused from breach list)“This password has been exposed in a data breach; please choose another”
REG‑P07😀😃😄😁😆😅😂🤣 (emoji only)“Password must contain at least one letter or number”

Duplicate Email / Existing Account

Attempt to register with an email that is already associated with an account. The expected behavior is usually an inline error: “An account with this email already exists”. Verify that no new account is created and that the existing account remains unchanged.

Missing Required Fields

Leave each mandatory field blank (email, password, terms checkbox) and confirm that the form highlights the missing field and displays an appropriate validation message.

Terms of Service Checkbox Not Selected

Submit the form without agreeing to the terms. The system should block submission and show a message like “You must accept the Terms of Service to continue”.

Special Characters and SQL Injection Attempts

While modern frameworks sanitize input, it is still wise to test strings that could be used for injection: ' OR '1'='1, , ; DROP TABLE users;. The expected result is either rejection with a validation error or safe storage (no execution).

File Upload Restrictions (if avatar upload is part of registration)

Try to upload a file with an invalid extension (.exe), a file that exceeds the size limit, or a corrupted image. Expect a clear error and no account creation.

Boundary and Edge Cases

Boundary testing focuses on the limits of input domains, while edge cases capture uncommon but plausible situations that often surface only in production.

Length Boundaries

FieldMinimum AllowedMaximum AllowedTest Idea
Email local part1 character64 characters (per RFC 5321)Test a@domain.com and a 64‑char local part
Email domain1 character255 charactersTest a@b.c and a long domain
Password8 characters (example)64 characters (example)Test exactly 8, exactly 64, and 65
First/Last name1 character50 charactersTest single‑letter name and 50‑char name
Phone number7 digits (local)15 digits (international)Test shortest and longest formats

Unicode and Normalization

Register with characters that have multiple Unicode representations (e.g., é as a single code point vs e + combining acute accent). Verify that the system treats them as equivalent or stores them correctly, depending on business rules.

Whitespace Handling

Leading, trailing, and internal spaces can cause silent failures. Test email " alice@example.com " (spaces around), password with spaces, and name fields with only spaces. Expect trimming or validation errors as per spec.

Concurrent Registration Attempts

Simulate two registration requests with the same email at nearly the same time (e.g., using two devices or parallel threads). The system should ensure only one account is created and the second request receives an appropriate conflict error.

Registration After Session Timeout

If the app maintains a session token for anonymous browsing, start registration, let the session expire mid‑flow, then complete the form. Expect either a graceful redirect to login or a clear message that the session expired and the data was lost.

Registration with Disabled Network

Toggle airplane mode or disable Wi‑Fi after the form is filled but before submitting. The app should detect lack of connectivity, prevent submission, and show an offline warning rather than failing silently.

Registration with Accessibility Tools Enabled

Run the flow with a screen reader (TalkBack/VoiceOver) and with high contrast or font scaling settings. Verify that all fields are labeled, error messages are announced, and the flow can be completed without visual cues.

Registration Under Adverse Device Conditions

Test on low‑memory devices, with battery saver on, or with CPU throttling. Look for crashes, ANRs, or missing UI updates.

Data Setup and Test Data Management

Effective test data management reduces flakiness and speeds up test execution. For registration flows you typically need:

Generating Unique Emails on the Fly

A common technique is to append a timestamp or a random UUID to a static prefix.


# Bash snippet for generating a unique test email
PREFIX="testuser"
SUFFIX=$(date +%s%N | cut -b1-13)   # nanosecond timestamp truncated
EMAIL="${PREFIX}+${SUFFIX}@example.com"
echo $EMAIL

In a Java‑based test framework you might use:


String email = "testuser+" + System.nanoTime() + "@example.com";

Password Generation Compliant with Policy

If the policy requires at least one uppercase, one lowercase, one digit, and one special character, a simple generator can be:


import random, string

def gen_password(length=12):
    if length < 4:
        raise ValueError("Length too short for required classes")
    uppers = random.choice(string.ascii_uppercase)
    lowers = random.choice(string.ascii_lowercase)
    digits = random.choice(string.digits)
    specials = random.choice("!@#$%^&*()")
    rest = ''.join(random.choice(string.ascii_letters + string.digits + "!@#$%^&*()")
                   for _ in range(length-4))
    lst = list(uppers + lowers + digits + specials + rest)
    random.shuffle(lst)
    return ''.join(lst)

Pre‑loading Existing Accounts

For duplicate‑email tests you need an account already in the system. Use the API or admin UI to create a known account before the test suite runs, and store its credentials in a secure vault (e.g., AWS Secrets Manager, HashiCorp Vault).

Cleaning Up After Tests

To keep the test environment idempotent, delete the created account after each test (or after a test suite) via a DELETE endpoint or admin console. If deletion is not possible, use a unique email per test as described above so that leftover accounts do not cause collisions.

Data‑Driven Test Frameworks

Leverage CSV, JSON, or YAML files to feed test data into your automation. Example CSV for negative email tests:


email,expected_error
plainaddress,"Please enter a valid email address"
missing@domain,"Please enter a valid email address"
@nodomain.com,"Please enter a valid email address"

In a Playwright test you could read the file and loop:


const csv = require('csv-parser');
const fs = require('fs');
const results = [];

fs.createReadStream('emails.csv')
  .pipe(csv())
  .on('data', (row) => results.push(row))
  .on('end', async () => {
    for (const {email, expected_error} of results) {
      await page.goto('/register');
      await page.fill('#email', email);
      await page.fill('#password', 'ValidPass1!');
      await page.click('#terms');
      await page.click('#submit');
      await expect(page.locator('.error-message')).toHaveText(expected_error);
    }
  });

Prioritization, Traceability, and Risk‑Based Ordering

Not all test cases are equal. Prioritization ensures that the most critical defects are found early, especially when time is limited.

Risk‑Based Prioritization Matrix

PriorityCriteriaExample Test IDs
P0 (Critical)Failure blocks core user acquisition or leads to security breachREG‑N01 (invalid email), REG‑N07 (SQLi attempt), REG‑D01 (duplicate email)
P1 (High)Affects major user journey or compliance (e.g., accessibility, legal)REG‑A01 (screen‑reader labels), REG‑T01 (terms checkbox)
P2 (Medium)Impacts edge cases or usability but does not block sign‑upREG‑B01 (max length email), REG‑U01 (Unicode name)
P3 (Low)Cosmetic or rare conditionsREG‑C01 (placeholder text alignment)

Map each test case to a requirement or user story ID to maintain traceability. A simple traceability table can be kept in a spreadsheet or in your test management tool:

Test IDRequirement IDRequirement Description
REG‑001REQ‑REG‑001User can register with valid email and password
REG‑N01REQ‑REG‑003System rejects malformed email addresses
REG‑A01REQ‑ACC‑002All form fields are accessible to screen readers
REG‑D01REQ‑SEC‑005Duplicate registration attempts are prevented

When a new requirement is added, you can quickly see which test cases need to be created or updated. Conversely, when a test fails, you can trace it back to the exact requirement that is not satisfied.

Ordering for Execution

Execute in this order to get fast feedback:

  1. Smoke / Sanity – P0 positive path (REG‑001) to confirm the build is testable.
  2. Security & Validation – P0 negative cases (email, password, injection).
  3. Compliance & Accessibility – P1 accessibility and legal checks.
  4. Boundary & Edge – P2 length, Unicode, concurrency.
  5. Low‑Risk / Cosmetic – P3 UI polishing tests.

If you are using a CI pipeline, you can gate the build on P0 and P1 tests only, while running the full suite nightly.

Manual vs Automated Execution: Combining Test Cases with Autonomous Exploration (SUSA Mention)

Manual exploratory testing is invaluable for catching UX friction and unexpected behavior that scripted tests miss. Autonomous exploration platforms can complement manual effort by automatically exercising the app with varied user personas, surfacing crashes, ANRs, dead ends, and accessibility violations without any test scripts.

How Autonomous Exploration Works

  1. Ingestion – You upload an APK (Android) or provide a web URL.
  2. Model Building – The engine creates a state graph of screens, inputs, and navigational paths by performing taps, scrolls, text entry, and handling dialogs.
  3. Persona‑Driven Execution – Separate behavior models (curious, impatient, novice, adversarial, elderly, accessibility, power‑user) drive the exploration, varying timing, input patterns, and error‑prone actions.
  4. Issue Detection – The platform monitors for crashes, ANRs, unhandled exceptions, accessibility rule violations (WCAG 2.1 AA), security hints (e.g., clear‑text password in logs), and UX frictions (e.g., buttons that never become enabled).
  5. Regression Script Generation – After a run, the tool can export the discovered flows as Appium (Android) or Playwright (Web) test scripts, giving you a starting point for automated regression.

Integrating Designed Test Cases

Example: Using the SUSATest CLI


# Install the agent (once)
pip install susatest-agent

# Run an exploration against a locally built APK
susatest explore \
  --app ./app-debug.apk \
  --personas curious,impatient,accessibility \
  --output-dir ./susatest-run-$(date +%Y%m%d%H%M%S) \
  --export-playwright ./generated-tests

The command above:

Benefits of the Combined Approach

ApproachStrengthWeakness
Designed Test CasesPrecise verification of requirements, easy traceability, deterministicMay miss unanticipated UI states, relies on tester imagination
Autonomous ExplorationBroad coverage of unexpected paths, finds crashes & accessibility issues without scripts, scales with personasLess explicit verification of business rules, generates many low‑value paths that need filtering
CombinedHigh‑confidence requirement validation + real‑world robustness discoveryRequires effort to merge and maintain both sets, but tools like SUSATest automate the merge step

In practice, a team might run the designed test suite on every commit (fast feedback) and schedule a nightly autonomous exploration to catch regressions that only appear under unusual usage patterns.

Worked Example: 20+ Test Cases for Registration Flow (Matrix)

Below is a comprehensive table that you can copy into a test management tool. Each row includes ID, title, preconditions, steps, and expected result. The table is deliberately detailed to serve as a reference for both manual execution and automation seed data.

IDTitlePreconditionsStepsExpected Result
REG‑001Successful registration with minimum required fieldsApp installed, device online, no existing account for testuser+@example.com1. Launch app → Register screen
2. Enter testuser+12345@example.com in Email field
3. Enter SecureP@ss1! in Password field
4. Tap Terms checkbox
5. Tap Submit button
Account created, server returns HTTP 201 with {status:"pending_verification"}, user navigated to email‑verification screen
REG‑002Registration with optional first and last nameSame as REG‑0011‑4 as REG‑001
5. Enter Ada in First Name field
6. Enter Lovelace in Last Name field
7. Tap Submit
Account created, profile stores first name Ada and last name Lovelace (verified via GET /users/{id})
REG‑003Registration using Google SSODevice has a valid Google account, internet available1. Launch app → Register screen
2. Tap “Continue with Google”
3. Choose test Google account
4. Accept permissions
Account linked to Google email, server returns HTTP 200 with {provider:"google"}, user lands on home screen
REG‑004Registration with Facebook SSO (cancel flow)Facebook app installed, test FB account available1. Launch app → Register screen
2. Tap “Continue with Facebook”
3. Tap Cancel on FB login dialog
User remains on Register screen, no account created, no error shown
REG‑005Registration with password exactly at minimum lengthPolicy: min 8 chars1. Fill email testuser+999@example.com
2. Password Ab1!defg (8 chars)
3. Accept terms
4. Submit
Account created, password accepted
REG‑006Registration with password at maximum allowed lengthPolicy: max 64 chars1. Generate 64‑char password meeting policy
2. Fill other fields as REG‑001
3. Submit
Account created, password stored correctly (verify via API that length is 64)
REG‑007Registration with email at maximum local‑part length (64 chars)RFC limit1. Create local part a repeated 64 times → aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@example.com
2. Fill password ValidPass1!
3. Submit
Account created, email stored exactly as entered
REG‑008Registration with email at maximum domain length (255 chars)RFC limit1. Use domain b. repeated 84 times + c.com (total 255)
2. Email test@
3. Submit
Account created, domain stored correctly
REG‑009Registration with leading/trailing spaces in email (should be trimmed)App trims whitespace1. Email testuser+space@example.com (spaces before/after)
2. Password ValidPass1!
3. Submit
Account created with email testuser+space@example.com (spaces removed)
REG‑010Registration with only spaces in password (should be rejected)Password policy requires non‑space chars1. Email testuser+nospace@example.com
2. Password (three spaces)
3. Submit
Error: “Password must contain at least one letter or number”
REG‑011Registration with duplicate email (negative)Pre‑existing account for dup@example.com1. Email dup@example.com
2. Password DupPass1!
3. Submit
Inline error: “An account with this email already exists”, no new account created
REG‑012Registration with missing email (blank)Required field1. Leave Email empty
2. Fill Password ValidPass1!
3. Accept terms
4. Submit
Email field highlighted, error: “Email is required”
REG‑013Registration with missing passwordRequired field1. Email testuser+nomail@example.com
2. Leave Password empty
3. Accept terms
4. Submit
Password field highlighted, error: “Password is required”
REG‑014Registration without accepting termsTerms checkbox required1. Fill Email testuser+noterms@example.com
2. Fill Password ValidPass1!
3. Leave Terms unchecked
4. Submit
Submit button disabled or error: “You must accept the Terms of Service”
REG‑015Registration with SQL injection attempt in emailInput sanitization1. Email test' OR '1'='1@example.com
2. Password ValidPass1!
3. Submit
Error: “Please enter a valid email address” (no SQL executed)
REG‑016Registration with XSS attempt in first nameOutput encoding1. First name
2. Last name Test
3. Email testuser+xss@example.com
4. Password ValidPass1!
5. Submit
Account created, script stored as plain text; when profile page renders, script is escaped and not executed
REG‑017Registration with emoji‑only passwordPolicy requires alphanumeric/special1. Email testuser+emoji@example.com
2. Password 😀😃😄😁
3. Submit
Error: “Password must contain at least one letter or number”
REG‑018Registration with Unicode characters in name (UTF‑8)Supports internationalenames1. First name Αλέξανδρος (Greek)
2. Last name Животин (Cyrillic)
3. Email testuser+unicode@example.com
4. Password ValidPass1!
5. Submit
Account created, names stored and retrieved correctly (no garbling)
REG‑019Registration after network loss mid‑formApp handles offline gracefully1. Fill Email testuser+offline@example.com
2. Fill Password ValidPass1!
3. Disable Wi‑Fi
4. Tap Submit
App shows toast: “No internet connection. Please check your network and try again.”, no account created
REG‑020Registration with rapid double‑tap on Submit (race condition)Prevent duplicate submissions1. Fill valid fields
2. Tap Submit button twice within 200 ms
Only one account creation request sent, second tap ignored or shows “Please wait” indicator
REG‑021Registration with accessibility tools enabled (TalkBack)Screen reader active1. Enable TalkBack
2. Navigate to Email field via swipe‑right
3. Double‑tap to activate, enter testuser+tb@example.com
4. Move to Password field, enter ValidPass1!
5. Activate Terms checkbox
6. Activate Submit button
Form completes successfully; TalkBack announces each field label, error messages, and success toast
REG‑022Registration with font size set to 200 % (large text)Layout respects scaling1. Set system font size to 200 %
2. Launch Register screen
3. Verify all fields and buttons are fully visible and tappable
4. Complete registration with valid data
No clipping, all elements readable, registration succeeds
REG‑023Registration under CPU throttling (50 % of normal)App remains responsive1. Enable CPU throttling in developer options
2. Fill valid registration data
3. Submit
Registration completes within acceptable time (< 5 s), no ANR
REG‑024Registration with battery saver onBackground restrictions do not block UI1. Enable battery saver
2. Fill valid data
3. Submit
Registration succeeds, no delayed UI updates
REG‑025Registration with concurrent attempts from two devices (same email)Backend prevents race1. On Device A: fill email race@example.com, password PassA1!
2. On Device B: fill same email, password PassB1!
3. Submit both within 1 second
Only one account created (whichever reaches server first); second device receives error: “Account already exists”
REG‑026Registration with terms link opening in webviewTerms UI functional1. Tap Terms text link
2. Webview loads terms page
3. Scroll to bottom, tap “I Agree” (if provided) or close webview
4. Submit registration
Registration proceeds; terms acceptance recorded
REG‑027Registration with invalid phone number (if phone field present)Phone validation1. Fill Email testuser+phone@example.com
2. Fill Password ValidPass1!
3. Phone 123 (too short)
4. Submit
Error: “Please enter a valid phone number”
REG‑028Registration with valid international phone numberAccepts E.164 format1. Phone +1 555 123 4567 (US)
2. Complete rest as REG‑001
3. Submit
Account created, phone stored in E.164 format
REG‑029Registration with password containing only repeated character (e.g., aaaaaaaa)Prevents weak patterns1. Password aaaaaaaa
2. Submit
Error: “Password is too weak; try a stronger combination”
REG‑030Registration with password that matches common breached listBlocks known compromised credentials1. Password Password123! (assume in breach list)
2. Submit
Error: “This password has appeared in a data breach; choose another”

*The table above contains 30 test cases; you can trim or expand based on your product’s scope.*

Checklist for Reviewing Registration Flow Test Cases

Before you consider a test case is promoted to the test suite, run through this short checklist to guarantee quality and usefulness.

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free