Tools used for testing:
Given tokens are expired, please email me to get a new set of token
Refresh the database before running any tests by opening this link.
- Install Postman application using this link.
- Import the Test Collection and Test Environment by following these steps:
- Click the Import button on top-left part of your postman window (next to New button)
- Drag and drop the file
PMS.postman_collection.json
andPMS.postman_environment.json
located intests/postman_tests
. - Then hit Import
- Head to collections tab and hover on the newly imported collection. Then press the right arrow and click run.
- A Collection Runner pops up, then click Run (located in bottom left)
Using Newman (Needs NodeJS)
- Install Newman using CLI with the command
npm install -g newman
- Lastly, execute the below command
$ cd tests/postman_tests $ newman run -e PMS.postman_environment.json PMS.postman_collection.json
- Open a terminal in the project root and activate the virtual environment (created during local deployment)
or
# For Windows > venv\Scripts\activate
# For Unix based (MacOS and Ubuntu) $ source venv/bin/activate
- Update the
.env
file with latest bearer tokens for Dean, Doctor and Nurse role (if tokens are expired). - Then run the below command
$ python -m pytest
Note: These tests will create a
test_database.db
file insidepms
folder