Demo example for presentation [video]
target OS - Mac, so detailed install information provided only for it. What is it? Demo login test for "one test for several platforms" approach
What do you need? .app or/and .apk applications or/and web versions your application
- Install brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install Python 3.6+:
brew install python3
- Install npm:
brew install npm
- Install Appium server:
npm install -g appium
or look here - For better debugging you can install Appium inspector
- Install Carthage:
brew install carthage
- Install chrome browser (or use some other - look at driver configuration)
- Install xcode (for ios simulator)
- Install android studio or any android simulator
- Install Python dependencies:
. ./scripts/install_deps.sh
(Terminal from root project folder) - I can miss something: you can try for example this
- Put ".app" or/and ".apk" into mobile app directory
- Add application names in config or environment variables:
export IOS_APP_NAME=my_app.app
export ANDROID_APP_NAME=my_app.apk
export LOGIN_PAGE_URL=https://my-app.com
for web version
- Change locators for (there are some examples):
- login page
- navigation page - any element for assert success login
- Configure through env variables or configuration files:
export DEFAULT_LOGIN=admin
export DEFAULT_PASSWORD=1234
- If mobile app have environment choosing screen:
- Uncomment few lines
- Set environment variable ORGANIZATION_URL
- Add locators for login page
- You also can configure devices, collecting browser logs and etc (through ANDROID_VERSION, ANDROID_DEVICE_NAME, IOS_VERSION, IOS_DEVICE_NAME variables)
- Run appium server
appium
for iOS or Android - Choose platform
export PLATFORM='WEB'
orIOS
orANDROID
- Activate virtual environment with dependencies:
pipenv shell
- Run tests
python3 -m pytest tests/ui
or just:. ./scripts/run_ios_tests.sh
. ./scripts/run_android_tests.sh
. ./scripts/run_web_tests.sh
- Appium-python documentation
- Selene
- Pytest
- If you want to interact with some elements through pure selenium / appium look at commented method as example