A python mobile automation testing framework based on Appium
, Pytest
and Allure
- Appium 1.7 above
- Python 3.5.2
- Pytest 1.7.10
- Allure Framework 1.x
-
Automated trigger and close server
-
Command line trigger with on-demand argument
-
Display execution log and save in file
-
Generate clear HTML test report
-
Attached failure screenshot and log on test report
-
Reusable page object and common library
-
Support parallel testing (Android)
-
Prepare Android Studio, Appium test environment
Mac: http://blog.autoruby.com/2018/03/android-appium.html
Windows: http://blog.autoruby.com/2018/03/android-appium-windows.html
-
ttab (launch open terminal from script)
npm install -g ttab
-
Install
Pytest
pip3 install pytest
-
Install
pytest-allure-adaptor
pip3 install pytest-allure-adaptor
-
Install
formulas
brew tap qatools/formulas
-
Instal Allure Command Tool
brew install
allure-commandline
-
Instal PyYaml
pip3 install PyYaml
-
Instal requests
pip3 install requests
-
Launch emulator or connect real device
-
Run command in terminal
pytest -v -s --device [
deviceName
] [test file
] --tb=short --alluredir reportex. pytest -v -s --device AVD6.0 API_Demos.py --tb=short --alluredir report
This will connect to Android 6.0 emulator then trigger test script, generate test result in repport folder
-
Generate Allure test report
allure generate report/ -o report/html
This will generate test report in your project report/html folder
-
If you are using Pycharm, you can right click html/index.html to open it in browser
-
You can also change to report folder in terminal and run command
allure report open --report-dir ./html
Blog: http://blog.autoruby.com/
Email: davidtclin58@gmail.com
Linkedin: https://www.linkedin.com/in/davidtclin/