Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
WillOWisp_Lab1
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
Margarita Perez
WillOWisp_Lab1
Commits
398857e2
Commit
398857e2
authored
Mar 09, 2020
by
Margarita Perez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More new changes to LFT
parent
90dd0ba7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
16 deletions
+36
-16
lab1_functional_test.py
lab1_functional_test.py
+36
-16
No files found.
lab1_functional_test.py
View file @
398857e2
...
...
@@ -20,47 +20,67 @@ class NewVisitorTest(unittest.TestCase):
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
self
.
assertIn
(
'The Will of the Wisps Wiki'
,
self
.
browser
.
title
)
#header_text = self.browser.find_element_by_tag_name('h1')
#self.assertIn('The Will of the Wisps Wiki', header_text)
# She sees a list containing three heroes with their corresponding
# names, health points, and damage
#names
cloud_text
=
self
.
browser
.
find_element_by_id
(
'cloud'
)
self
.
assertIn
(
'Cloud'
,
cloud_text
.
text
)
self
.
assertIn
(
'Cloud'
,
cloud_text
)
jester_text
=
self
.
browser
.
find_element_by_id
(
'jester'
)
self
.
assertIn
(
'Jester'
,
jester_text
.
text
)
self
.
assertIn
(
'Jester'
,
jester_text
)
sunflowey_text
=
self
.
browser
.
find_element_by_id
(
'sunflowey'
)
self
.
assertIn
(
'Sunflowey'
,
sunflowey_text
.
text
)
self
.
assertIn
(
'Sunflowey'
,
sunflowey_text
)
#health points
cloud_health
=
self
.
browser
.
find_element_by_id
(
'cloudHealth'
)
self
.
assertIn
(
'Cloud'
,
cloud_health
.
text
)
self
.
assertIn
(
'Cloud'
,
cloud_health
)
jester_health
=
self
.
browser
.
find_element_by_id
(
'jesterHealth'
)
self
.
assertIn
(
'Jester'
,
jester_health
.
text
)
self
.
assertIn
(
'Jester'
,
jester_health
)
sunflowey_health
=
self
.
browser
.
find_element_by_id
(
'sunfloweyHealth'
)
self
.
assertIn
(
'Sunflowey'
,
sunflowey_health
.
text
)
self
.
assertIn
(
'Sunflowey'
,
sunflowey_health
)
#damage
cloud_damage
=
self
.
browser
.
find_element_by_id
(
'cloudDamage'
)
self
.
assertIn
(
'Cloud'
,
cloud_damage
.
text
)
self
.
assertIn
(
'Cloud'
,
cloud_damage
)
jester_damage
=
self
.
browser
.
find_element_by_id
(
'jesterDamage'
)
self
.
assertIn
(
'Jester'
,
jester_damage
.
text
)
self
.
assertIn
(
'Jester'
,
jester_damage
)
sunflowey_damage
=
self
.
browser
.
find_element_by_id
(
'sunfloweyDamage'
)
self
.
assertIn
(
'Sunflowey'
,
sunflowey_damage
.
text
)
self
.
assertIn
(
'Sunflowey'
,
sunflowey_damage
)
# When she selects one of the heroes, she is sent to another page
# containing more information about the hero (additional stats, lore, image).
#cloud_stat = self.browser.find_element_by_id('cloud')
#self.assertIn('Cloud', cloud_text.text)
#stats
cloud_skills
=
self
.
browser
.
find_element_by_tag_id
(
'cloudSkills'
)
self
.
assertIn
(
'Nimbus, Rain Cloud, Thunderbolt'
,
cloud_skills
)
jester_skills
=
self
.
browser
.
find_element_by_tag_id
(
'jesterSkills'
)
self
.
assertIn
(
'Laugh, Dance, Smile'
,
jester_skills
)
sunflowey_skills
=
self
.
browser
.
find_element_by_tag_id
(
'sunfloweySkills'
)
self
.
assertIn
(
'Power Pellet, Sunshine, Pollen Punch'
,
sunflowey_skills
)
#jester_text = self.browser.find_element_by_id('jester')
#self.assertIn('Jester', jester_text.text)
#sunflowey_text = self.browser.find_element_by_id('sunflowey')
#self.assertIn('Sunflowey', sunflowey_text.text)
#lore
cloud_lore
=
self
.
browser
.
find_element_by_tag_id
(
'cloudLore'
)
self
.
assertIn
(
'I am a cloud. When I pee you call it "rain".'
,
cloud_lore
)
jester_lore
=
self
.
browser
.
find_element_by_tag_id
(
'jesterLore'
)
self
.
assertIn
(
'I do it for the LOLs.'
,
jester_lore
)
sunflowey_lore
=
self
.
browser
.
find_element_by_tag_id
(
'sunfloweyLore'
)
self
.
assertIn
(
'I am Sunflowey. Sometimes a sun, sometimes a flower.'
,
sunflowey_lore
)
# She spots the page title and header mentions the name of the hero she selected.
#cloud
self
.
browser
.
find_element_by_link_text
(
'cloud'
)
.
click
()
self
.
assertIn
(
'/hero/cloud/'
,
self
.
browser
.
current_url
)
self
.
assertIn
(
'Cloud'
,
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.
self
.
browser
.
find_element_by_link_text
(
'Back to Heroes'
)
.
click
()
self
.
assertIn
(
'/heroes/'
,
self
.
browser
.
current_url
)
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