BDD test framework for Appium mobile testing using Cucumber.js and Page Object Model pattern.
See test-strategy.md for the complete test strategy documentation.
The framework follows a layered architecture:
- Test Layer: Cucumber feature files and step definitions
- Page Object Layer: Page classes representing app screens
- Locator Layer: Locator classes for element identification (separated from page objects)
- Driver Layer: Appium driver management and capabilities
- Support Layer: Hooks, utilities, and helpers
The framework uses a unified locator approach with a dedicated locators/ directory:
-
BaseLocators: Base class providing common locator generation methods
- Platform-agnostic text locator generation
- Resource ID and XPath locator helpers
- Supports both Android and iOS
-
Page-Specific Locators: Each page has its own locator class extending
BaseLocatorsMenuLocators: Navigation menu/drawer locatorsLoginLocators: Login page locatorsProductsLocators: Products page locators- Additional locator classes as needed
Benefits:
- Centralized locator management
- Separation of concerns (locators separate from page objects)
- Platform-agnostic locator generation
- Easy maintenance and updates
- Consistent approach across all pages
- Install dependencies:
npm install- Configure your test environment:
.config/cucumber.json- Cucumber test configuration (for test framework)
Before running tests, ensure you have the following installed:
- Node.js >= 18.17.0
- Appium 3.x (see installation instructions below)
- Android SDK (for Android testing) - See Android SDK Setup section
- Xcode (for iOS testing on macOS)
Install Appium globally:
npm install -g appiumVerify Appium installation:
appium --versionInstall Required Drivers:
For Android testing, install the UiAutomator2 driver:
appium driver install uiautomator2For iOS testing, install the XCUITest driver:
appium driver install xcuitestInstall Required Plugins:
For device management, install the device-farm plugin:
appium plugin install device-farmList installed drivers and plugins:
# List drivers
appium driver list
# List plugins
appium plugin listIMPORTANT: You must start the Appium server before running tests.
Start Appium with device-farm plugin:
# Make sure ANDROID_HOME or ANDROID_SDK_ROOT is set first!
appium server --use-plugins=device-farm --plugin-device-farm-platform=androidNote: The device-farm plugin works for both Android and iOS. For iOS-only testing, you can also use:
# Make sure ANDROID_HOME or ANDROID_SDK_ROOT is set first!
appium server --use-plugins=device-farm --plugin-device-farm-platform=iosCheck Available Devices:
Once Appium server is running, you can view available devices in your browser:
This page shows all connected devices, emulators, and simulators that Appium can use for testing.
Keep the Appium server terminal window open while running tests.
Before running tests, verify your device exists:
xcrun simctl list devices available | grep iPhoneIf your device doesn't exist, you may need to create it or update your configuration.
npm testOr run a specific feature:
npm test -- features/open-app.featureOr with specific tags:
npm test -- --tags "@your-tag"The project includes a .vscode/launch.json configuration file for running and debugging Cucumber tests directly in VS Code.
The .vscode/launch.json file contains a debug configuration that runs tests with the @login tag:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run Tests",
"program": "${workspaceFolder}/node_modules/@cucumber/cucumber/bin/cucumber-js",
"args": [
"--require",
"lib/support/**/*.js",
"--require",
"lib/step-definitions/**/*.js",
"--format",
"json:reports/cucumber_report.json",
"--tags",
"@login"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": ["<node_internals>/**"],
"env": {
"NODE_ENV": "test"
}
}
]
}-
Prerequisites:
- Ensure Appium server is running (see "Start Appium Server" section above)
- Ensure your emulator/simulator is started and connected
- Verify device is visible at http://127.0.0.1:4723/device-farm/
-
Run Tests:
- Open VS Code in the project directory
- Go to the Run and Debug panel:
- Press
Ctrl+Shift+D(Windows/Linux) orCmd+Shift+D(macOS) - Or click the "Run and Debug" icon in the sidebar
- Press
- Select "Run Tests" from the configuration dropdown
- Click the green play button
▶️ or pressF5 - Tests will run in the integrated terminal
-
Debug Tests (with Breakpoints):
- Set breakpoints in your code by clicking in the gutter next to line numbers
- Breakpoints can be set in:
- Step definition files (
lib/step-definitions/*.js) - Page object files (
lib/pages/*.js) - Support files (
lib/support/*.js) - Driver manager (
lib/driver/*.js)
- Step definition files (
- Select "Run Tests" from the debug configuration dropdown
- Press
F5to start debugging - The debugger will pause at your breakpoints when code is executed
You can customize the launch configuration to run different tests by modifying the args array in .vscode/launch.json:
Run All Tests:
Remove the --tags argument:
"args": [
"--require",
"lib/support/**/*.js",
"--require",
"lib/step-definitions/**/*.js",
"--format",
"json:reports/cucumber_report.json"
]Run Specific Feature File: Add the feature file path:
"args": [
"--require",
"lib/support/**/*.js",
"--require",
"lib/step-definitions/**/*.js",
"--format",
"json:reports/cucumber_report.json",
"features/login.feature"
]Run Tests with Different Tags:
Change the --tags value:
"args": [
"--require",
"lib/support/**/*.js",
"--require",
"lib/step-definitions/**/*.js",
"--format",
"json:reports/cucumber_report.json",
"--tags",
"@shopping"
]Run Multiple Tags: Use comma-separated tags:
"--tags",
"@login and @android"Add Multiple Configurations:
You can add multiple configurations to the configurations array for different test scenarios:
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Tests (@login)",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/@cucumber/cucumber/bin/cucumber-js",
"args": [
"--require", "lib/support/**/*.js",
"--require", "lib/step-definitions/**/*.js",
"--format", "json:reports/cucumber_report.json",
"--tags", "@login"
],
"console": "integratedTerminal",
"env": { "NODE_ENV": "test" }
},
{
"name": "Run All Tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/@cucumber/cucumber/bin/cucumber-js",
"args": [
"--require", "lib/support/**/*.js",
"--require", "lib/step-definitions/**/*.js",
"--format", "json:reports/cucumber_report.json"
],
"console": "integratedTerminal",
"env": { "NODE_ENV": "test" }
},
{
"name": "Run Login Feature",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/@cucumber/cucumber/bin/cucumber-js",
"args": [
"--require", "lib/support/**/*.js",
"--require", "lib/step-definitions/**/*.js",
"--format", "json:reports/cucumber_report.json",
"features/login.feature"
],
"console": "integratedTerminal",
"env": { "NODE_ENV": "test" }
}
]
}- Appium Server Required: Make sure Appium server is running before starting tests from VS Code
- Device Connection: Ensure your emulator/simulator is started and visible at http://127.0.0.1:4723/device-farm/
- Configuration Files: The launch configuration uses the same
.config/files as command-line execution - Environment Variables: You can add environment variables to the
envobject in the launch configuration - Output: Test results are saved to
reports/cucumber_report.jsonas configured
-
Start Appium server in a terminal:
appium server --use-plugins=device-farm --plugin-device-farm-platform=android
-
Start your emulator/simulator
-
In VS Code, open
lib/step-definitions/login-steps.js -
Set a breakpoint by clicking in the gutter next to a line number
-
Go to Run and Debug panel (
Ctrl+Shift+D/Cmd+Shift+D) -
Select "Run Tests" from the dropdown
-
Press
F5to start debugging -
The debugger will pause at your breakpoint when that code executes
-
Use the debug toolbar to:
- Continue (
F5) - Step Over (
F10) - Step Into (
F11) - Step Out (
Shift+F11) - Restart (
Ctrl+Shift+F5/Cmd+Shift+F5) - Stop (
Shift+F5)
- Continue (
.
├── .config/ # Configuration files
│ ├── cucumber.json # Cucumber test configuration
│ ├── appium.json # Appium server settings
│ └── device.json # Device matrix configuration
├── features/ # Cucumber feature files
│ ├── login.feature # Login test scenarios
│ ├── shopping-flow.feature # Shopping flow scenarios
│ └── edge-cases.feature # Edge case scenarios
├── lib/ # Framework libraries
│ ├── driver/ # Driver management
│ │ ├── DriverManager.js
│ │ └── capabilities.js
│ ├── locators/ # Locator classes (Page Object Model)
│ │ ├── BaseLocators.js # Base locator class with common methods
│ │ ├── MenuLocators.js # Navigation menu locators
│ │ ├── LoginLocators.js # Login page locators
│ │ ├── ProductsLocators.js # Products page locators
│ │ └── [Page]Locators.js # Other page-specific locators
│ ├── pages/ # Page Object Model
│ │ ├── BasePage.js
│ │ ├── LoginPage.js
│ │ ├── ProductsPage.js
│ │ ├── MenuPage.js
│ │ ├── CartPage.js
│ │ └── CheckoutPage.js
│ ├── step-definitions/ # Step definition files
│ │ ├── login-steps.js
│ │ ├── shopping-steps.js
│ │ ├── edge-case-steps.js
│ │ └── app-steps.js
│ ├── support/ # Cucumber support files
│ │ ├── hooks.js # Before/After hooks
│ │ └── world.js # Custom world
│ └── utils/ # Utilities and helpers
│ ├── wait.js
│ ├── screenshot.js
│ ├── gestures.js
│ ├── platform.js
│ └── deviceActions.js
├── apps/ # Application binaries
│ ├── android/ # Android APK files
│ └── ios/ # iOS app files
├── artifacts/ # Test artifacts (screenshots, page sources on failure)
└── reports/ # Test reports (JSON and HTML)
- Android Emulator or physical device
- Minimum Android version: 8.0 (API level 26)
- Recommended: Android 10+ (API level 29+)
- App file:
apps/android/mda-2.2.0-25.apk
- iOS Simulator or physical device
- Minimum iOS version: 14.3
- Recommended: iOS 15+
- App file:
apps/ios/SauceLabs-Demo-App.apporapps/ios/SauceLabs-Demo-App.ipa
-
Android Emulator:
# List available emulators emulator -list-avds # Start an emulator emulator -avd <avd_name>
-
iOS Simulator:
# List available simulators xcrun simctl list devices available # Boot a simulator xcrun simctl boot <device_id>
-
Verify Device Connection:
# Android adb devices # iOS xcrun simctl list devices
4. **Check Devices via Device Farm:**
- Start Appium server with device-farm plugin
- Open http://127.0.0.1:4723/device-farm/ in your browser
- View all available devices, emulators, and simulators
## Configuration
The framework uses three configuration files located in the `.config/` directory. These files are automatically loaded by the framework and should be properly configured to avoid issues.
### Configuration Files Overview
- **`.config/cucumber.json`** - Cucumber test framework settings (timeouts, environment, screenshots)
- **`.config/appium.json`** - Appium server connection settings (hostname, port, timeouts)
- **`.config/device.json`** - Target device configuration (platform, device name, app path, capabilities)
### How to Use Configuration Files
#### 1. `.config/device.json` - Device Configuration
This file defines the target device and app for testing. **This is the most important configuration file** and must be set correctly.
**Example for Android:**
```json
{
"platform": "Android",
"platformVersion": "16.0",
"deviceName": "Pixel_9",
"automationName": "UiAutomator2",
"app": "/absolute/path/to/apps/android/mda-2.2.0-25.apk"
}
Example for iOS:
{
"platform": "iOS",
"platformVersion": "15.0",
"deviceName": "iPhone Simulator",
"automationName": "XCUITest",
"app": "/absolute/path/to/apps/ios/SauceLabs-Demo-App.app"
}Important Notes:
- Use absolute paths for the
appfield (not relative paths) - The
deviceNamemust match an actual device/emulator name (check viaadb devicesorxcrun simctl list devices) - The
platformVersionshould match your device's OS version - For Android,
automationNameshould be"UiAutomator2" - For iOS,
automationNameshould be"XCUITest"
Platform Override Priority:
- Options passed directly to driver (highest priority)
PLATFORMenvironment variable:PLATFORM=android npm testorPLATFORM=ios npm testplatformfield indevice.json- Automatic platform detection (lowest priority)
Common Issues:
- ❌ Wrong app path: Use absolute path, verify file exists
- ❌ Device name mismatch: Device name must exist and be booted
- ❌ Platform version mismatch: Version must match your device's OS
- ❌ Relative paths: Always use absolute paths for app location
This file configures the connection to the Appium server.
Example:
{
"hostname": "127.0.0.1",
"path": "/",
"port": 4723,
"logLevel": "error",
"timeout": 10,
"headless": false,
"usePreinstalledWDA": true,
"videoPath": "./reports",
"devicefarm-hostname": {
"local": "127.0.0.1"
}
}Configuration Fields:
hostname: Appium server hostname (default:127.0.0.1for local)port: Appium server port (default:4723)path: WebDriver endpoint path (default:/)logLevel: Logging level (error,warn,info,debug)timeout: Connection timeout in secondsdevicefarm-hostname: Device farm plugin hostname configuration
Important Notes:
- The
portmust match the port where Appium server is running - If using device-farm plugin, ensure
devicefarm-hostname.localmatches your server - For remote Appium servers, update
hostnameaccordingly
Common Issues:
- ❌ Port mismatch: Port in config must match Appium server port
- ❌ Connection refused: Verify Appium server is running on specified hostname:port
- ❌ Timeout errors: Increase
timeoutvalue if connection is slow
This file configures Cucumber test execution settings.
Example:
{
"env": "test",
"stack": "",
"screenshots": "onfail",
"video": false,
"videoPath": "./reports",
"timeout": 900,
"apitimeout": 180,
"version": "1.0.0"
}Configuration Fields:
timeout: Step timeout in seconds (default:900= 15 minutes)apitimeout: API call timeout in seconds (default:180= 3 minutes)screenshots: When to take screenshots ("onfail","always","never")video: Enable video recording (default:false)videoPath: Directory for video files (default:"./reports")env: Environment name (default:"test")
Important Notes:
timeoutis in seconds and applies to each Cucumber step- Screenshots are automatically saved to
artifacts/directory on failure - Increase
timeoutif tests are timing out on slow devices - Set
screenshots: "always"to capture screenshots for all steps (useful for debugging)
Common Issues:
- ❌ Step timeout errors: Increase
timeoutvalue for slow operations - ❌ Missing screenshots: Verify
screenshotsis set to"onfail"or"always" - ❌ API timeout: Increase
apitimeoutfor slow network operations
- Always use absolute paths for app files in
device.json - Verify device names match actual devices before running tests
- Check Appium server is running on the configured hostname:port
- Test configuration by running a simple test before full test suite
- Keep config files in version control but use environment variables for sensitive data
- Validate JSON syntax - invalid JSON will cause framework to fail
Before running tests, verify your configuration:
# Check if device.json is valid JSON
cat .config/device.json | jq .
# Check if appium.json is valid JSON
cat .config/appium.json | jq .
# Check if cucumber.json is valid JSON
cat .config/cucumber.json | jq .
# Verify app path exists (for device.json)
# Replace with your app path from device.json
ls -la /path/to/your/app.apk # Android
ls -la /path/to/your/app.app # iOS| Issue | Solution |
|---|---|
| "Cannot find module '@nodebug/config'" | Run npm install to install dependencies |
| "Invalid JSON in config file" | Validate JSON syntax with jq or JSON validator |
| "App path not found" | Use absolute path and verify file exists |
| "Device not found" | Verify device name matches actual device and is booted |
| "Connection refused" | Check Appium server is running on configured hostname:port |
| "Step timeout" | Increase timeout value in cucumber.json |
| "Platform not supported" | Verify platform is exactly "Android" or "iOS" (case-sensitive) |
# Run login tests only
npm test -- --tags "@login"
# Run shopping flow tests
npm test -- --tags "@shopping"
# Run edge case tests
npm test -- --tags "@edge-case"
# Run Android-specific tests
npm test -- --tags "@android"
# Run iOS-specific tests
npm test -- --tags "@ios"-
Install Dependencies:
npm install
-
Android SDK Setup (Required for Android Testing):
IMPORTANT: You must set the
ANDROID_HOMEorANDROID_SDK_ROOTenvironment variable before running Android tests or starting Appium with the device-farm plugin for Android.Quick Setup (Recommended):
Run the automated setup script:
npm run setup:android-sdk
This script will:
- Automatically detect your Android SDK installation
- Add
ANDROID_HOMEandANDROID_SDK_ROOTto your shell profile - Add Android SDK tools to your PATH
- Provide instructions to apply the changes
After running the script, reload your shell:
source ~/.zshrc # for zsh # or source ~/.bash_profile # for bash
Manual Setup (Alternative):
First, locate your Android SDK installation. Common locations:
~/Library/Android/sdk(macOS, default for Android Studio)~/Android/Sdk(Linux, default for Android Studio)- Or wherever you installed Android Studio/SDK
Then, add these lines to your shell profile (
~/.zshrcfor zsh or~/.bash_profilefor bash):export ANDROID_HOME=$HOME/Library/Android/sdk export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin
After adding, reload your shell configuration:
source ~/.zshrc # or source ~/.bash_profile
For Windows:
Common SDK location:
C:\Users\YourName\AppData\Local\Android\SdkSet environment variables via System Properties:
- Open System Properties → Environment Variables
- Add new System Variable:
- Variable name:
ANDROID_HOME - Variable value:
C:\Users\YourName\AppData\Local\Android\Sdk
- Variable name:
- Edit
Pathvariable and add:%ANDROID_HOME%\platform-tools%ANDROID_HOME%\tools%ANDROID_HOME%\tools\bin
Verify Installation:
# Check if ANDROID_HOME is set echo $ANDROID_HOME # macOS/Linux echo %ANDROID_HOME% # Windows # Verify ADB is accessible adb version
Alternative: Use ANDROID_SDK_ROOT
If you prefer
ANDROID_SDK_ROOTinstead ofANDROID_HOME, set it the same way. The device-farm plugin accepts either variable.Troubleshooting:
- If you get "Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported", make sure:
- The environment variable is set in your shell profile (
.zshrcor.bash_profile) - You've reloaded your shell:
source ~/.zshrc(orsource ~/.bash_profile) - Or open a new terminal window
- The path points to a valid Android SDK installation
- The environment variable is set in your shell profile (
- The
npm run check:prerequisitescommand automatically loads environment variables from your shell profile, so it should work even if you haven't sourced your profile in the current session - If issues persist, run
npm run setup:android-sdkto reconfigure
-
Start Appium Server:
Start Appium with the device-farm plugin:
# Make sure ANDROID_HOME or ANDROID_SDK_ROOT is set first! appium server --use-plugins=device-farm --plugin-device-farm-platform=androidVerify Appium is running:
- Check the terminal output for "Appium REST http interface listener started"
- Open http://127.0.0.1:4723/device-farm/ in your browser to see available devices
Note: If you see an error about
ANDROID_HOMEorANDROID_SDK_ROOTnot being set, refer to the Android SDK Setup section above. -
Start Device/Emulator:
- Android: Start an emulator or connect a physical device
- iOS: Boot a simulator or connect a physical device
- Verify devices are visible at http://127.0.0.1:4723/device-farm/
-
Run Tests:
# Run all tests npm test # Run specific feature npm test -- features/login.feature # Run with tags npm test -- --tags "@login"
After running tests, you can view the generated reports to analyze test results, failures, and execution details.
The framework generates two types of reports:
- JSON Report (
reports/cucumber_report.json) - Machine-readable test results - HTML Report (
reports/cucumber_report.html) - Human-readable visual report
The HTML report is automatically generated after test execution completes. It provides a visual, interactive view of your test results.
Location:
reports/cucumber_report.html
How to View:
-
Open in Browser:
# macOS open reports/cucumber_report.html # Linux xdg-open reports/cucumber_report.html # Windows start reports/cucumber_report.html
-
Or manually navigate:
- Open your file browser
- Navigate to the
reports/directory in your project - Double-click
cucumber_report.html
What's Included in HTML Report:
- Test execution summary (passed/failed/skipped scenarios)
- Detailed step-by-step results for each scenario
- Execution time for each step and scenario
- Screenshots (if tests failed and screenshots were captured)
- Metadata (App Version, Test Environment, Platform, Execution Date)
- Feature and scenario organization
Report Generation:
- The HTML report is automatically generated when the test process exits
- If the JSON file is missing or invalid, the HTML report will not be generated
- Check the console output for any report generation errors
The JSON report contains the raw test execution data in machine-readable format.
Location:
reports/cucumber_report.json
How to View:
-
View in Terminal:
cat reports/cucumber_report.json
-
Pretty Print JSON:
cat reports/cucumber_report.json | jq .
-
View in Code Editor:
- Open
reports/cucumber_report.jsonin your preferred code editor - Most editors provide JSON syntax highlighting
- Open
JSON Report Structure: The JSON report is an array of feature objects, each containing:
- Feature metadata (name, description, tags)
- Scenarios with their steps
- Step results (status, duration, error messages if failed)
- Attachments (screenshots, page sources)
Example JSON Structure:
[
{
"uri": "features/login.feature",
"id": "login",
"keyword": "Feature",
"name": "Login",
"line": 1,
"description": "",
"elements": [
{
"id": "login;success-login-with-valid-credentials",
"keyword": "Scenario",
"name": "Success login with valid credentials",
"line": 7,
"steps": [...]
}
]
}
]Verify Report Files Exist:
# Check if reports directory exists
ls -la reports/
# Check JSON report
ls -lh reports/cucumber_report.json
# Check HTML report
ls -lh reports/cucumber_report.htmlCheck Report File Size:
# JSON report should have content (not 0 bytes)
du -h reports/cucumber_report.json
# HTML report should exist after successful test run
du -h reports/cucumber_report.htmlValidate JSON Report:
# Check if JSON is valid
cat reports/cucumber_report.json | jq . > /dev/null && echo "JSON is valid" || echo "JSON is invalid"
# Count scenarios in report
cat reports/cucumber_report.json | jq '.[] | .elements | length' | awk '{sum+=$1} END {print "Total scenarios:", sum}'HTML Report Not Generated:
- Check if JSON report exists and has content
- Verify JSON report is valid (not corrupted)
- Check console output for error messages
- Ensure the
reports/directory is writable
Empty or Invalid JSON Report:
- Tests may have been interrupted before completion
- Check for errors in test execution
- Verify Cucumber completed successfully
- Check file permissions on
reports/directory
Report Generation Errors:
- Check console logs for specific error messages
- Verify
cucumber-html-reporterpackage is installed - Ensure sufficient disk space in
reports/directory
In addition to reports, test artifacts are saved in the artifacts/ directory:
Screenshots:
- Location:
artifacts/ - Format: PNG files
- Naming:
failure-<scenario-name>-<timestamp>.png - Captured: Automatically on test failure (if configured)
Page Sources:
- Location:
artifacts/ - Format: XML files
- Naming:
failure-<scenario-name>-<timestamp>.xml - Captured: Automatically on test failure (if configured)
View Artifacts:
# List all artifacts
ls -la artifacts/
# View screenshots
open artifacts/*.png # macOS
xdg-open artifacts/*.png # LinuxIf you encounter issues when running tests, follow these debugging steps:
Verify Node.js version:
node --version
# Should be >= 18.17.0Verify Appium installation:
appium --version
# Should show Appium 3.x versionVerify drivers are installed:
appium driver list
# Should show uiautomator2 (for Android) and/or xcuitest (for iOS)Verify plugins are installed:
appium plugin list
# Should show device-farm pluginVerify ANDROID_HOME or ANDROID_SDK_ROOT:
echo $ANDROID_HOME # macOS/Linux
echo %ANDROID_HOME% # Windows
# Should show a valid path to Android SDKVerify ADB is accessible:
adb version
# Should show ADB version informationCheck connected Android devices:
adb devices
# Should list connected devices/emulatorsVerify Xcode is installed:
xcode-select --print-path
# Should show Xcode pathList available iOS simulators:
xcrun simctl list devices available
# Should list available simulatorsVerify Appium server is running:
- Check terminal for "Appium REST http interface listener started"
- Open http://127.0.0.1:4723/status in browser (should return JSON status)
- Open http://127.0.0.1:4723/device-farm/ to see available devices
Common Appium errors:
- "Cannot find module" → Install missing drivers/plugins (see Prerequisites section)
- "ANDROID_HOME not set" → Configure Android SDK environment variables (see Android SDK Setup)
- "No devices found" → Start an emulator/simulator or connect a physical device
For Android:
adb devices
# Should show at least one device (emulator or physical)For iOS:
xcrun simctl list devices
# Should show at least one booted simulatorVia Device Farm UI:
- Open http://127.0.0.1:4723/device-farm/
- Verify your device/emulator appears in the list
If available, run the project's prerequisite check:
npm run check:prerequisitesThis will verify all required tools and configurations are set up correctly.
| Issue | Solution |
|---|---|
| "Appium not found" | Run npm install -g appium |
| "Driver not found" | Run appium driver install <driver-name> |
| "Plugin not found" | Run appium plugin install <plugin-name> |
| "ANDROID_HOME not set" | Set environment variable (see Android SDK Setup) |
| "No devices found" | Start emulator/simulator or connect physical device |
| "Connection refused" | Make sure Appium server is running |
| "Port 4723 already in use" | Stop other Appium instances or change port |
- All step definitions use
this.driver(provided by hooks) - Screenshots and page sources are automatically saved to
artifacts/on test failure - Page Object Model pattern ensures maintainable and reusable code
- Platform-specific handling is abstracted in page objects
- Locators are separated from page objects in dedicated
locators/directory - Each page has its own locator class extending
BaseLocatorsfor unified approach - Generic text-based interactions use
BaseLocatorsfor platform-agnostic element finding - Locators are separated from page objects in dedicated
locators/directory - Each page has its own locator class extending
BaseLocatorsfor unified approach - Generic text-based interactions use
BaseLocatorsfor platform-agnostic element finding