Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lab-1-wang-alec-185292-willowisp
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
Alec
lab-1-wang-alec-185292-willowisp
Commits
ef5f9264
Commit
ef5f9264
authored
Mar 07, 2020
by
Alec Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added heroes.html page
parent
87cf7ab7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
28 deletions
+46
-28
urls.cpython-38.pyc
heroes/__pycache__/urls.cpython-38.pyc
+0
-0
views.cpython-38.pyc
heroes/__pycache__/views.cpython-38.pyc
+0
-0
heroes.html
heroes/templates/heroes.html
+16
-0
views.py
heroes/views.py
+2
-1
lab1_functional_test.py
lab1_functional_test.py
+28
-27
settings.cpython-38.pyc
willowisp/__pycache__/settings.cpython-38.pyc
+0
-0
No files found.
heroes/__pycache__/urls.cpython-38.pyc
View file @
ef5f9264
No preview for this file type
heroes/__pycache__/views.cpython-38.pyc
View file @
ef5f9264
No preview for this file type
heroes/templates/heroes.html
0 → 100644
View file @
ef5f9264
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Will of the Wisps
</title>
</head>
<body>
<li><a
href=
"{% url 'hero_cloud' %}"
>
Cloud(HP:600,Damage:57)
</a></li>
<li><a
href=
"{% url 'hero_sunflowey' %}"
>
Sunflowey(HP:650,Damage:43)
</a></li>
<li><a
href=
"{% url 'hero_jester' %}"
>
Jester(HP:660,Damage:64)
</a></li>
</body>
</html>
\ No newline at end of file
heroes/views.py
View file @
ef5f9264
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
def
heroes
(
request
):
return
HttpResponse
(
'<html><title>Hero Wiki</title></html>
'
)
return
render
(
request
,
'heroes.html
'
)
def
hero_cloud
(
request
):
...
...
lab1_functional_test.py
View file @
ef5f9264
from
selenium
import
webdriver
import
unittest
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
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'
)
# 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
)
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
# She spots the page title and header mentions the name of the hero she selected.
# 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
.
fail
(
'Finish the test!'
)
\ No newline at end of file
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Firefox
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
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'
)
# 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
)
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
self
.
assertIn
(
'Cloud '
)
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
# She spots the page title and header mentions the name of the hero she selected.
# 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
.
fail
(
'Finish the test!'
)
willowisp/__pycache__/settings.cpython-38.pyc
View file @
ef5f9264
No preview for this file type
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