How to Write Test Cases for Settings Page (With Examples)

How to Write Test Cases for Settings Page (With Examples)

June 11, 2026 · 18 min read · How-To Guides

How to Write Test Cases for Settings Page (With Examples)

A settings page is often the hub where users adjust preferences, manage accounts, toggle features, and control privacy. Because it touches almost every aspect of an application, defects here can erode trust, cause data loss, or block core workflows. Writing effective test cases for this page requires a systematic approach that captures positive verification, negative validation, edge‑condition probing, and traceability to requirements. This guide walks you through the anatomy of a solid test case, provides a concrete matrix of 20+ examples, shows how to prioritize and maintain traceability, and explains how autonomous exploration (e.g., with SUSA) complements manual design to achieve real coverage.

Understanding the Settings Page Test Scope

Before writing any test case, you need to decompose the settings page into its functional domains. Most settings pages share common categories, though the exact labels vary by product. Identifying these categories helps you ensure that no area is overlooked and gives you a natural way to group test cases.

Common UI Elements and Interaction Patterns

Each of these elements can be exercised with a set of generic test ideas: verify default state, verify state change persists after navigation, verify invalid input is rejected, verify required fields are enforced, and verify that the UI reflects the underlying model instantly.

Functional Areas to Cover

  1. Account & Profile – username, email, password, profile picture, linked social accounts.
  2. Preferences & Appearance – theme, language, font size, layout density, orientation lock.
  3. Notifications – global toggle, per‑channel switches, sound/vibration, do‑not‑disturb schedule.
  4. Privacy & Security – two‑factor auth, login sessions, data export/delete, app permissions, ad personalization.
  5. Data & Storage – cache clearing, download location, sync frequency, backup/restore.
  6. Advanced / Developer – API keys, webhook URLs, debug logging, feature flags, experimental options.
  7. Legal & About – terms of service, license attributions, version number, support contact.

By mapping each of these areas to the UI elements listed above, you create a matrix that guides test case creation. For example, the “Account & Profile” area will involve text fields (username, email), a password field with strength meter, a file picker for avatar upload, and a button to save changes.

Anatomy of a Test Case

A well‑structured test case makes it easy to review, automate, and maintain. While templates vary, the following fields are essential for settings‑page testing.

FieldDescription
IDUnique identifier (e.g., SET-001). Use a prefix that indicates the module (SET for settings) and a sequential number.
TitleConcise, action‑oriented sentence that states what is being verified (e.g., “Verify that toggling ‘Dark Mode’ persists after app restart”).
PreconditionsRequired state before execution: user logged in, specific account type, device orientation, network condition, or any feature flags that must be on/off.
StepsNumbered, imperative actions the tester (or script) performs. Each step should be atomic and observable. Include any data entry values.
Expected ResultClear, observable outcome after the final step. Avoid vague phrases like “the system behaves correctly”; instead state the exact UI change, API call, or database state.
Postconditions (optional)Any cleanup needed to return the system to a neutral state (e.g., resetting a toggle, deleting a test‑created file). Helpful for maintaining isolation between tests.
PriorityCategorization (P0‑critical, P1‑high, P2‑medium, P3‑low) based on risk, user impact, and likelihood of failure.
TraceabilityLink to the source requirement, user story, or design spec (e.g., US-1123: User can switch theme). If you use a test‑management tool, store this as a custom field or tag.

Including postconditions is especially valuable for settings tests because many actions mutate persistent state; failing to reset can cause cascading false positives in later tests.

Positive Test Cases

Positive test cases verify that the settings page works as intended when users follow the happy path. Below is a table of 12 representative cases covering the most common functional areas. Feel free to extend or adapt them to your product’s specific UI.

IDTitlePreconditionsStepsExpected Result
SET-001Verify default theme is Light on first launchFresh install, no prior settings saved1. Launch app.
2. Navigate to Settings → Appearance.
The “Theme” selector shows “Light” selected; the UI background is light.
SET-002Toggle Dark Mode persists after app restartUser logged in, currently on Light theme1. Open Settings → Appearance.
2. Switch “Dark Mode” toggle to ON.
3. Press Save (if applicable).
4. Close app completely.
5. Re‑launch app and navigate to Settings → Appearance.
Dark Mode toggle remains ON; UI appears in dark theme.
SET-003Change display name updates immediately in profile headerUser logged in, profile shows “Old Name”1. Go to Settings → Account → Profile.
2. Tap the display name field.
3. Enter “New Name”.
4. Press Save.
5. Return to home screen.
The profile header now shows “New Name”. No error toast appears.
SET-004Upload a valid avatar image and see it reflectedUser logged in, avatar placeholder visible1. Settings → Account → Profile → Change Avatar.
2. Choose a PNG file ≤2 MB from device gallery.
3. Confirm selection.
4. Wait for upload completion indicator.
The new avatar appears in the profile picture circle; no error message.
SET-005Enable two‑factor authentication (2FA) and verify prompt on next loginUser logged in, 2FA disabled, phone number verified1. Settings → Privacy & Security → Two‑Factor Auth.
2. Toggle 2FA ON.
3. Enter the verification code sent to phone.
4. Press Confirm.
5. Log out and log back in with credentials.
After entering username/password, the app prompts for the 2FA code; successful login follows correct code entry.
SET-006Set custom notification sound and hear it on a test notificationUser logged in, notification permission granted1. Settings → Notifications → Sound.
2. Choose “Custom” and select a short audio file from storage.
3. Save.
4. Trigger a test notification (e.g., via “Send test alert” button).
The test notification plays the selected custom sound.
SET-007Adjust font size slider and verify text scales in Settings screen itselfUser logged in, default font size = Medium1. Settings → Appearance → Font Size.
2. Move slider to Large.
3. Observe UI elements without leaving the screen.
All readable text (labels, toggles, description) increases proportionally; no clipping or overlap.
SET-008Change language to Spanish and verify all Settings labels translateUser logged in, current language = English1. Settings → General → Language.
2. Select “Español”.
3. Confirm if prompted.
4. Observe the Settings screen without navigating away.
All visible labels, placeholders, and button texts appear in Spanish; no English remnants.
SET-009Set download location to external SD card and verify new files store thereDevice has an mounted SD card with write permission; user logged in1. Settings → Data & Storage → Download Location.
2. Choose “SD Card”.
3. Save.
4. Initiate a download (e.g., save a webpage or attachment).
The downloaded file appears in the selected folder on the SD card; internal storage remains unchanged for that file.
SET-010Clear cache and confirm storage usage dropsUser logged in, app shows non‑zero cache size (e.g., 150 MB)1. Settings → Data & Storage → Clear Cache.
2. Confirm the action when prompted.
3. Re‑open Settings → Data & Storage to view cache size.
Cache size reads 0 MB (or a negligible value); a toast confirms “Cache cleared”.
SET-011Reset all settings to defaults and verify each toggle returns to factory stateUser logged in, multiple settings customized (theme, notifications, etc.)1. Settings → Advanced → Reset to Defaults.
2. Confirm the reset dialog.
3. Navigate through each settings subsection and observe values.
Every toggle, selector, and input returns to the documented default values; custom data (e.g., avatar, name) remains unchanged unless the reset explicitly includes profile data.
SET-012Save API key in Developer settings and verify it is masked on re‑openUser logged in, developer options enabled1. Settings → Developer → API Key.
2. Enter a test key abcdef123456.
3. Save.
4. Leave the screen and return to Developer → API Key.
The field displays a masked value (e.g., **** or shows only the last four characters); the actual key is stored securely and usable by the app’s backend calls.

These cases give you a solid baseline. Each one can be automated with UI‑driven tools (Appium for mobile, Playwright for web) or executed manually during exploratory sessions.

Negative Test Cases

Negative testing ensures the settings page gracefully handles invalid input, unexpected states, and misuse. The following table lists 12 negative scenarios, each with a clear expected failure mode.

IDTitlePreconditionsStepsExpected Result
SETN-001Attempt to set display name with only spacesUser logged in, profile shows “ValidName”1. Settings → Account → Profile → Edit display name.
2. Enter five space characters.
3. Press Save.
Save button remains disabled or shows an inline error: “Name cannot be blank”. No change to the name.
SETN-002Enter display name exceeding maximum length (e.g., 150 chars)User logged in1. Settings → Account → Profile → Edit display name.
2. Paste a string of 151 characters.
3. Press Save.
Input is truncated to the allowed maximum or an error appears: “Name too long (max 150)”. The name is not saved beyond the limit.
SETN-003Upload an avatar file with unsupported format (e.g., .pdf)User logged in1. Settings → Account → Profile → Change Avatar.
2. Choose a PDF file.
3. Confirm.
The picker rejects the file or shows an error: “Only JPG/PNG files allowed”. No upload occurs.
SETN-004Try to enable 2FA without a verified phone numberUser logged in, phone number not verified1. Settings → Privacy & Security → Two‑Factor Auth.
2. Toggle ON.
Toggle does not switch ON; an inline message appears: “Verify your phone number first”. The 2FA setting stays OFF.
SETN-005Set notification sound to a corrupted audio fileUser logged in, permission granted1. Settings → Notifications → Sound → Custom.
2. Choose a file that is zero bytes or not a valid audio format.
3. Save.
Save is blocked or an error toast: “Invalid audio file”. The sound setting reverts to the previous valid selection.
SETN-006Attempt to set language to an unsupported locale (e.g., “xx-XX”)User logged in1. Settings → General → Language.
2. Type or select “xx-XX” if available.
3. Confirm.
The selector reverts to the last valid language or shows an error: “Language not supported”. UI language remains unchanged.
SETN-007Set download location to a read‑only folderUser logged in, device has a folder with read‑only permission1. Settings → Data & Storage → Download Location.
2. Navigate to the read‑only folder and select it.
3. Save.
Save fails with a toast: “Cannot write to selected location”. The download location remains unchanged.
SETN-008Clear cache while a background download is in progressUser logged in, a large file download started1. Pull down notification shade to see ongoing download.
2. Settings → Data & Storage → Clear Cache.
3. Confirm.
The clear cache operation is either blocked or proceeds but the ongoing download continues unaffected; no data corruption is observed. An info message may state: “Cache cleared; active downloads continue”.
SETN-009Tap Reset to Defaults then immediately change a setting before confirmation dialog appearsUser logged in, multiple settings customized1. Settings → Advanced → Reset to Defaults.
2. Before the confirmation dialog appears, quickly toggle Dark Mode ON.
3. Observe if the toggle change persists after the dialog is dismissed.
The reset dialog still appears; any changes made before confirmation are ignored once the user confirms the reset. All settings revert to defaults.
SETN-010Enter an API key with illegal characters (e.g., newline) in Developer settingsUser logged in, developer options enabled1. Settings → Developer → API Key.
2. Paste a string containing a line break (\n).
3. Press Save.
Save is disabled or shows an error: strips the newline, shows a warning “Invalid characters”, or rejects the input. The stored key remains unchanged.
SETN-011Attempt to save settings while device is offline and the setting requires server syncUser logged in, airplane mode on, setting such as “Enable cloud backup”1. Settings → Data & Storage → Cloud Backup → Toggle ON.
2. Attempt to leave the screen.
The toggle either reverts to OFF after leaving the screen or shows a banner: “Changes will sync when online”. The setting is not persisted locally until connectivity resumes.
SETN-012Rapidly toggle a switch 20 times in 2 seconds and verify final state is correctUser logged in, switch initially OFF1. Settings → Notifications → Marketing Emails.
2. Toggle the switch ON/OFF repeatedly as fast as possible.
3. Stop and observe the final state.
The switch ends in the state corresponding to the parity of toggles (even number of toggles returns to original state). No UI glitches, stuck spinner, or crash occurs.

Negative cases are crucial for uncovering validation gaps, race conditions, and UI stability issues that only manifest under stress or erroneous input.

Edge and Boundary Cases

Edge cases push the limits of data types, device capabilities, and system configurations. Boundary testing focuses on minimum/maximum values, empty states, and transitions around those limits. Below are six edge/boundary scenarios that often reveal defects missed by basic positive/negative tests.

IDTitlePreconditionsStepsExpected Result
SETE-001Set font size to the minimum allowed value (e.g., 80% of default)User logged in1. Settings → Appearance → Font Size.
2. Move slider to the leftmost position.
3. Observe text size on the Settings screen itself.
Text is visibly smaller but still legible; no clipping occurs; layout does not break.
SETE-002Set font size to the maximum allowed value (e.g., 200% of default)User logged in1. Settings → Appearance → Font Size.
2. Move slider to the rightmost position.
3. Observe text size and layout.
Text enlarges appropriately; layout may scroll vertically if needed, but no overlapping or truncation of essential controls.
SETE-003Enter a display name consisting of a single Unicode emojiUser logged in1. Settings → Account → Profile → Edit display name.
2. Paste the “😀” emoji.
3. Save.
The emoji is accepted and shown correctly in the profile header; no encoding errors.
SETE-004Attempt to upload an avatar image exactly at the size limit (e.g., 2 MB)User logged in1. Settings → Account → Profile → Change Avatar.
2. Choose a JPEG file that is exactly 2 000 000 bytes.
3. Confirm.
Upload succeeds; the image appears as the avatar; no “file too large” error.
SETE-005Set notification “Do Not Disturb” start time to 23:59 and end time to 00:01 (cross‑midnight)User logged in1. Settings → Notifications → Do‑Not‑Disturb → Schedule.
2. Set start time to 23:59.
3. Set end time to 00:01.
4. Save.
The schedule is accepted; the system interprets it as a period that spans midnight. A test notification sent at 00:00 is suppressed; one at 23:58 is not.
SETE-006Change language while a modal dialog is open (e.g., “Are you sure you want to log out?”)User logged in, a logout confirmation dialog is visible1. Trigger logout → dialog appears.
2. Without dismissing dialog, open Settings → General → Language and switch to another language.
3. Observe if the dialog text updates.
The dialog text updates to the new language instantly, demonstrating that the UI observes language changes even when a transient window is open. No crash or stale text.

These cases test the limits of UI scaling, input validation, time‑zone handling, and dynamic localization—areas where defects often escape notice until a real‑world user hits an extreme configuration.

Data Setup and Test Data Management

Reliable test execution depends on reproducible data. For settings‑page tests you often need to control the user’s account state, device configuration, and sometimes backend feature flags. Below are practical strategies for preparing and cleaning up test data.

Using Fixtures or Factory Objects

If your application exposes a test API or a local database you can manipulate, create a fixture that puts the account into a known state before each test. For example, a pseudo‑code snippet in JavaScript (using a hypothetical test harness) might look like:


// beforeEach hook
async function resetUserSettings() {
  await api.delete('/settings');          // wipe persisted settings
  await api.post('/settings/defaults');   // restore factory defaults
  await api.put('/user/profile', {
    displayName: 'TestUser',
    email: 'test@example.com',
    avatarUrl: null
  });
}

This ensures each test starts from a clean slate, eliminating cross‑test contamination.

Mocking External Services

Settings that trigger server calls (e.g., saving an API key, enabling cloud backup) should be mocked to avoid flakiness due to network latency or server downtime. Tools like MockServer, WireMock, or the built‑in networking stubs in Playwright allow you to intercept requests and return predefined responses.


// Playwright example: mock the API key endpoint
await page.route('https://api.example.com/v1/user/apikey', route => {
  route.fulfill({
    status: 200,
    contentType: 'application/json',
    body: JSON.stringify({ masked: '****abcd' })
  });
});

Handling Device‑Specific Resources

For tests that involve file uploads (avatars, custom sounds) or storage location changes, push the required files onto the device/emulator as part of the test setup. Using adb for Android:


# Push a 1.5 MB test avatar to /sdcard/Pictures/
adb push test_avatar.jpg /sdcard/Pictures/test_avatar.jpg
# Push a short audio clip for notification sound
adb push test_sound.ogg /sdcard/Notifications/test_sound.ogg

Then reference those absolute paths in your test steps. After the test, you can clean up with adb shell rm to keep the storage state consistent.

Versioning Test Data

Keep a version‑controlled directory (e.g., testdata/settings/) containing:

Tag each dataset with the corresponding test case IDs so that auditors can see exactly what data drove each verification.

Prioritization and Risk‑Based Testing

Not all settings carry equal risk. A mis‑configured dark‑mode toggle is annoying but rarely catastrophic; a flawed password‑change flow could lead to account takeover. Use a simple risk matrix to assign priority levels.

Impact \ LikelihoodRare (1)Unlikely (2)Possible (3)Likely (4)Almost Certain (5)
Critical (data loss, security breach)P1P1P0P0P0
High (core workflow blocked, major UX degradation)P2P2P1P1P0
Medium (minor inconvenience, cosmetic)P3P3P2P2P1
Low (rarely noticed, no functional effect)P3P3P3P2P1

After scoring each test case, you can sort by priority and allocate automation effort accordingly. For example:

Document the rationale for each priority in a spreadsheet or test‑management tool; this aids stakeholder communication and helps justify test‑suite size.

Traceability to Requirements

Traceability links each test case to a source artifact—user story, design spec, or regulatory requirement. This connection serves two purposes: it shows coverage and facilitates impact analysis when requirements change.

Creating a Traceability Matrix

A simple two‑column table works well:

Test Case IDLinked Requirement(s)
SET-001US-1123: Default theme is Light on first install
SET-002US-1124: Dark mode toggle persists across app launches
SET-003US-1125: User can change display name and see change instantly
SETN-001US-1126: Display name must not be blank or whitespace only
SETE-005US-1127: Do‑Not‑Disturb schedule can cross midnight
......

If you use a tool like Jira with the Xray or Zephyr add‑ons, you can add a custom field “Test Case ID” to issues and then generate a traceability report directly.

Maintaining Traceability Over Time

When a user story is updated, locate all linked test cases and review them for relevance. If a requirement is removed, either retire the associated tests or mark them as “obsolete”. Conversely, when a new story is added, create test cases early—ideally during sprint planning—so that the test base grows in lockstep with the product.

Combining Manual Test Cases with Autonomous Exploration (SUSA)

Manual test cases give you intentional, requirement‑driven coverage. Autonomous exploration tools like SUSA add a complementary layer that discovers unexpected behavior, edge cases, and regressions that scripted tests might miss.

How SUSA Works in the Context of a Settings Page

  1. Upload the APK or provide the web URL – SUSA starts with no prior knowledge of the app.
  2. Persona‑driven navigation – It simulates multiple user profiles (curious, impatient, novice, accessibility‑aware, power user, adversarial, etc.). Each persona has distinct interaction patterns: a power user may rapidly toggle switches, an accessibility user may rely on screen‑reader navigation, and an adversarial user may attempt invalid inputs.
  3. State‑aware exploration – SUSA remembers which screens it has visited, which actions led to crashes or ANRs, and which UI elements are dead ends. Over successive runs it builds a model of the app’s state graph and focuses on unexplored transitions.
  4. Real‑flow validation – While exploring, SUSA attempts to complete common flows (login, signup, changing a setting) and marks them PASS/FAIL based on observable criteria (e.g., does a toggle persist after navigation?).
  5. Regression script generation – After a run, SUSA can export the discovered sequences as Appium (Android) or Playwright (web) scripts, giving you a starting point for automated tests.

Practical Example: Using SUSA to Find a Hidden Settings Bug

Suppose your app has a “Developer Options” screen that is only revealed after tapping the build number seven times. A manual tester might forget to include this path in their test matrix. SUSA’s curious persona, which repeatedly taps visible elements, will eventually uncover the hidden toggle. During that exploration it may also try to enter an excessively long string into the newly exposed API‑key field, triggering a buffer‑overflow‑like crash that would be hard to anticipate manually.

To integrate SUSA findings into your test suite:

  1. Run SUSA on a nightly basis against a staging build.
  2. Export the generated Appium script for any flow that resulted in a FAIL.
  3. Review the script; if the failure represents a legitimate bug, convert it into a proper test case with clear ID, preconditions, and expected result.
  4. Add the test case to your regression suite and prioritize it based on the observed impact (e.g., crash → P0).

This approach ensures that your manual test cases remain the backbone of requirement validation while SUSA continuously expands coverage into the “unknown unknowns” space.

Automation Strategies

Turning the test cases from the tables above into automated scripts provides fast feedback and enables continuous integration. Below are concrete snippets for both mobile (Appium) and web (Playwright) contexts. Adjust selectors, URLs, and credentials to match your application.

Mobile Automation with Appium (Android)


// Example: SET-002 – Dark Mode persists after restart
@Test
public void testDarkModePersists() {
    // Precondition: user logged in, theme Light
    loginUser("test@example.com", "Password123");
    SettingsPage settings = new SettingsPage(driver);
    settings.openAppearance();

    // Step: enable Dark Mode
    settings.toggleDarkMode(true);
    settings.saveIfNeeded();

    // Step: restart app
    driver.resetApp(); // equivalent to close + launch
    // Re‑login if required by your app
    loginUser("test@example.com", "Password123");
    settings.openAppearance();

    // Verification
    assertTrue(settings.isDarkModeEnabled(), "Dark Mode should stay ON after restart");
    assertTrue(settings.isUiInDarkTheme(), "UI should reflect dark theme");
}

Key points:

Web Automation with Playwright (TypeScript)


// Example: SETN-001 – Display name cannot be blank
test('display name cannot be only spaces', async ({ page }) => {
  await login(page, 'test@example.com', 'Password123');
  await page.goto('/settings/profile');

  const nameInput = page.locator('input#displayName');
  await nameInput.fill('     '); // five spaces
  await page.locator('button#save').click();

  // Expect inline error message
  const error = page.locator('text=Name cannot be blank');
  await expect(error).toBeVisible();

  // Ensure the name field still contains the spaces (no change)
  await expect(nameInput).toHaveValue('     ');
});

Tips:

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