Skip to content
Snippets Groups Projects
Commit 158d9bbc authored by DREVES Theo's avatar DREVES Theo
Browse files

Merge branch 'develop' into 'main'

WIP: develop

See merge request !35
parents f3b7cb63 81fc3655
Branches main
No related tags found
1 merge request!35WIP: develop
Pipeline #20195 passed
......@@ -54,7 +54,7 @@ def test_pages_content_home(client):
page_data = str(response.data).split("\\n")
page_data = [s.strip() for s in page_data]
# We are looking for the page title, and the three search inputs
# We are looking for the page title, and the three links
elements_to_find = [
'<h1> Accueil </h1>',
'<h2>Nos services</h2>',
......@@ -68,6 +68,59 @@ def test_pages_content_home(client):
for element in elements_to_find:
assert element in page_data
def test_pages_content_list(client):
# Testing if the home page is displaying the right content
response = client.get("/trip/long")
page_data = str(response.data).split("\\n")
page_data = [s.strip() for s in page_data]
# We are looking for the page long trip list, and the table it displays
elements_to_find = [
'<h1>Trajets longs</h1>',
'<a href="/" class="btn btn-secondary"> < Back </a>',
'<table class="table">',
'<tr style="text-align:center">',
'<th>D\\xc3\\xa9part</th>',
'<th>Arriv\\xc3\\xa9e</th>',
'<th>Date</th>',
'<th>Description</th>',
'<th>Conducteur</th>',
'<th>Places restantes</th>',
'<th>D\\xc3\\xa9tails</th>'
]
print(page_data)
for element in elements_to_find:
assert element in page_data
def test_pages_content_detail(client):
# Testing if the home page is displaying the right content
response = client.get("/trip/details/1")
page_data = str(response.data).split("\\n")
page_data = [s.strip() for s in page_data]
# We are looking for the page title, and the three search inputs
elements_to_find = [
'<h1> Trajet </h1>',
'<a href="/trip/long" class="btn btn-secondary"> < Back </a>',
'<li>Adresse d\\xc3\\xa9part : All\\xc3\\xa9e Jean Baptise Fourier</li>',
'<li>Adresse arriv\\xc3\\xa9e : Rue de l&#39;\\xc3\\xa9glise</li>',
'<li>Date : 01/02/2024 12:00</li>',
'<li>Conducteur : John Doe</li>',
'<li>Contact : 06 06 06 06 06</li>',
'<li>Description: Je pars demain de Nantes pour rentrer \\xc3\\xa0 Brest</li>',
'<li>Nombre de places disponibles : 4</li>',
'<button class="btn btn-outline-danger" onclick="fetch(\\\'/trip/1\\\', { method: \\\'DELETE\\\' }); location.href = \\\'/trip/long\\\'">Supprimer le trajet</button>',
]
print(page_data)
for element in elements_to_find:
assert element in page_data
##############################################################
# Testing the trip creation & accessing the trip detailed page
##############################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment