How to test iOS (.ipa) and Android (.apk) mobile apps using plain English YAML tests.
ZeniTest allows you to run automated tests on iOS apps (.ipa) and Android apps (.apk) without writing native Appium or UIAutomator test code.
Prerequisites
Section titled “Prerequisites”- For Android Testing: Android Studio & SDK (
adbin PATH), an active Android Emulator or connected physical device with USB Debugging enabled, and your built.apk. - For iOS Testing: macOS, Xcode & Xcode Command Line Tools (
xcode-select --install), an active iOS Simulator or connected iPhone with Developer Mode, and your built.appor.ipa.
1. Organizing Mobile Tests
Section titled “1. Organizing Mobile Tests”Place mobile test files in zenitests/ios/ or zenitests/android/:
zenitests/├── ios/│ ├── config.yaml # Default iOS settings (optional)│ └── tc_ios_checkout.yaml└── android/ ├── config.yaml # Default Android settings (optional) └── tc_android_checkout.yamlMobile Configuration (config.yaml)
Section titled “Mobile Configuration (config.yaml)”You can set default device and app binary paths so you don’t have to type them every time:
bundlePath: build/Runner.app # .app for Simulator, .ipa for devicedevice: iPhone 15 Proparallel: 1bundlePath: build/app-debug.apkdevice: Pixel 7parallel: 12. Writing a Mobile Test
Section titled “2. Writing a Mobile Test”Mobile tests do not need a starting URL or navigate step because the app opens automatically when the test starts.
Example Android Test (zenitests/android/tc_checkout.yaml)
Section titled “Example Android Test (zenitests/android/tc_checkout.yaml)”id: tc_android_checkouttitle: Product Checkout FlowexpectedResult: Order confirmation message is displayed
steps: - act: Tap the 'Add to Cart' button on 'ZeniPods Pro' - validate: Cart badge shows '1' - act: Tap the Cart icon - validate: 'Your Cart' title and 'Proceed to Checkout' button are visible - act: Tap 'Proceed to Checkout' - validate: 'Order Placed Successfully!' is displayed3. Running Mobile Tests
Section titled “3. Running Mobile Tests”Run tests by pointing the CLI to your built .apk or .ipa app binary:
Android (.apk)
Section titled “Android (.apk)”zenitest run --platform android --bundle ./build/app-debug.apkiOS (.ipa)
Section titled “iOS (.ipa)”zenitest run --platform ios --bundle ./build/Runner.ipaTargeting a Specific Device
Section titled “Targeting a Specific Device”Use the --device flag to choose which emulator, simulator, or physical device to run on:
# Android emulatorzenitest run --platform android --bundle ./build/app-debug.apk --device "Pixel 7"
# iOS simulatorzenitest run --platform ios --bundle ./build/Runner.app --device "iPhone 15 Pro"Tip: If you set
bundlePathanddevicein yourconfig.yaml, you can simply runzenitest run --platform ioswithout any extra flags.
4. Mobile Actions & Gestures
Section titled “4. Mobile Actions & Gestures”Use natural English phrases inside act steps:
- Tapping:
Tap 'Login',Tap the Shopping Cart icon - Typing:
Type 'alex@example.com' into 'Email Address' - Scrolling:
Scroll down to see the Checkout button - Checking:
validate: Verify 'Welcome' text is visible