Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
csci40_lab1
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
John Carlos Sanil
csci40_lab1
Commits
11affccb
Commit
11affccb
authored
Mar 07, 2020
by
John Carlos Sanil
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'final-touches' into 'develop'
Added final touches and final unit tests See merge request
!4
parents
fc84e5da
5966ca04
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
16 deletions
+36
-16
detail_cloud.html
willowisp/heroes/templates/detail_cloud.html
+1
-1
detail_jester.html
willowisp/heroes/templates/detail_jester.html
+1
-1
detail_sunflowey.html
willowisp/heroes/templates/detail_sunflowey.html
+4
-2
heroes.html
willowisp/heroes/templates/heroes.html
+10
-9
lab1_functional_test.py
willowisp/lab1_functional_test.py
+20
-3
No files found.
willowisp/heroes/templates/detail_cloud.html
View file @
11affccb
...
...
@@ -5,7 +5,7 @@
</head>
<body>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
<h1><a
href=
"/hero/cloud"
>
Detail - Cloud
</a></h1>
<h1
id=
"header_cloud"
><a
href=
"/hero/cloud"
>
Detail - Cloud
</a></h1>
<dl>
<dt>
Health Points
</dt>
...
...
willowisp/heroes/templates/detail_jester.html
View file @
11affccb
...
...
@@ -5,7 +5,7 @@
</head>
<body>
<img
src=
"./jester.png"
style=
"width: 10vw;"
/>
<h1><a
href=
"/hero/jester"
>
Detail - Jester
</a></h1>
<h1
id=
"header_jester"
><a
href=
"/hero/jester"
>
Detail - Jester
</a></h1>
<dl>
<dt>
Health Points
</dt>
...
...
willowisp/heroes/templates/detail_sunflowey.html
View file @
11affccb
...
...
@@ -5,7 +5,9 @@
</head>
<body>
<img
src=
"./sunflowey.png"
style=
"width: 10vw;"
/>
<h1><a
href=
"/hero/sunflowey"
>
Detail - Sunflowey
</a></h1>
<h1
id=
"header_sunflowey"
>
<a
href=
"/hero/sunflowey"
>
Detail - Sunflowey
</a>
</h1>
<dl>
<dt>
Health Points
</dt>
<dd>
650
</dd>
...
...
@@ -16,6 +18,6 @@
<dt>
Lore
</dt>
<dd>
I am Sunflowey. Sometimes a sun, sometimes a flower.
</dd>
</dl>
<button
><a
href=
"/heroes"
>
Back to Home
</a>
</button>
<button
href=
"/heroes"
id=
"back_to_home"
>
Back to Home
</button>
</body>
</html>
willowisp/heroes/templates/heroes.html
View file @
11affccb
...
...
@@ -3,26 +3,27 @@
<title>
The Will of the Wisps Wiki
</title>
</head>
<body>
<h1><a
href=
"/hero/cloud"
>
Cloud
</a></h1>
<h1
id=
"wiki"
>
The Will of the Wisps Wiki
</h1>
<h1
id=
"cloud"
><a
href=
"/hero/cloud"
>
Cloud
</a></h1>
<dl>
<dt>
Health Points
</dt>
<dd>
600
</dd>
<dd
id=
"cloud_health"
>
600
</dd>
<dt>
Base Attack Damage
</dt>
<dd>
57
</dd>
<dd
id=
"cloud_damage"
>
57
</dd>
</dl>
<h1><a
href=
"/hero/sunflowey"
>
Sunflowey
</a></h1>
<h1
id=
"sunflowey"
><a
href=
"/hero/sunflowey"
>
Sunflowey
</a></h1>
<dl>
<dt>
Health Points
</dt>
<dd>
650
</dd>
<dd
id=
"sunflowey_health"
>
650
</dd>
<dt>
Base Attack Damage
</dt>
<dd>
43
</dd>
<dd
id=
"sunflowey_damage"
>
43
</dd>
</dl>
<h1><a
href=
"/hero/jester"
>
Jester
</a></h1>
<h1
id=
"jester"
><a
href=
"/hero/jester"
>
Jester
</a></h1>
<dl>
<dt>
Health Points
</dt>
<dd>
660
</dd>
<dd
id=
"jester_health"
>
660
</dd>
<dt>
Base Attack Damage
</dt>
<dd>
64
</dd>
<dd
id=
"jester_damage"
>
64
</dd>
</dl>
</body>
</html>
willowisp/lab1_functional_test.py
View file @
11affccb
...
...
@@ -16,9 +16,23 @@ class NewVisitorTest(unittest.TestCase):
# 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
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"cloud"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"cloud_health"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"cloud_damage"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"sunflowey"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"sunflowey_health"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"sunflowey_damage"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"jester"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"jester_health"
))
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"jester_damage"
))
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
...
...
@@ -27,21 +41,24 @@ class NewVisitorTest(unittest.TestCase):
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
'Detail - Cloud'
,
self
.
browser
.
title
)
hero_header
=
self
.
browser
.
find_elements_by_tag_name
(
"h1"
)
self
.
assertTrue
(
hero_header
==
'Detail - Cloud'
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_cloud"
))
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# She clicks this and she is redirected back to the wiki's homepage.
self
.
assertTrue
(
self
.
browser
.
find_elements_by_tag_name
(
"button"
))
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
# She then looks at the rest of the heroes and goes back to the wiki's homepage.
# She then checks the rest of the heroes and goes back to the wiki's homepage.
self
.
browser
.
get
(
'http://localhost:8000/hero/sunflowey'
)
self
.
assertIn
(
'Detail - Sunflowey'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_sunflowey"
))
self
.
assertTrue
(
self
.
browser
.
find_elements_by_tag_name
(
"button"
))
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
self
.
browser
.
get
(
'http://localhost:8000/hero/jester'
)
self
.
assertIn
(
'Detail - Jester'
,
self
.
browser
.
title
)
self
.
assertTrue
(
self
.
browser
.
find_element_by_id
(
"header_jester"
))
self
.
assertTrue
(
self
.
browser
.
find_elements_by_tag_name
(
"button"
))
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
...
...
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