Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
184424-Santos-Lab1-CSCI-40
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
Kirby Ezekiel Santos
184424-Santos-Lab1-CSCI-40
Commits
4a8109c4
Commit
4a8109c4
authored
Mar 07, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the rest of the home page contents of the project and passed the test on the first try
parent
2d4383d2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
4 deletions
+39
-4
tests.py
heroes/tests.py
+14
-2
lab1_functional_test.py
lab1_functional_test.py
+2
-2
willowisp_home_page.html
templates/willowisp_home_page.html
+23
-0
No files found.
heroes/tests.py
View file @
4a8109c4
from
django.test
import
TestCase
from
selenium
import
webdriver
import
unittest
class
CheckContents
(
unittest
.
TestCase
):
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
):
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
homePageHeader
=
self
.
browser
.
find_element_by_id
(
'homePageHeader'
)
self
.
assertEqual
(
homePageHeader
.
get_attribute
(
'innerHTML'
),
'The Will of the Wisps Wiki'
)
def
check_cloud_in_home_page
(
self
):
self
.
browser
.
get
(
'http://localhost:8000'
)
...
...
@@ -51,7 +62,8 @@ class CheckContents(unittest.TestCase):
sunfloweyHeader
=
self
.
browser
.
find_element_by_id
(
'sunfloweyHeader'
)
self
.
assertEqual
(
sunfloweyHeader
.
get_attribute
(
'innerHTML'
),
'Detail - Sunflowey'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
...
...
lab1_functional_test.py
View file @
4a8109c4
...
...
@@ -12,8 +12,8 @@ class NewVisitorTest(unittest.TestCase):
# Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
#
homePageHeader = self.browser.find_element_by_id('homePageHeader')
#
self.assertEqual(homePageHeader.get_attribute('innerHTML'), 'The Will of the Wisps Wiki')
homePageHeader
=
self
.
browser
.
find_element_by_id
(
'homePageHeader'
)
self
.
assertEqual
(
homePageHeader
.
get_attribute
(
'innerHTML'
),
'The Will of the Wisps Wiki'
)
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
...
...
templates/willowisp_home_page.html
View file @
4a8109c4
...
...
@@ -6,5 +6,28 @@
<body>
<h1
id =
"homePageHeader"
>
The Will of the Wisps Wiki
</h1>
<br>
<img
src=
"./cloud.png"
style=
"width: 10vw;"
/>
<h2
id =
"cloudName"
>
Cloud
</h2>
<dl>
<dt>
Health Points
</dt><dd
id =
"cloudHealth"
>
600
</dd>
<dt>
Base Attack Damage
</dt><dd
id =
"cloudAttack"
>
57
</dd>
</dl>
<img
src=
"./jester.png"
style=
"width: 10vw;"
/>
<h2
id =
"jesterName"
>
Jester
</h2>
<dl>
<dt>
Health Points
</dt><dd
id =
"jesterHealth"
>
660
</dd>
<dt>
Base Attack Damage
</dt><dd
id =
"jesterAttack"
>
64
</dd>
</dl>
<img
src=
"./sunflowey.png"
style=
"width: 10vw;"
/>
<h2
id =
"sunfloweyName"
>
Sunflowey
</h2>
<dl>
<dt>
Health Points
</dt><dd
id =
"sunfloweyHealth"
>
650
</dd>
<dt>
Base Attack Damage
</dt><dd
id =
"sunfloweyAttack"
>
43
</dd>
</dl>
</body>
</html>
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