Modified lab1_functional_test.py by creating assertions.

parent 33622b18
Pipeline #826 canceled with stages
...@@ -20,13 +20,33 @@ class NewVisitorTest(unittest.TestCase): ...@@ -20,13 +20,33 @@ 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
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 # 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).
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. # 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". # 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.
browser.get('http://localhost:8000')
self.fail('Finish the test!') self.fail('Finish the test!')
......
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