A comprehensive mobile automation testing framework for iOS and Android applications using Appium, Python, and Poetry.
- Parallel Testing: Run iOS and Android tests simultaneously
- Real Device Support: Test on actual iOS and Android devices
- Comprehensive Setup: Automated environment setup script
- Cross-Platform: Support for both iOS and Android platforms
- Modern Stack: Uses Appium 2.x, Python 3.x, and Poetry
- macOS (required for iOS development)
- Xcode (for iOS automation)
- Android Studio (for Android SDK)
- Physical iOS and Android devices (for real device testing)
git clone <your-repository-url>
cd github-actionsThe setup script will automatically check and install all required tools:
./setup_environment.shThis script will:
- β Check and install Homebrew
- β Check and install Python 3
- β Check and install Poetry
- β Check and install Node.js
- β Check and install Appium
- β Check and install Appium drivers (UiAutomator2, XCUITest)
- β Check Xcode installation
- β Check Android SDK
- β Set up environment variables
- β Install Python dependencies
- β Check for connected devices
If you prefer to set up manually or the script fails:
# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python 3
brew install python
# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -
# Install Node.js
brew install node
# Install Appium
npm install -g appium
# Install Appium drivers
appium driver install uiautomator2
appium driver install xcuitestAdd these to your ~/.zshrc file:
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/toolspoetry install- Connect your iOS device via USB
- Trust the computer on your device
- Enable Developer Mode:
- Go to Settings > Privacy & Security > Developer Mode
- Enable Developer Mode
- Trust the developer profile:
- Go to Settings > General > VPN & Device Management
- Trust your developer certificate
- Connect your Android device via USB
- Enable Developer Options:
- Go to Settings > About Phone
- Tap "Build Number" 7 times
- Enable USB Debugging:
- Go to Settings > Developer Options
- Enable "USB Debugging"
- Trust the computer when prompted
Open two terminal windows and run:
Terminal 1 (iOS):
appium -p 4723Terminal 2 (Android):
appium -p 4724python test_parallel_mobile.pyiOS Test:
python -m pytest tests/test_login_ios.py::TestLiveboardiOS::test_liveboard_login_flow -vAndroid Test:
python -m pytest tests/test_login_android_compose.py::TestAndroidLogin::test_android_login_flow -vpoetry run python test_parallel_mobile.pyTo run parallel mobile tests on real devices, you must set up a self-hosted runner on your Mac. Follow these steps:
- Go to your repository on GitHub.
- Navigate to:
SettingsβActionsβRunners. - Click the green "New self-hosted runner" button.
- Select your OS (macOS) and follow the instructions provided.
- Example commands (your actual download link and token will be provided by GitHub):
mkdir actions-runner && cd actions-runner curl -o actions-runner-osx-arm64-2.316.0.tar.gz -L <download-link-from-github> tar xzf actions-runner-osx-arm64-2.316.0.tar.gz ./config.sh --url <repo-url> --token <token-from-github> ./run.sh
- Example commands (your actual download link and token will be provided by GitHub):
To keep your runner always online (even after reboot or logout), install it as a service:
- Navigate to your runner directory:
cd ~/actions-runner
- Install the service:
./svc.sh install
- Start the service:
./svc.sh start
- Check the service status:
./svc.sh status
- To stop the service:
./svc.sh stop
For more details, see the GitHub Docs: Configure the self-hosted runner application as a service.
Tip: If you ever need to update or reconfigure the runner, stop the service first, then make your changes, and start it again.
github-actions/
βββ setup_environment.sh # Environment setup script
βββ test_parallel_mobile.py # Parallel test runner
βββ tests/
β βββ test_login_ios.py # iOS login test
β βββ test_login_android_compose.py # Android login test
βββ pyproject.toml # Poetry configuration
βββ README.md # This file
The iOS test uses these default settings:
- Device UDID:
00008030-000151561A85402E(can be overridden withDEVICE_UDIDenv var) - Device Name:
iPhone SE(can be overridden withDEVICE_NAMEenv var) - Platform Version:
17.2(can be overridden withPLATFORM_VERSIONenv var) - Team ID:
2FHJSTZ57U(can be overridden withTEAM_IDenv var) - Bundle ID:
com.inconceptlabs.liveboard
The Android test uses these default settings:
- Device UDID:
HT7991A08308 - Platform Version:
13 - App Package:
com.inconceptlabs.liveboard - App Activity:
com.inconceptlabs.liveboard.pages.activities.LaunchActivity
Solution:
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOMESolution:
- Install Xcode from the App Store
- Run:
sudo xcode-select --install
Solution:
- Ensure devices are connected via USB
- Trust the computer on both devices
- Enable USB debugging on Android
- Trust developer profile on iOS
Solution:
- Start iOS server:
appium -p 4723 - Start Android server:
appium -p 4724
Solution:
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"xcrun devicectl list devicesadb devicesThe parallel test runner provides:
- Individual test results and timing
- Overall execution summary
- Success/failure status for each platform
- Total execution time
Example output:
π PARALLEL TEST EXECUTION SUMMARY
==================================================
Android | β
PASSED | 19.72s
iOS | β
PASSED | 56.67s
--------------------------------------------------
Total Tests: 2
Passed: 2
Failed: 0
Overall Duration: 56.67s
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues:
- Check the troubleshooting section above
- Run the setup script:
./setup_environment.sh - Verify device connections
- Check Appium server status
- Review test logs for specific errors
To update the project:
git pull origin main
poetry install
./setup_environment.shHappy Testing! π―