Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI40D Lab 1 Enriquez
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
R E
CSCI40D Lab 1 Enriquez
Commits
ef5744d8
Commit
ef5744d8
authored
Mar 07, 2020
by
R E
☃
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish functional testing
parent
f73b2076
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
12 deletions
+68
-12
home.html
heroes/templates/home.html
+9
-9
lab1_functional_test.py
lab1_functional_test.py
+59
-3
No files found.
heroes/templates/home.html
View file @
ef5744d8
...
@@ -6,17 +6,17 @@
...
@@ -6,17 +6,17 @@
<body>
<body>
<header><h1>
The Will of the Wisps Wiki
</h1></header>
<header><h1>
The Will of the Wisps Wiki
</h1></header>
<ul>
<ul>
<li><a
href=
"hero/cloud"
>
<h2>
Cloud
</h2></a><dl>
<li><a
href=
"hero/cloud"
id=
"cloud-li"
>
<h2>
Cloud
</h2></a><dl>
<dt
><b>
Health Points
</b>
600
</dt>
<dt
id=
"cloud-hp"
><b>
Health Points:
</b>
600
</dt>
<dt
><b>
Base Attack Damage
</b>
57
</dt>
<dt
id=
"cloud-dmg"
><b>
Base Attack Damage:
</b>
57
</dt>
</dl></li>
</dl></li>
<li><a
href=
"hero/jester"
>
<h2>
Jester
</h2></a><dl>
<li><a
href=
"hero/jester"
id=
"jester-li"
>
<h2>
Jester
</h2></a><dl>
<dt
><b>
Health Points
</b>
660
</dt>
<dt
id=
"jester-hp"
><b>
Health Points:
</b>
660
</dt>
<dt
><b>
Base Attack Damage
</b>
64
</dt>
<dt
id=
"jester-dmg"
><b>
Base Attack Damage:
</b>
64
</dt>
</dl></li>
</dl></li>
<li><a
href=
"hero/sunflowey"
>
<h2>
Sunflowey
</h2></a><dl>
<li><a
href=
"hero/sunflowey"
id=
"sunflowey-li"
>
<h2>
Sunflowey
</h2></a><dl>
<dt
><b>
Health Points
</b>
650
</dt>
<dt
id=
"sunflowey-hp"
><b>
Health Points:
</b>
650
</dt>
<dt
><b>
Base Attack Damage
</b>
43
</dt>
<dt
id=
"sunflowey-dmg"
><b>
Base Attack Damage:
</b>
43
</dt>
</dl></li>
</dl></li>
</ul>
</ul>
</body>
</body>
...
...
lab1_functional_test.py
View file @
ef5744d8
...
@@ -19,14 +19,70 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -19,14 +19,70 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
# names, health points, and damage
input
=
self
.
browser
.
find_element_by_id
(
'cloud-li'
)
self
.
assertEqual
(
input
.
text
,
'Cloud'
)
input
=
self
.
browser
.
find_element_by_id
(
'jester-li'
)
self
.
assertEqual
(
input
.
text
,
'Jester'
)
input
=
self
.
browser
.
find_element_by_id
(
'sunflowey-li'
)
self
.
assertEqual
(
input
.
text
,
'Sunflowey'
)
input
=
self
.
browser
.
find_element_by_id
(
'cloud-hp'
)
self
.
assertEqual
(
input
.
text
,
'Health Points: 600'
)
input
=
self
.
browser
.
find_element_by_id
(
'jester-hp'
)
self
.
assertEqual
(
input
.
text
,
'Health Points: 660'
)
input
=
self
.
browser
.
find_element_by_id
(
'sunflowey-hp'
)
self
.
assertEqual
(
input
.
text
,
'Health Points: 650'
)
input
=
self
.
browser
.
find_element_by_id
(
'cloud-dmg'
)
self
.
assertEqual
(
input
.
text
,
'Base Attack Damage: 57'
)
input
=
self
.
browser
.
find_element_by_id
(
'jester-dmg'
)
self
.
assertEqual
(
input
.
text
,
'Base Attack Damage: 64'
)
input
=
self
.
browser
.
find_element_by_id
(
'sunflowey-dmg'
)
self
.
assertEqual
(
input
.
text
,
'Base Attack Damage: 43'
)
# 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).
# 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.
# 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
.
browser
.
get
(
'http://localhost:8000/hero/cloud'
)
self
.
assertIn
(
'Cloud'
,
self
.
browser
.
title
)
self
.
browser
.
get
(
'http://localhost:8000'
)
self
.
browser
.
get
(
'http://localhost:8000/hero/jester'
)
self
.
assertIn
(
'Jester'
,
self
.
browser
.
title
)
self
.
browser
.
get
(
'http://localhost:8000'
)
self
.
browser
.
get
(
'http://localhost:8000/hero/sunflowey'
)
self
.
assertIn
(
'Sunflowey'
,
self
.
browser
.
title
)
self
.
browser
.
get
(
'http://localhost:8000'
)
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