Simple appium framework for the mobile automation tests
Automation tests for the mobile apps base on Python + Appium + BrowserStack
Note! It’s just a template of mobile project with empty variables and test. To make it work need to specify all needed fields, tests, screen, locators and configs.
Brave yourself and read small instruction below.
I do not guarantee that you will understand something cause there are a lot of pitfalls with XCode and Appium versions. At first, make sure that you have a Developer provision profile and account from the app you gonna test. Then you need all the latest versions of:
WebDriverAgent
project using XCode and add sign all WebDriverAgent in this project with your dev profile. And set the target version needed to your app.Mobile tests project which supports iOS and Android using Appium.
This project is Python based, so you will need Python to work with it.
For reports generation Allure is used. Install it as well.
brew install python3
brew install Allure
In Terminal from the main project, folder do the following
python3 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate
Also, you can run the next script:
sh scripts/venv.sh
brew install node || apt-get install nodejs # get node.js
npm install -g appium # get appium
npm install wd # get appium client
Also the desktop version - https://github.com/appium/appium-desktop/releases
brew cask install java
nano ~/.bash_profile
export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
sdkmanager "system-images;android-28;google_apis;x86"
avdmanager create avd -n test_emu -k "system-images;android-28;google_apis;x86" --device "pixel_xl"
avdmanager list avd
emulator -avd test_emu
brew install libimobiledevice
brew install ios-deploy
Go to scripts
dir. Execute the following script
execute_tests.sh
Android
{
"platformName": "android",
"deviceName": "Pixel 2",
"app": "test.apk",
"autoGrantPermissions": true,
"appPackage": "com.test.test.QA",
"appActivity": "com.test.test.activities.TestLauncherActivity"
}
iOS
{
"platformName": "iOS",
"platformVersion": "13.3",
"deviceName": "iPhone 7",
"app": "test.ipa",
"udid": "auto",
"xcodeOrgId": "123123",
"xcodeSigningId": "iPhone Developer",
"autoAcceptAlerts": false,
"noReset": true,
"automationName": "XCUITest",
"waitForQuiescence": false,
"useNewWDA": true
}
KEY | VALUE | Desc |
---|---|---|
DEVICE | pixel_device | Key of devices from mobile_framework/mobile/devices.py |
app_path | test.apk; | ABS path to the application |
PLATFORM | android | android or ios |
You can easily setup those variables using PyCharm: Run/Debug Configurations -> Edit Configurations -> Templates -> Python tests -> pytest -> Environment -> Environment variables
/usr/bin/killall -KILL node