Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI40_Lab01_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
Ana Gabrielle S. Caligagan
CSCI40_Lab01_Willowisp
Commits
f9d7be35
Commit
f9d7be35
authored
Mar 06, 2020
by
Ana Gabrielle S. Caligagan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified lab1_functional_test.py by creating assertions.
parent
33622b18
Pipeline
#826
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
lab1_functional_test.py
lab1_functional_test.py
+22
-2
No files found.
lab1_functional_test.py
View file @
f9d7be35
...
...
@@ -4,7 +4,7 @@ import unittest
class
NewVisitorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
browser
=
webdriver
.
Chrome
()
def
tearDown
(
self
):
self
.
browser
.
quit
()
...
...
@@ -19,14 +19,34 @@ class NewVisitorTest(unittest.TestCase):
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
self
.
assertIn
(
'Cloud'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Health Points: 600'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Base Attack Damage: 57'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Jester'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Health Points: 660'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Base Attack Damage: 64'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Sunflowey'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Health Points: 650'
,
self
.
browser
.
body
)
self
.
assertIn
(
'Base Attack Damage: 43'
,
self
.
browser
.
body
)
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
browser
.
get
(
'http://localhost:8000/hero/cloud'
)
browser
.
get
(
'http://localhost:8000/hero/sunflowey'
)
browser
.
get
(
'http://localhost:8000/hero/jester'
)
# She spots the page title and header mentions the name of the hero she selected.
self
.
assertIn
(
'Cloud'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Sunflowey'
,
self
.
browser
.
title
)
self
.
assertIn
(
'Jester'
,
self
.
browser
.
title
)
# 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.
browser
.
get
(
'http://localhost:8000'
)
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