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
9c70818d
Commit
9c70818d
authored
Mar 07, 2020
by
Carlowsss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edited html files to pass functional tests
parent
b01faf5d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
46 deletions
+106
-46
detail_cloud.html
willowisp/heroes/templates/detail_cloud.html
+20
-14
detail_jester.html
willowisp/heroes/templates/detail_jester.html
+20
-14
detail_sunflowey.html
willowisp/heroes/templates/detail_sunflowey.html
+19
-14
heroes.html
willowisp/heroes/templates/heroes.html
+23
-1
jester.png
willowisp/heroes/templates/jester.png
+0
-0
sunflowey.png
willowisp/heroes/templates/sunflowey.png
+0
-0
urls.py
willowisp/heroes/urls.py
+3
-0
views.py
willowisp/heroes/views.py
+1
-1
lab1_functional_test.py
willowisp/lab1_functional_test.py
+20
-2
No files found.
willowisp/heroes/templates/detail_cloud.html
View file @
9c70818d
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
Detail - Cloud
</title>
<title>
Detail - Cloud
</title>
</head>
</head>
<body>
<body>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Cloud
</h1>
<h1><a
href=
"/hero/cloud"
>
Detail - Cloud
</a></h1>
<dl>
<dt>
Health Points
</dt><dd>
600
</dd>
<dl>
<dt>
Base Attack Damage
</dt><dd>
57
</dd>
<dt>
Health Points
</dt>
<dt>
Skills
</dt><dd>
Nimbus, Rain Cloud, Thunderbolt
</dd>
<dd>
600
</dd>
<dt>
Lore
</dt><dd>
I am a cloud. When I pee you call it 'rain'.
</dd>
<dt>
Base Attack Damage
</dt>
</dl>
<dd>
57
</dd>
</body>
<dt>
Skills
</dt>
<dd>
Nimbus, Rain Cloud, Thunderbolt
</dd>
<dt>
Lore
</dt>
<dd>
I am a cloud. When I pee you call it 'rain'.
</dd>
</dl>
<button><a
href=
"/heroes"
>
Back to Home
</a></button>
</body>
</html>
</html>
willowisp/heroes/templates/detail_jester.html
View file @
9c70818d
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
Detail - Jester
</title>
<title>
Detail - Jester
</title>
</head>
</head>
<body>
<body>
<img
src=
"./jester.png"
style=
"width: 10vw;"
/>
<img
src=
"./jester.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Jester
</h1>
<h1><a
href=
"/hero/jester"
>
Detail - Jester
</a></h1>
<dl>
<dt>
Health Points
</dt><dd>
660
</dd>
<dl>
<dt>
Base Attack Damage
</dt><dd>
64
</dd>
<dt>
Health Points
</dt>
<dt>
Skills
</dt><dd>
Laugh, Dance, Smile
</dd>
<dd>
660
</dd>
<dt>
Lore
</dt><dd>
I do it for the LOLs.
</dd>
<dt>
Base Attack Damage
</dt>
</dl>
<dd>
64
</dd>
</body>
<dt>
Skills
</dt>
<dd>
Laugh, Dance, Smile
</dd>
<dt>
Lore
</dt>
<dd>
I do it for the LOLs.
</dd>
</dl>
<button><a
href=
"/heroes"
>
Back to Home
</a></button>
</body>
</html>
</html>
willowisp/heroes/templates/detail_sunflowey.html
View file @
9c70818d
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
Detail - Sunflowey
</title>
<title>
Detail - Sunflowey
</title>
</head>
</head>
<body>
<body>
<img
src=
"./sunflowey.png"
style=
"width: 10vw;"
/>
<img
src=
"./sunflowey.png"
style=
"width: 10vw;"
/>
<h1>
Detail - Sunflowey
</h1>
<h1><a
href=
"/hero/sunflowey"
>
Detail - Sunflowey
</a></h1>
<dl>
<dl>
<dt>
Health Points
</dt><dd>
650
</dd>
<dt>
Health Points
</dt>
<dt>
Base Attack Damage
</dt><dd>
43
</dd>
<dd>
650
</dd>
<dt>
Skills
</dt><dd>
Power Pellet, Sunshine, Pollen Punch
</dd>
<dt>
Base Attack Damage
</dt>
<dt>
Lore
</dt><dd>
I am Sunflowey. Sometimes a sun, sometimes a flower.
</dd>
<dd>
43
</dd>
</dl>
<dt>
Skills
</dt>
</body>
<dd>
Power Pellet, Sunshine, Pollen Punch
</dd>
<dt>
Lore
</dt>
<dd>
I am Sunflowey. Sometimes a sun, sometimes a flower.
</dd>
</dl>
<button><a
href=
"/heroes"
>
Back to Home
</a></button>
</body>
</html>
</html>
willowisp/heroes/templates/heroes.html
View file @
9c70818d
...
@@ -2,5 +2,27 @@
...
@@ -2,5 +2,27 @@
<head>
<head>
<title>
The Will of the Wisps Wiki
</title>
<title>
The Will of the Wisps Wiki
</title>
</head>
</head>
<body></body>
<body>
<h1><a
href=
"/hero/cloud"
>
Cloud
</a></h1>
<dl>
<dt>
Health Points
</dt>
<dd>
600
</dd>
<dt>
Base Attack Damage
</dt>
<dd>
57
</dd>
</dl>
<h1><a
href=
"/hero/sunflowey"
>
Sunflowey
</a></h1>
<dl>
<dt>
Health Points
</dt>
<dd>
650
</dd>
<dt>
Base Attack Damage
</dt>
<dd>
43
</dd>
</dl>
<h1><a
href=
"/hero/jester"
>
Jester
</a></h1>
<dl>
<dt>
Health Points
</dt>
<dd>
660
</dd>
<dt>
Base Attack Damage
</dt>
<dd>
64
</dd>
</dl>
</body>
</html>
</html>
willowisp/heroes/templates/jester.png
0 → 100644
View file @
9c70818d
66.3 KB
willowisp/heroes/templates/sunflowey.png
0 → 100644
View file @
9c70818d
13.9 KB
willowisp/heroes/urls.py
View file @
9c70818d
...
@@ -4,4 +4,7 @@ from .views import heroes_home, cloud_hero, jester_hero, sunflowey_hero
...
@@ -4,4 +4,7 @@ from .views import heroes_home, cloud_hero, jester_hero, sunflowey_hero
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^heroes$'
,
heroes_home
,
name
=
'hero_home'
),
url
(
r'^heroes$'
,
heroes_home
,
name
=
'hero_home'
),
url
(
r'^hero/cloud$'
,
cloud_hero
,
name
=
'cloud_hero'
),
url
(
r'^hero/sunflowey$'
,
sunflowey_hero
,
name
=
'sunflowey_hero'
),
url
(
r'^hero/jester$'
,
jester_hero
,
name
=
'jester_hero'
),
]
]
\ No newline at end of file
willowisp/heroes/views.py
View file @
9c70818d
...
@@ -10,4 +10,4 @@ def jester_hero(request):
...
@@ -10,4 +10,4 @@ def jester_hero(request):
return
render
(
request
,
'detail_jester.html'
)
return
render
(
request
,
'detail_jester.html'
)
def
sunflowey_hero
(
request
):
def
sunflowey_hero
(
request
):
return
render
(
request
,
'
sunflowey_hero
.html'
)
return
render
(
request
,
'
detail_sunflowey
.html'
)
willowisp/lab1_functional_test.py
View file @
9c70818d
...
@@ -22,11 +22,29 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -22,11 +22,29 @@ class NewVisitorTest(unittest.TestCase):
# When she selects one of the heroes, she is sent to another page
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
# 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.
# 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'
)
# While she is in a specific hero's page, she sees a button labeled "Back to Heroes List".
# 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.
# 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.
self
.
browser
.
get
(
'http://localhost:8000/hero/sunflowey'
)
self
.
assertIn
(
'Detail - Sunflowey'
,
self
.
browser
.
title
)
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_elements_by_tag_name
(
"button"
))
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
self
.
fail
(
'Finish the test!'
)
self
.
fail
(
'Finish the test!'
)
...
...
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