API testing using python's behave library
- Python 3.x.x. (here is a documentation for different OS)
- (optional). Virtual environment for the project. I personally use pyenv along with virtualenv
- Install requirements
pip install -r requirements.txt- Setting base URL.
Copy
sample_envfile and save it as.envin the same directory. Then replaceBASE_URLwith desired server URL.
behaveFor more details go here
Alternatively you can run without a .env file if you set the BASE_URL in the OS environment as variable. So the following will also work,
BASE_URL=http://test.com:30001 behave