Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
Lab1-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
Abigail Moreno
Lab1-Willowisp
Commits
d37959a2
Commit
d37959a2
authored
Mar 10, 2020
by
abbeeeeyyyyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the links in the html files
parent
625c9351
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
15 deletions
+44
-15
lab1_functional_test.py
willowisp/lab1_functional_test.py
+40
-13
settings.py
willowisp/willowisp/settings.py
+4
-2
No files found.
willowisp/lab1_functional_test.py
View file @
d37959a2
...
...
@@ -19,21 +19,18 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
character_name
=
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
health_points
=
self
.
browser
.
find_element_by_tag_name
(
'dt'
)
.
text
damage_points
=
self
.
browser
.
find_element_by_tag_name
(
'dt'
)
.
text
self
.
assertIn
(
'Jester'
,
character_name
)
self
.
assertIn
(
'660'
,
health_points
)
self
.
assertIn
(
'64'
,
damage_points
)
self
.
assertIn
(
'Jester'
,
self
.
browser
.
find_element_by_id
(
'jester'
)
)
self
.
assertIn
(
'660'
,
self
.
browser
.
find_element_by_id
(
'hp-jester'
)
)
self
.
assertIn
(
'64'
,
self
.
browser
.
find_element_by_id
(
'd-jester'
)
)
self
.
assertIn
(
'Cloud'
,
character_name
)
self
.
assertIn
(
'600'
,
health_points
)
self
.
assertIn
(
'57'
,
damage_points
)
self
.
assertIn
(
'Cloud'
,
self
.
browser
.
find_element_by_id
(
'cloud'
)
)
self
.
assertIn
(
'600'
,
self
.
browser
.
find_element_by_id
(
'hp-cloud'
)
)
self
.
assertIn
(
'57'
,
self
.
browser
.
find_element_by_id
(
'd-cloud'
)
)
self
.
assertIn
(
'Sunflowey'
,
character_name
)
self
.
assertIn
(
'650'
,
health_points
)
self
.
assertIn
(
'43'
,
damage_points
)
self
.
assertIn
(
'Sunflowey'
,
self
.
browser
.
find_element_by_id
(
'sunflowey'
)
)
self
.
assertIn
(
'650'
,
self
.
browser
.
find_element_by_id
(
'hp-sunflowey'
)
)
self
.
assertIn
(
'43'
,
self
.
browser
.
find_element_by_id
(
'd-sunflowey'
)
)
# When she selects one of the heroes, she is sent to another page
...
...
@@ -42,7 +39,6 @@ class NewVisitorTest(unittest.TestCase):
link
.
click
()
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertEquals
(
'http://localhost:8000/hero/Jester'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'Detail - Jester'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Detail - Jester'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
...
...
@@ -50,8 +46,39 @@ class NewVisitorTest(unittest.TestCase):
# She clicks this and she is redirected back to the wiki's homepage.
homePageLink
=
self
.
browser
.
find_element_by_link_text
(
'Back to Heroes List'
)
homePageLink
.
click
()
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
link
=
self
.
browser
.
find_element_by_link_text
(
'Cloud'
)
link
.
click
()
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
'Detail - Cloud'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Detail - Cloud'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
# 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.
homePageLink
=
self
.
browser
.
find_element_by_link_text
(
'Back to Heroes List'
)
homePageLink
.
click
()
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
link
=
self
.
browser
.
find_element_by_link_text
(
'Sunflowey'
)
link
.
click
()
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
'Detail - Sunflowey'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Detail - Suunflowey'
,
self
.
browser
.
find_element_by_tag_name
(
'h1'
)
.
text
)
# 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.
homePageLink
=
self
.
browser
.
find_element_by_link_text
(
'Back to Heroes List'
)
homePageLink
.
click
()
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
\ No newline at end of file
willowisp/willowisp/settings.py
View file @
d37959a2
...
...
@@ -37,7 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'heroes'
'heroes'
,
]
MIDDLEWARE
=
[
...
...
@@ -55,7 +55,9 @@ ROOT_URLCONF = 'willowisp.urls'
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[],
'DIRS'
:
[
'templates'
],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
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