This is a Test Automation Framework with Python
that is used to automate CRUD APIs
Automated CRUD (i.e., POST
, GET
, PUT
, DELETE
) APIs using python
requests
pytest
assertpy
python-dotenv
api-framework-python/
ββ services/
β ββ restful_booker/
β β ββ __init__.py
β β ββ restful_booker_service.py
β ββ __init__.py
β ββ base_service.py
ββ tests/
β ββ data/
β β ββ create_booking.json
β β ββ update_booking.json
β ββ __init__.py
β ββ test_restful_booker_crud_operation.py
ββ utils/
β ββ __init__.py
β ββ file_reader.py
β ββ request.py
ββ .env
ββ .gitignore
ββ config.py
ββ conftest.py
ββ LICENSE
ββ Pipfile
ββ Pipfile.lock
ββ README.md
- Fork and Clone the repository https://.com/ashikkumar23/api-framework-python
- Open Pycharm (or any IDE) > File > Open > Open the project where the repository is located (i.e.,
../api-framework-python
) - On the
Pycharm
terminal, navigate to thetests
directory viacd tests
- Make sure a one-time Installation is performed before executing the tests
- On the
Pycharm
terminal, run the command:python -m pytest -v
- For Mac: Install
pipenv
viahomebrew
brew install pipenv
- For Windows: Install
pipenv
viapip
pip install pipenv
- Create a home directory
mkdir ~/.virtualenvs
- Add below in
~/.zshrc
or~/.bash_profile
(if on Mac/Linux) or your Windows system variables
export WORKON_HOME=~/virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
- Source the above changes
source ~/.zshrc
- Create a new project using Python 3.8
pipenv --python 3.8
- Activate virtualenv
pipenv shell
- Install all dependencies in your virtualenv
pipenv install