Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 37 ยท CI and Best Practices

The Mobile Test Automation Checklist

A practical checklist for Appium suites: what to automate, the mobile test pyramid, stable locators, independent tests, security, maintenance and team habits.

You now know the parts: drivers, capabilities, locators, waits, screen objects, cloud farms and CI. This lesson ties them into a set of habits that keep a suite useful for years instead of months. Think of it as a review list you can walk through when starting a project or when a suite has become painful to maintain.

Nothing here needs a device, so the lesson is about decisions. The runnable stand-ins score a suite against the checklist and help you decide which tests are worth automating.

1. Decide what to automate

UI automation is slow and costly compared with unit tests, so spend it where it pays:

  • Automate flows that run often and matter: sign-up and login, search, checkout and payment (up to the payment provider), core navigation, deep links, permission handling, upgrades from an older version.
  • Do not automate one-off checks, rapidly changing screens, pixel-level visual judgment (use a screenshot-comparison tool or manual review), and anything cheaper at a lower level.
  • Push checks down. Validation rules, calculations and API behavior belong in unit and API tests. The UI test only proves that the pieces are wired together.
flowchart TB
    U["UI end-to-end tests (Appium): few, slow, high value"]
    I["Integration and API tests: more, faster"]
    L["Unit tests: many, fastest"]
    U --- I --- L

The test pyramid: the narrower the layer, the fewer tests it should hold.

2. Score tests before you automate

A simple scoring model stops teams from automating everything:

Python Automation candidate scoring (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The formula is a rough heuristic, not science. What matters is that you discuss frequency, impact and stability before writing code.

3. Stable locators

  • Agree with developers on accessibility IDs for every interactive element (content-desc on Android, accessibilityIdentifier on iOS). They help screen-reader users too.
  • Prefer ID, accessibility ID, then iOS predicates and class chains and Android UiSelector. Use XPath last, and never with absolute paths or indexes.
  • Never locate by visible text if the app is translated, unless you also pin the language in capabilities (appium:language, appium:locale).
  • Keep all locators inside screen objects (see The Page Object Model).

4. Independent, repeatable tests

  • Every test sets up its own data and state, and can run alone, in any order, on any device.
  • Tests do not rely on a previous test's login or leftovers.
  • Reset or reinstall the app, or use a clean user, at the start of each test.
  • Fail fast with clear messages; a test name and an assertion message should explain the failure without opening a debugger.
  • One test checks one behavior. Long end-to-end journeys are valuable but keep them few.

5. Synchronization and speed

  • Explicit waits, implicit wait at 0, no sleep (see Waits and Synchronization).
  • Skip UI setup with deep links, tokens and API calls.
  • Disable animations on test devices.
  • Parallelize across devices once tests are independent.

6. Security and secrets

  • Credentials come from environment variables or a secret store, never from source files or screenshots.
  • Use dedicated test accounts and a test backend, never production data.
  • Do not enable insecure Appium features (--allow-insecure, --relaxed-security) on servers reachable by others.
  • Do not expose the Appium server port to the internet.
  • Debug builds used for automation (with WebView debugging on) must never ship.

7. Maintenance habits

  • Review test code like product code: names, structure, no copy-paste.
  • Track flake rate and fix or quarantine promptly (see Flaky Tests, Retries and Quarantine).
  • Pin versions of Appium, drivers, Node, client library and emulator images; update on a schedule.
  • Update tests in the same pull request as the UI change that breaks them.
  • Delete tests that no longer protect anything.
  • Collect evidence on every failure: screenshot, source, logs, video.

Stand-in: score your suite

Use the checklist as a scorecard. This example takes answers and prints what to improve first.

Python Suite health scorecard (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

8. Team and process

  • Developers and testers share ownership of accessibility IDs and testability hooks (a way to reset state, to seed data, to bypass login in test builds).
  • Keep a test environment stable and separate from development.
  • Decide what blocks a release: smoke tests, always; the full regression, usually; quarantined tests, never.
  • Document how to run the suite locally in a single short README so new people succeed on the first day.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Where should validation rules and calculations mostly be tested?

    Lower layers are faster and more precise; the UI layer should stay small.
  2. 2. Which locator choice is best for stability across layouts and languages?

    IDs do not change when the layout or the translation changes.
  3. 3. What should every test do about its data and state?

    Independence makes tests parallelizable and debuggable.
  4. 4. Which Appium server practice is unsafe?

    An open Appium server with insecure features lets anyone run commands on your devices.

Summary

  • Automate frequent, valuable, stable flows; keep the UI layer thin on top of unit and API tests.
  • Agree on accessibility IDs, use native locators, and keep them in screen objects.
  • Make tests independent; wait with conditions; skip UI setup; parallelize.
  • Protect secrets and servers, and pin tool versions.
  • Maintain the suite: track flakiness, delete dead tests and update tests with the app.

Next: Project: Login Flow Test Suite