-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocustfile.py
More file actions
51 lines (39 loc) · 1.12 KB
/
Copy pathlocustfile.py
File metadata and controls
51 lines (39 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from locust import HttpUser, between, task
import logging
EMAIL = ""
PASSWORD = ""
class WebsiteUser(HttpUser):
wait_time = between(5, 10)
def on_start(self):
token = self.client.post('/api/v1/auth/login', json={'email': EMAIL, 'password': PASSWORD})
self.client.headers = {'Authorization': f'Bearer: {token.json()["accessToken"]}'}
@task
def token_gen(self):
self.client.post('/api/v1/auth/login', json={'email': EMAIL, 'password': PASSWORD})
@task
def index(self):
self.client.get("/")
@task
def index(self):
self.client.get("/api/v1/auth/me")
@task
def profile(self):
self.client.get("/u/ret7020")
@task
def profile_2(self):
self.client.get("/u/admin")
@task
def docs(self):
self.client.get("/docs")
@task
def leaderboard(self):
self.client.get("/leaderboard")
@task
def notifications(self):
self.client.get("/notifications")
@task
def events(self):
self.client.get("/events")
@task
def settings(self):
self.client.get("/settings")