- Automated Software Testing with Python
- Used with Pylance extension to practice typed annotations with Python as well.
- Install pipenv:
py -m pip install pipenv
- Create new pipenv project:
py -m pipenv --python 3.9
, temporary disable uwsgi and psycopg2 first - Update .vscode settings with virtualenv location
"python.analysis.extraPaths": [
"C:\\Users\\Kaiser\\.virtualenvs\\udemy-automated-software-testing-python-7MNovFjM\\Lib\\site-packages",
],
- Install dependencies:
py -m pipenv install --dev
- Run pipenv:
py -m pipenv shell
,py -m pipenv run cmd
- Check pipenv dependencies:
py -m pipenv graph
- Exit pipenv:
exit
- Run black formatting:
black .
- Make sure the bottom intepreter is selected as the pipenv python.
- Change path for the project you are using at
.vscode/settings.json
, underpython.testing.unittestArgs
if using unittest - Set .env path to project folder if using pytest
PYTHONPATH=
py -m unittest tests/unit/post_test.py
- Create test collection and enviornment and export file without spaces.
- Install newman
npm install -g newman
- Make sure app is running and run:
newman run postman/tests.postman_collection.json -e postman/tests.postman_environment.json
- install Make for windows:
choco install make
as administrator. - Run makefile:
make run-tests clear-db=true
- Travis CI - Sign in with github
- Create
.travis.yml
file at root. - Add to readme. At Travis dashbard, click on the badge and select format: markdown and copy on top of the readme file.
- Install selenium
- Chrome web driver, put it in the project folder
- Run test -
behave tests/acceptance