Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
Lab 1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cian Laguesma
Lab 1
Commits
3fe4146a
Commit
3fe4146a
authored
Mar 10, 2020
by
cianlaguesma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited htmls and heroes.html file, and finalized functin tests
parent
feb84c71
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
7 deletions
+55
-7
detail_cloud.html
heroes/templates/detail_cloud.html
+2
-1
detail_jester.html
heroes/templates/detail_jester.html
+2
-1
detail_sunflowey.html
heroes/templates/detail_sunflowey.html
+2
-1
heroes.html
heroes/templates/heroes.html
+29
-1
lab1_functional_test.py
lab1_functional_test.py
+20
-3
No files found.
heroes/templates/detail_cloud.html
View file @
3fe4146a
...
...
@@ -5,7 +5,7 @@
</head>
<body>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Cloud
</h1>
<h1
id=
"cloud_detail"
>
Detail - Cloud
</h1>
<dl>
<dt>
Health Points
</dt>
<dd>
600
</dd>
...
...
@@ -16,5 +16,6 @@
<dt>
Lore
</dt>
<dd>
I am a cloud. When I pee you call it 'rain'.
</dd>
</dl>
<button><a
href=
"/heroes"
>
Back to Heroes List
</a></button>
</body>
</html>
heroes/templates/detail_jester.html
View file @
3fe4146a
...
...
@@ -5,7 +5,7 @@
</head>
<body>
<img
src=
"./jester.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Jester
</h1>
<h1
id=
"jester_detail"
>
Detail - Jester
</h1>
<dl>
<dt>
Health Points
</dt>
<dd>
660
</dd>
...
...
@@ -16,5 +16,6 @@
<dt>
Lore
</dt>
<dd>
I do it for the LOLs.
</dd>
</dl>
<button><a
href=
"/heroes"
>
Back to Heroes List
</a></button>
</body>
</html>
heroes/templates/detail_sunflowey.html
View file @
3fe4146a
...
...
@@ -5,7 +5,7 @@
</head>
<body>
<img
src=
"./sunflowey.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Sunflowey
</h1>
<h1
id=
"sunflowey_detail"
>
Detail - Sunflowey
</h1>
<dl>
<dt>
Health Points
</dt>
<dd>
650
</dd>
...
...
@@ -16,5 +16,6 @@
<dt>
Lore
</dt>
<dd>
I am Sunflowey. Sometimes a sun, sometimes a flower.
</dd>
</dl>
<button><a
href=
"/heroes"
>
Back to Heroes List
</a></button>
</body>
</html>
heroes/templates/heroes.html
View file @
3fe4146a
<html>
<head>
<
h1>
The Will of the Wisps Wiki
</h1
>
<
title>
The Will of the Wisps Wiki
</title
>
</head>
<body>
<h1
id=
"wiki"
>
The Will of the Wisps
</h1>
<h1
id=
"cloud"
><a
href=
"/hero/cloud"
>
Cloud
</a></h1>
<h1>
Detail - Cloud
</h1>
<dl>
<dt
id=
"health_cloud"
>
Health Points
</dt>
<dd>
600
</dd>
<dt
id=
"attack_cloud"
>
Base Attack Damage
</dt>
<dd>
57
</dd>
</dl>
<h1
id=
"jester"
><a
href=
"/hero/jester"
>
Jester
</a></h1>
<h1>
Detail - Jester
</h1>
<dl>
<dt
id=
"health_jester"
>
Health Points
</dt>
<dd>
660
</dd>
<dt
id=
"attack_jester"
>
Base Attack Damage
</dt>
<dd>
64
</dd>
</dl>
<h1
id=
"sunflowey"
><a
href=
"/hero/sunflowey"
>
Sunflowey
</a></h1>
<h1>
Detail - Sunflowey
</h1>
<dl>
<dt
id=
"health_sunflowey"
>
Health Points
</dt>
<dd>
650
</dd>
<dt
id=
"attack_sunflowey"
>
Base Attack Damage
</dt>
<dd>
43
</dd>
</dl>
</body>
</html>
lab1_functional_test.py
View file @
3fe4146a
...
...
@@ -12,22 +12,39 @@ class NewVisitorTest(unittest.TestCase):
def
test_can_display_a_heroes_list_and_more_information_per_hero
(
self
):
# Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage
browser
.
get
(
'http://localhost:8000/heroes'
)
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
self
.
assertIn
(
'The Will of the Wisps Wiki'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"wiki"
))
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
self
.
assertIn
(
''
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"cloud"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"health_cloud"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"attack_cloud"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"jester"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"health_jester"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"attack_jester"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"sunflowey"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"health_sunflowey"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"attack_sunflowey"
))
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
self
.
browser
.
get
(
'http://localhost:8000/hero/cloud'
)
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
"Detail - Cloud"
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"cloud_detail"
))
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
self
.
assertTrue
(
self
.
browser
.
find_elements_by_tag_name
(
"button"
))
# She clicks this and she is redirected back to the wiki's homepage.
self
.
browser
.
get
(
"http://localhost:8000/heroes"
)
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment