Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ lib
.envrc
__pycache__
launch_flask.bat
launch_test.bat
launch_test.bat
.coverage
12 changes: 8 additions & 4 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<title>GUDLFT Registration</title>
</head>
<body>
ul>l*5
<h1>Welcome to the GUDLFT Registration Portal!</h1>
Please enter your secretary email to continue:
<form action="showSummary" method="post">
<label for="email">Email:</label>
<input type="email" name="email" id=""/>
<button type="submit">Enter</button>
</form>
</body>
</html>
42 changes: 42 additions & 0 deletions tests/perform_test/test_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import time
from random import randint
from locust import HttpUser, task, between

from server import loadClubs, loadCompetitions

competitions = loadCompetitions()
clubs = loadClubs()

class User(HttpUser):
wait_time = between(1, 5)

@task
def home(self):
self.client.get("/")

def logout(self):
self.client.get("/logout")

@task
def connect(self):
club = clubs[randint(0, len(clubs) - 1)]
self.client.post("/showSummary", {"email":club.get("email")})
self.client.post("/showSummary", {"email":"not_exist@test.com"})

@task(3)
def getBooking(self):
competition = competitions[randint(0, len(competitions) - 1)]
club = clubs[randint(0, len(clubs) - 1)]
self.client.get(f'/book/{competition.get("name")}/{club.get("name")}')

@task
def purchasePlaces(self):
competition = competitions[randint(0, len(competitions) - 1)]
club = clubs[randint(0, len(clubs) - 1)]
body = {
"club": club.get("name"),
"competition": competition.get("name"),
"places": randint(1, 13)
}
self.client.post("/purchasePlaces", body)