Commit 6d1a3ae5 authored by Jesus Alvaro C. Pato's avatar Jesus Alvaro C. Pato

added functional tests

parent 470bfc7b
...@@ -18,17 +18,20 @@ class NewVisitorTest(unittest.TestCase): ...@@ -18,17 +18,20 @@ class NewVisitorTest(unittest.TestCase):
self.assertIn('The Will of the Wisps Wiki', self.browser.title) self.assertIn('The Will of the Wisps Wiki', self.browser.title)
# 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
self.assertEqual(browser.getCurrentUrl(), 'detail_heroes.html')
# 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).
actions.click(chosenHero)
self.browser.get('http://localhost:8000/hero' + chosenHero)
# She spots the page title and header mentions the name of the hero she selected. # She spots the page title and header mentions the name of the hero she selected.
self.assertIn('name of hero', self.browser.title)
# 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.
actions.click(backtoHomeButton)
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