Commit ef5744d8 authored by R E's avatar R E

Finish functional testing

parent f73b2076
...@@ -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>
......
...@@ -19,6 +19,50 @@ class NewVisitorTest(unittest.TestCase): ...@@ -19,6 +19,50 @@ 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).
...@@ -28,6 +72,18 @@ class NewVisitorTest(unittest.TestCase): ...@@ -28,6 +72,18 @@ class NewVisitorTest(unittest.TestCase):
# 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!')
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment