This repository utilizes pytest framework for automation testing.
- Python 3.9.2 Ensure that you have python installed in your system preferably Python 3.9.2. Note: Python 3.6 is no longer available in the Optum appstore
- PyCharm Community Edition 2021.1+
- Poetry 1.1.12
poetry is a tool to handle dependency installation as well as building and packaging of Python packages. It only needs one file to do all of that: the new, standardized pyproject.toml
.
In other words, poetry uses pyproject.toml to replace setup.py
, requirements.txt
, setup.cfg
, MANIFEST.in
and the newly added Pipfile
.
After cloning this github repository, prepare your development environment like so:
-
Set up a Python virtual environment by navigating to PyCharm's Project Python Interpreter and create a new
.venv
environment. -
Click the OK button and close the Settings modal as the packages will not be populated at first. Open the Python Interpreter once again and add the
poetry
package. Click theSpecify version
checkbox and from its drop-down selection, select the version 1.1.12 and clickInstall Package
. Once installed, close the Project Settings altogether. -
Open a cmd/bash terminal
Alt+F12
in PyCharm and execute:poetry install
-
Executing parallel tests.
pytest -n <num>
where<num>
is the number of test instances.pytest -n 3
-
Executing tests which match the given substring expression.
pytest -k expression
. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes.- executes all tests under the python file
healthcare_ffm_test.py
pytest -k healthcare_ffm_test.py
- executes the test function named
test_healthcare_basic_flow
pytest -k test_healthcare_basic_flow
- executes all tests under the python file
-
Executing all tests under a directory.
pytest ./tests
Alternatively, if the commands on the terminal doesn't work due to Optum's restrictions then utilize Pycharm's Run/Debug Configuration and add the sample arguments above inside the Additional Arguments
text field.