Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hackathon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DREVES Theo
Hackathon
Commits
158d9bbc
Commit
158d9bbc
authored
1 year ago
by
DREVES Theo
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into 'main'
WIP: develop See merge request
!35
parents
f3b7cb63
81fc3655
Branches
main
No related tags found
1 merge request
!35
WIP: develop
Pipeline
#20195
passed
1 year ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/tests.py
+54
-1
54 additions, 1 deletion
tests/tests.py
with
54 additions
and
1 deletion
tests/tests.py
+
54
−
1
View file @
158d9bbc
...
...
@@ -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 input
s
# We are looking for the page title, and the three
link
s
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'
\\
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
##############################################################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment