This is a project used to make load tests in the backend using Locust.
You will have to activate a local python enviroment in case that you want to insolate dependencies. You can do this following these steps
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Using command promt
python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txt
Using powershell
python -m venv venv
.\venv\Scripts\activate.bat
pip install -r requirements.txt
Locust will be accesible in http://localhost:8089, so make sure you have that port free. Take into account that at least you will need 15 users (one per testing class), but we strongly recommend 20.
In order to run all tests you can run the following command:
locust -f locustfile.py
If you want to run specific module you can run all modules tests with these commands:
-
For running all Admin tests
locust -f admin\AdminLoadTests.py
-
For running all Company tests
locust -f company\CompanyLoadTests.py
-
For running all Customer Free tests
locust -f customer\CustomerFreeLoadTests.py
-
For running all Customer Premium tests
locust -f customer/CustomerPremiumLoadTests.py
-
For running both Customer and Customer Premium tests
locust -f customer\CustomerFreeAndPremiumTests.py
If you just want to run one specific class you can do it running only the file or indicating the class
-
Selecting the file:
locust -f relativeRouteToYourFile
Example: locust -f anonymous\status.py
-
Selecting the class:
locust -f locustfile.py --class nameOfTheClassThatYouWantToRun
Example: locust -f locustfile.py --class checkStatus