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
58b2d792
Commit
58b2d792
authored
Mar 07, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for checking if the name, health, and attack stats can be seen in the home page
parent
82e87f1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
tests.py
heroes/tests.py
+28
-0
No files found.
heroes/tests.py
View file @
58b2d792
from
django.test
import
TestCase
import
unittest
class
CheckContents
(
unittest
.
TestCase
):
def
check_cloud
(
self
):
cloudName
=
self
.
browser
.
find_element_by_id
(
'cloudName'
)
self
.
assertEqual
(
cloudName
.
get_attribute
(
'innerHTML'
),
'Cloud'
)
cloudHealth
=
self
.
browser
.
find_element_by_id
(
'cloudHealth'
)
self
.
assertEqual
(
cloudHealth
.
get_attribute
(
'innerHTML'
),
'600'
)
cloudAttack
=
self
.
browser
.
find_element_by_id
(
'cloudAttack'
)
self
.
assertEqual
(
cloudAttack
.
get_attribute
(
'innerHTML'
),
'57'
)
def
check_jester
(
self
):
jesterName
=
self
.
browser
.
find_element_by_id
(
'jesterName'
)
self
.
assertEqual
(
jesterName
.
get_attribute
(
'innerHTML'
),
'Jester'
)
jesterHealth
=
self
.
browser
.
find_element_by_id
(
'jesterHealth'
)
self
.
assertEqual
(
jesterHealth
.
get_attribute
(
'innerHTML'
),
'660'
)
jesterAttack
=
self
.
browser
.
find_element_by_id
(
'jesterAttack'
)
self
.
assertEqual
(
jesterAttak
.
get_attribute
(
'innerHTML'
),
'64'
)
def
check_sunflowey
(
self
):
sunfloweyName
=
self
.
browser
.
find_element_by_id
(
'sunfloweyName'
)
self
.
assertEqual
(
jesterName
.
get_attribute
(
'innerHTML'
),
'Sunflowey'
)
sunfloweyHealth
=
self
.
browser
.
find_element_by_id
(
'sunfloweyHealth'
)
self
.
assertEqual
(
sunfloweyHealth
.
get_attribute
(
'innerHTML'
),
'650'
)
sunfloweyAttack
=
self
.
browser
.
find_element_by_id
(
'sunfloweyAttack'
)
self
.
assertEqual
(
sunfloweyAttack
.
get_attribute
(
'innerHTML'
),
'43'
)
# Create your tests here.
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