Appium Demo
March 24, 2026 · View on GitHub
This example project demonstrates how to write mobile tests with @zosmaai/zosma-qa-appium. The tests show the API patterns, test helpers, and project structure for a React Native app.
Note: These example tests are for demonstration purposes. To run them against a real app, you'll need Appium installed, a simulator/emulator running, and the app built and deployed.
Prerequisites
-
Node.js >= 18
-
Appium >= 2.0:
npm install -g appium appium driver install xcuitest # iOS appium driver install uiautomator2 # Android -
iOS: Xcode + Xcode Command Line Tools
-
Android: Android Studio + Android SDK +
ANDROID_HOMEset
Project Structure
examples/appium-demo/
├── tests/
│ ├── login.appium.ts ← Login flow tests
│ ├── navigation.appium.ts ← Tab and screen navigation tests
│ └── profile.appium.ts ← User profile tests
├── zosma.config.ts ← zosma-qa config (plugins: ['appium'])
├── package.json
└── README.md ← this file
Running the Examples
1. Install dependencies
cd examples/appium-demo
npm install
2. Start Appium
appium
3. Launch a simulator
# iOS
xcrun simctl boot "iPhone 15"
# Android
emulator -avd Pixel_7_API_34
4. Build and install your app on the simulator
# React Native (iOS)
npx react-native run-ios
# React Native (Android)
npx react-native run-android
5. Run the tests
npx zosma-qa run
What the Tests Demonstrate
tests/login.appium.ts
- Filling text inputs by
testID - Tapping buttons
- Asserting visible text after navigation
- Error state validation
- Using
beforeEachhooks for test isolation
tests/navigation.appium.ts
- Tab bar navigation
- Screen transitions
- Waiting for elements to appear
- Swipe gestures
- Back navigation
tests/profile.appium.ts
- Reading element text
- Scrolling to off-screen elements
- Taking screenshots
- Raw WebDriver access via
driver.$()escape hatch
Adapting for Your App
- Update
zosma.config.tswith your app's base URL - Replace
testIDvalues with your app's actual test IDs - Update assertions to match your app's UI text
- Add additional test files following the
.appium.tsnaming pattern
Learn More
- Getting Started with Appium — full setup guide
- Appium Package README — API reference
- Getting Started with Playwright — web testing