Appium end-to-end tests for Status app
From Status Wiki
This is the approved revision of this page, as well as being the most recent.
Installation:
- Install latest (3.6+) Python
- Install Git. Clone or Download (choose your local directory) with SSH status-react repository , use the following command in Terminal
git clone [email protected]:status-im/status-react.git
. SSH key is required so if you don't have any - add it.
git clone [email protected]:status-im/status-react.git
git pull [email protected]:status-im/status-react.git
Or the thing works better for me. Being in your status-im local directory, run `git fetch -all` and `git reset --hard origin/develop`
- Go to /status-react/test/appium and run
pip3 install -r requirements.txt (sudo might be required)
- Install Genymotion: https://www.genymotion.com
- In Genymotion add two identical devices (
Google Nexus 5 - 6.0.0 - API23 - 1080x1920
) - Install Appium 'npm install -g appium'
- Use this to diagnose and fix common Node, iOS and Android configuration issues before starting Appium
Local Running:
- Start Appium (just type appium in terminal and press enter)
- Start two virtual devices and wait for them to boot
- Go to
/status-react/test/appium/tests
and run:python3 -m pytest -m all -v --env=local --apk=/<path to apk>/apk_name.apk
- Running with
-m all
starts all tests, if you want to start a specific test group, you can use-m transaction
or-m chat
instead of-m all
. Additional groups will be added after adding more tests
Running with PyCharm
- Install PyCharm Community
- Open (do not create new!) status react project in PyCharm
- Set Appium directory
As Sources Root.
Navigate to Appium folder -> Right click -> Mark Directory as Sources root - Configure Project Interpreter: go to PyCharm -> Preferences->
cdm+
-> Add Interpreter to search conditions into search bar -> select Project Interpretator -> Select Python 3.6
NOTE: you may not see Python 3.6 in your Interpreter list. No worries! Staying on the same screen click Show all -> click +
then add local
on next screen -> System Interpreter -> Select Python 3.6
- Configure Python Integrated tools: go to PyCharm -> Preferences-> cdm+ -> Add Integrated tools to search conditions into search bar -> select Python Integrated tools -> Select py.test
- Go to Appium directory and find pytest.ini file. Add the following line (it is already there, all you need is to add your own path to apk), so for example I have
1.apk
in tests folder:
addopts = -s -v --junitxml=result.xml --tb=line --env=local --apk=/Users/in_no_cent/Documents/Status/status-react/test/appium/tests/1.apk --log=True
- Start Appium, run 2 devices in Genymotion, then select any test you like -> Right click -> Run (tests are started with test_)
- Enjoy :)