-
Notifications
You must be signed in to change notification settings - Fork 195
Setup
The setup for our open-sourced Python test automation framework is fairly simple. Don't get fooled by the length of this section. We have documented the setup instructions in detail so even beginners can get started.
The setup has four parts:
- Prerequisites
- Setup for GUI/Selenium automation
- Setup for Mobile/Appium automation
- Setup for API automation
1. Prerequisites
a) Install Python 2.x
b) Add Python 2.x to your PATH environment variable
c) If you do not have it already, get pip (NOTE: Most recent Python distributions come with pip)
d) pip install -r requirements.txt to install dependencies
If you ran into some problems on step (d), please report them as an issue or email Arun([email protected]).
2. Setup for GUI/Selenium automation
a) Get setup with your browser driver. If you don't know how to, please try:
#Note: Check Firefox version & Selenium version compatibility before downloading geckodriver.
If your setup goes well, you should be to run a simple test with this command:
-
Chrome:
pytest -k example_form -B Chrome
-
Firefox:
pytest -k example_form -B Firefox
Optional steps for integrating with third-party tools:
- Integrate our Python test automation framework with Testrail
- Integrate our Python GUI/web automation framework with BrowserStack
- Integrate our Python Selenium automation framework with Sauce Labs
- Run Python integration tests on Jenkins
- Run Python integration tests on CircleCI
- Post Python automation test results on Slack
3. Setup for Mobile/Appium automation
a) Download and Install appium desktop app
b) Download and Install Android Studio and create an emulator
d) Install the appium Python client library pip install Appium-Python-Client
If your setup goes well, you should be to run a simple mobile test with this command after starting the Appium and Android emulator:
pytest -k mobile_bitcoin_price -H $Emulator_OS_Version -I $Emulator_Name
Optional steps for more details on setting up appium and running tests on Android or iOS refer to below links:
4. Setup for API automation
a. Get Cars API code from repo https://github.com/qxf2/cars-api using command "git clone https://github.com/qxf2/cars-api.git"
b. Install Flask using command "pip install flask"
c. Run cars-app server using command "python cars-api/cars_app.py"
d. Run test_api_example now using command "pytest -k api -s"
Optional steps for more details on setting up API and running tests refer to below link: